From 6873bdb61b4e6c683e6c66beb0a8f0286c31264e Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Mon, 22 Jun 2020 16:00:45 -0500 Subject: [PATCH 01/13] Initial changes - added child and parent files for each sql file --- Gemfile.lock | 61 ++++++++++++++++++++++++++ data/manifest.json | 2 +- src/app/components/references/index.js | 2 + src/app/docs/analysis.html | 22 +++++++++- src/app/docs/analysis.js | 33 +++++++++++++- src/app/docs/macro.html | 11 ++++- src/app/docs/macro.js | 29 ++++++++++-- src/app/docs/model.html | 18 ++++++++ src/app/docs/model.js | 35 ++++++++++++++- src/app/docs/seed.html | 18 ++++++++ src/app/docs/seed.js | 33 +++++++++++++- src/app/docs/snapshot.html | 18 ++++++++ src/app/docs/snapshot.js | 34 +++++++++++++- src/app/docs/test.html | 18 ++++++++ src/app/docs/test.js | 34 +++++++++++++- src/app/docs/utils.js | 37 ++++++++++++++++ src/app/overview/overview.html | 1 + 17 files changed, 393 insertions(+), 13 deletions(-) create mode 100644 Gemfile.lock create mode 100644 src/app/docs/utils.js diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..4da21ef59 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,61 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + colorator (1.1.0) + concurrent-ruby (1.1.6) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + eventmachine (1.2.7) + ffi (1.13.1) + forwardable-extended (2.6.0) + http_parser.rb (0.6.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jekyll (3.8.7) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 2.0) + kramdown (~> 1.14) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) + safe_yaml (~> 1.0) + jekyll-sass-converter (1.5.2) + sass (~> 3.4) + jekyll-watch (2.2.1) + listen (~> 3.0) + kramdown (1.17.0) + liquid (4.0.3) + listen (3.2.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.3.6) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (4.0.5) + rb-fsevent (0.10.4) + rb-inotify (0.10.1) + ffi (~> 1.0) + rouge (3.20.0) + safe_yaml (1.0.5) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + +PLATFORMS + ruby + +DEPENDENCIES + jekyll (~> 3.8) + +BUNDLED WITH + 2.1.4 diff --git a/data/manifest.json b/data/manifest.json index ec96a411d..5ee91a66c 100644 --- a/data/manifest.json +++ b/data/manifest.json @@ -1 +1 @@ -{"nodes": {"model.jaffle_shop.stg_customers": {"raw_sql": "with 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_customers') }}\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "staging", "stg_customers"], "unique_id": "model.jaffle_shop.stg_customers", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "staging/stg_customers.sql", "original_file_path": "models/staging/stg_customers.sql", "name": "stg_customers", "resource_type": "model", "alias": "stg_customers", "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": ["staging", "hourly"]}, "tags": ["staging", "hourly"], "refs": [["raw_customers"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_customers"]}, "description": "", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/staging/schema.yml", "build_path": "target/compiled/jaffle_shop/staging/stg_customers.sql", "compiled": true, "compiled_sql": "with source as (\n select * from \"analytics\".\"test_schema\".\"raw_customers\"\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "with source as (\n select * from \"analytics\".\"test_schema\".\"raw_customers\"\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed", "wrapped_sql": null}, "model.jaffle_shop.stg_payments": {"raw_sql": "with 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\nrenamed 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 * from renamed", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "staging", "stg_payments"], "unique_id": "model.jaffle_shop.stg_payments", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "staging/stg_payments.sql", "original_file_path": "models/staging/stg_payments.sql", "name": "stg_payments", "resource_type": "model", "alias": "stg_payments", "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": ["staging", "hourly"]}, "tags": ["staging", "hourly"], "refs": [["raw_payments"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_payments"]}, "description": "", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "tags": ["billing"]}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "tags": []}}, "meta": {"owner": "@drew", "contains_pii": true, "SLA": "1 hour"}, "docs": {"show": true}, "patch_path": "models/staging/schema.yml", "build_path": "target/compiled/jaffle_shop/staging/stg_payments.sql", "compiled": true, "compiled_sql": "with source as (\n select * from \"analytics\".\"test_schema\".\"raw_payments\"\n\n),\n\nrenamed 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 * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "with source as (\n select * from \"analytics\".\"test_schema\".\"raw_payments\"\n\n),\n\nrenamed 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 * from renamed", "wrapped_sql": null}, "model.jaffle_shop.stg_orders": {"raw_sql": "/*\nhack for example macro references:\n {{ example_macro(\"abc\", \"123\") }}\n*/\n\nwith 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\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "staging", "stg_orders"], "unique_id": "model.jaffle_shop.stg_orders", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "staging/stg_orders.sql", "original_file_path": "models/staging/stg_orders.sql", "name": "stg_orders", "resource_type": "model", "alias": "stg_orders", "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": ["staging", "hourly"]}, "tags": ["staging", "hourly"], "refs": [["raw_orders"]], "sources": [], "depends_on": {"macros": ["macro.jaffle_shop.example_macro"], "nodes": ["seed.jaffle_shop.raw_orders"]}, "description": "", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/staging/schema.yml", "build_path": "target/compiled/jaffle_shop/staging/stg_orders.sql", "compiled": true, "compiled_sql": "/*\nhack for example macro references:\n \n\n The provided args are abc and 123\n\n\n*/\n\nwith source as (\n select * from \"analytics\".\"test_schema\".\"raw_orders\"\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "/*\nhack for example macro references:\n \n\n The provided args are abc and 123\n\n\n*/\n\nwith source as (\n select * from \"analytics\".\"test_schema\".\"raw_orders\"\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", "wrapped_sql": null}, "model.jaffle_shop.hidden_model": {"raw_sql": "-- hack for DAG viz\n-- {{ source('payments', 'orders') }}\n\nselect * from {{ ref('stg_orders') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "staging", "hidden_model"], "unique_id": "model.jaffle_shop.hidden_model", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "staging/hidden_model.sql", "original_file_path": "models/staging/hidden_model.sql", "name": "hidden_model", "resource_type": "model", "alias": "hidden_model", "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": ["staging", "hourly"]}, "tags": ["staging", "hourly"], "refs": [["stg_orders"]], "sources": [["payments", "orders"]], "depends_on": {"macros": [], "nodes": ["source.jaffle_shop.payments.orders", "model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": false}, "patch_path": "models/staging/schema.yml", "build_path": "target/compiled/jaffle_shop/staging/hidden_model.sql", "compiled": true, "compiled_sql": "-- hack for DAG viz\n-- \"analytics\".\"test_schema\".\"raw_orders\"\n\nselect * from \"analytics\".\"test_schema\".\"stg_orders\"", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "-- hack for DAG viz\n-- \"analytics\".\"test_schema\".\"raw_orders\"\n\nselect * from \"analytics\".\"test_schema\".\"stg_orders\"", "wrapped_sql": null}, "model.jaffle_shop.dim_customers": {"raw_sql": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\ncustomer_orders as (\n\n select * from {{ ref('customer_orders') }}\n\n),\n\ncustomer_payments as (\n\n select * from {{ ref('customer_payments') }}\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "marts", "core", "dim_customers"], "unique_id": "model.jaffle_shop.dim_customers", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/dim_customers.sql", "original_file_path": "models/marts/core/dim_customers.sql", "name": "dim_customers", "resource_type": "model", "alias": "dim_customers", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_customers"], ["customer_orders"], ["customer_payments"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_customers", "model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments"]}, "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": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": null, "tags": []}, "email": {"name": "email", "description": "Customer's email address. PII.", "meta": {}, "data_type": null, "tags": []}, "first_order": {"name": "first_order", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": null, "tags": []}, "most_recent_order": {"name": "most_recent_order", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": null, "tags": []}, "total_order_amount": {"name": "total_order_amount", "description": "Total value (AUD) of a customer's orders", "meta": {}, "data_type": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/marts/core/schema.yml", "build_path": "target/compiled/jaffle_shop/marts/core/dim_customers.sql", "compiled": true, "compiled_sql": "with customers as (\n\n select * from \"analytics\".\"test_schema\".\"stg_customers\"\n\n),\n\ncustomer_orders as (\n\n select * from \"analytics\".\"test_schema\".\"customer_orders\"\n\n),\n\ncustomer_payments as (\n\n select * from \"analytics\".\"test_schema\".\"customer_payments\"\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "with customers as (\n\n select * from \"analytics\".\"test_schema\".\"stg_customers\"\n\n),\n\ncustomer_orders as (\n\n select * from \"analytics\".\"test_schema\".\"customer_orders\"\n\n),\n\ncustomer_payments as (\n\n select * from \"analytics\".\"test_schema\".\"customer_payments\"\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "wrapped_sql": null}, "model.jaffle_shop.fct_orders": {"raw_sql": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\norder_payments as (\n\n select * from {{ ref('order_payments') }}\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "marts", "core", "fct_orders"], "unique_id": "model.jaffle_shop.fct_orders", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/fct_orders.sql", "original_file_path": "models/marts/core/fct_orders.sql", "name": "fct_orders", "resource_type": "model", "alias": "fct_orders", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_orders"], ["order_payments"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.order_payments"]}, "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": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": 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": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/marts/core/schema.yml", "build_path": "target/compiled/jaffle_shop/marts/core/fct_orders.sql", "compiled": true, "compiled_sql": "\n\nwith orders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\norder_payments as (\n\n select * from \"analytics\".\"test_schema\".\"order_payments\"\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\nwith orders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\norder_payments as (\n\n select * from \"analytics\".\"test_schema\".\"order_payments\"\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final", "wrapped_sql": null}, "model.jaffle_shop.order_payments": {"raw_sql": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\nfinal as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(case when payment_method = '{{payment_method}}' then amount else 0 end) as {{payment_method}}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "order_payments"], "unique_id": "model.jaffle_shop.order_payments", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/intermediate/order_payments.sql", "original_file_path": "models/marts/core/intermediate/order_payments.sql", "name": "order_payments", "resource_type": "model", "alias": "order_payments", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_payments"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_payments"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/marts/core/intermediate/order_payments.sql", "compiled": true, "compiled_sql": "\n\nwith payments as (\n\n select * from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\nfinal as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\nwith payments as (\n\n select * from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\nfinal as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final", "wrapped_sql": null}, "model.jaffle_shop.customer_payments": {"raw_sql": "with payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "customer_payments"], "unique_id": "model.jaffle_shop.customer_payments", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/intermediate/customer_payments.sql", "original_file_path": "models/marts/core/intermediate/customer_payments.sql", "name": "customer_payments", "resource_type": "model", "alias": "customer_payments", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_payments"], ["stg_orders"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_payments", "model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/marts/core/intermediate/customer_payments.sql", "compiled": true, "compiled_sql": "with payments as (\n\n select * from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\norders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "with payments as (\n\n select * from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\norders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "wrapped_sql": null}, "model.jaffle_shop.customer_orders": {"raw_sql": "with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "customer_orders"], "unique_id": "model.jaffle_shop.customer_orders", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/intermediate/customer_orders.sql", "original_file_path": "models/marts/core/intermediate/customer_orders.sql", "name": "customer_orders", "resource_type": "model", "alias": "customer_orders", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/marts/core/intermediate/customer_orders.sql", "compiled": true, "compiled_sql": "with orders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "with orders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final", "wrapped_sql": null}, "analysis.jaffle_shop.my_analysis": {"raw_sql": "select count(*) from {{ ref('stg_orders') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "analysis", "my_analysis"], "unique_id": "analysis.jaffle_shop.my_analysis", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "analysis/my_analysis.sql", "original_file_path": "analysis/my_analysis.sql", "name": "my_analysis", "resource_type": "analysis", "alias": "my_analysis", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "Here are the docs for my really cool analysis", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "analysis/analysis.yml", "build_path": "target/compiled/jaffle_shop/analysis/my_analysis.sql", "compiled": true, "compiled_sql": "select count(*) from \"analytics\".\"test_schema\".\"stg_orders\"", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "select count(*) from \"analytics\".\"test_schema\".\"stg_orders\"", "wrapped_sql": null}, "test.jaffle_shop.example_data_test": {"raw_sql": "select * from {{ ref('stg_orders') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "data_test", "example_data_test"], "unique_id": "test.jaffle_shop.example_data_test", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "data_test/example_data_test.sql", "original_file_path": "tests/example_data_test.sql", "name": "example_data_test", "resource_type": "test", "alias": "example_data_test", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["data"], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/data_test/example_data_test.sql", "compiled": true, "compiled_sql": "select * from \"analytics\".\"test_schema\".\"stg_orders\"", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "select * from \"analytics\".\"test_schema\".\"stg_orders\"", "wrapped_sql": "select count(*) as errors from (\nselect * from \"analytics\".\"test_schema\".\"stg_orders\"\n) sbq", "column_name": null, "test_metadata": null}, "seed.jaffle_shop.raw_customers": {"raw_sql": "", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "raw_customers"], "unique_id": "seed.jaffle_shop.raw_customers", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "raw_customers.csv", "original_file_path": "data/raw_customers.csv", "name": "raw_customers", "resource_type": "seed", "alias": "raw_customers", "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "compiled": true, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "", "wrapped_sql": null, "seed_file_path": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_customers.csv"}, "seed.jaffle_shop.raw_orders": {"raw_sql": "", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "raw_orders"], "unique_id": "seed.jaffle_shop.raw_orders", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "raw_orders.csv", "original_file_path": "data/raw_orders.csv", "name": "raw_orders", "resource_type": "seed", "alias": "raw_orders", "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "compiled": true, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "", "wrapped_sql": null, "seed_file_path": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_orders.csv"}, "seed.jaffle_shop.raw_payments": {"raw_sql": "", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "raw_payments"], "unique_id": "seed.jaffle_shop.raw_payments", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "raw_payments.csv", "original_file_path": "data/raw_payments.csv", "name": "raw_payments", "resource_type": "seed", "alias": "raw_payments", "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "compiled": true, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "", "wrapped_sql": null, "seed_file_path": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_payments.csv"}, "test.jaffle_shop.unique_stg_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(model=ref('stg_customers'), column_name='customer_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "unique_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_stg_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_customers_customer_id", "resource_type": "test", "alias": "unique_stg_customers_customer_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_customers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_customers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/unique_stg_customers_customer_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"stg_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"stg_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"stg_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "customer_id"}}}, "test.jaffle_shop.not_null_stg_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('stg_customers'), column_name='customer_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_stg_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_customers_customer_id", "resource_type": "test", "alias": "not_null_stg_customers_customer_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_customers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_customers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_stg_customers_customer_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_customers\"\nwhere customer_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_customers\"\nwhere customer_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_customers\"\nwhere customer_id is null\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "customer_id"}}}, "test.jaffle_shop.unique_stg_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(model=ref('stg_orders'), column_name='order_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "unique_stg_orders_order_id"], "unique_id": "test.jaffle_shop.unique_stg_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/unique_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_orders_order_id", "resource_type": "test", "alias": "unique_stg_orders_order_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/unique_stg_orders_order_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "column_name": "order_id", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "order_id"}}}, "test.jaffle_shop.not_null_stg_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('stg_orders'), column_name='order_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_stg_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_orders_order_id", "resource_type": "test", "alias": "not_null_stg_orders_order_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_stg_orders_order_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_orders\"\nwhere order_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_orders\"\nwhere order_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_orders\"\nwhere order_id is null\n\n", "column_name": "order_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "order_id"}}}, "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_accepted_values(model=ref('stg_orders'), column_name='status', values=['placed', 'shipped', 'completed', 'return_pending', 'returned']) }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/accepted_values_stg_orders_758238c28b8980ea7fe9d60a8d851ea8.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "alias": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values"], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/accepted_values_stg_orders_758238c28b8980ea7fe9d60a8d851ea8.sql", "compiled": true, "compiled_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "wrapped_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "column_name": "status", "test_metadata": {"namespace": null, "name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status"}}}, "test.jaffle_shop.unique_stg_payments_payment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(model=ref('stg_payments'), column_name='payment_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "unique_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.unique_stg_payments_payment_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_payments_payment_id", "resource_type": "test", "alias": "unique_stg_payments_payment_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["billing", "schema"], "refs": [["stg_payments"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_payments"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/unique_stg_payments_payment_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n payment_id\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n where payment_id is not null\n group by payment_id\n having count(*) > 1\n\n) validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n payment_id\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n where payment_id is not null\n group by payment_id\n having count(*) > 1\n\n) validation_errors\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n payment_id\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n where payment_id is not null\n group by payment_id\n having count(*) > 1\n\n) validation_errors\n\n", "column_name": "payment_id", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "payment_id"}}}, "test.jaffle_shop.not_null_stg_payments_payment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('stg_payments'), column_name='payment_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.not_null_stg_payments_payment_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_payments_payment_id", "resource_type": "test", "alias": "not_null_stg_payments_payment_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["billing", "schema"], "refs": [["stg_payments"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_payments"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_stg_payments_payment_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_payments\"\nwhere payment_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_payments\"\nwhere payment_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_payments\"\nwhere payment_id is null\n\n", "column_name": "payment_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "payment_id"}}}, "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_accepted_values(model=ref('stg_payments'), column_name='payment_method', values=['credit_card', 'coupon', 'bank_transfer', 'gift_card']) }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "unique_id": "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/accepted_values_stg_payments_944011baab727320a6b119d4d81589ae.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "alias": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values"], "nodes": ["model.jaffle_shop.stg_payments"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/accepted_values_stg_payments_944011baab727320a6b119d4d81589ae.sql", "compiled": true, "compiled_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n payment_method as value_field\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n payment_method as value_field\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "wrapped_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n payment_method as value_field\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "column_name": "payment_method", "test_metadata": {"namespace": null, "name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method"}}}, "test.jaffle_shop.unique_dim_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(model=ref('dim_customers'), column_name='customer_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "unique_dim_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_dim_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/unique_dim_customers_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "unique_dim_customers_customer_id", "resource_type": "test", "alias": "unique_dim_customers_customer_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["dim_customers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.dim_customers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/unique_dim_customers_customer_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"dim_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"dim_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"dim_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "customer_id"}}}, "test.jaffle_shop.not_null_dim_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('dim_customers'), column_name='customer_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_dim_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_dim_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_dim_customers_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_dim_customers_customer_id", "resource_type": "test", "alias": "not_null_dim_customers_customer_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["dim_customers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.dim_customers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_dim_customers_customer_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"dim_customers\"\nwhere customer_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"dim_customers\"\nwhere customer_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"dim_customers\"\nwhere customer_id is null\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "customer_id"}}}, "test.jaffle_shop.unique_fct_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(model=ref('fct_orders'), column_name='order_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "unique_fct_orders_order_id"], "unique_id": "test.jaffle_shop.unique_fct_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/unique_fct_orders_order_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "unique_fct_orders_order_id", "resource_type": "test", "alias": "unique_fct_orders_order_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/unique_fct_orders_order_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "column_name": "order_id", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "order_id"}}}, "test.jaffle_shop.not_null_fct_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='order_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_fct_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_order_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_order_id", "resource_type": "test", "alias": "not_null_fct_orders_order_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_order_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere order_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere order_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere order_id is null\n\n", "column_name": "order_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "order_id"}}}, "test.jaffle_shop.not_null_fct_orders_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='customer_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_customer_id"], "unique_id": "test.jaffle_shop.not_null_fct_orders_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_customer_id", "resource_type": "test", "alias": "not_null_fct_orders_customer_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_customer_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere customer_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere customer_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere customer_id is null\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "customer_id"}}}, "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_relationships(model=ref('fct_orders'), column_name='customer_id', field='customer_id', to=ref('dim_customers')) }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_"], "unique_id": "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/relationships_fct_orders_535c445ac9111d4713c286f097da3132.sql", "original_file_path": "models/marts/core/schema.yml", "name": "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "resource_type": "test", "alias": "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"], ["dim_customers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_relationships"], "nodes": ["model.jaffle_shop.fct_orders", "model.jaffle_shop.dim_customers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/relationships_fct_orders_535c445ac9111d4713c286f097da3132.sql", "compiled": true, "compiled_sql": "\n\n\n\n\nselect count(*)\nfrom (\n select customer_id as id from \"analytics\".\"test_schema\".\"fct_orders\"\n) as child\nleft join (\n select customer_id as id from \"analytics\".\"test_schema\".\"dim_customers\"\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\n\nselect count(*)\nfrom (\n select customer_id as id from \"analytics\".\"test_schema\".\"fct_orders\"\n) as child\nleft join (\n select customer_id as id from \"analytics\".\"test_schema\".\"dim_customers\"\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n", "wrapped_sql": "\n\n\n\n\nselect count(*)\nfrom (\n select customer_id as id from \"analytics\".\"test_schema\".\"fct_orders\"\n) as child\nleft join (\n select customer_id as id from \"analytics\".\"test_schema\".\"dim_customers\"\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "relationships", "kwargs": {"to": "ref('dim_customers')", "field": "customer_id", "column_name": "customer_id"}}}, "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_accepted_values(model=ref('fct_orders'), column_name='status', values=['placed', 'shipped', 'completed', 'return_pending', 'returned']) }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/accepted_values_fct_orders_758238c28b8980ea7fe9d60a8d851ea8.sql", "original_file_path": "models/marts/core/schema.yml", "name": "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "alias": "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/accepted_values_fct_orders_758238c28b8980ea7fe9d60a8d851ea8.sql", "compiled": true, "compiled_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "wrapped_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "column_name": "status", "test_metadata": {"namespace": null, "name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status"}}}, "test.jaffle_shop.not_null_fct_orders_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='amount') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_amount", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_amount", "resource_type": "test", "alias": "not_null_fct_orders_amount", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_amount.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere amount is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere amount is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere amount is null\n\n", "column_name": "amount", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "amount"}}}, "test.jaffle_shop.not_null_fct_orders_credit_card_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='credit_card_amount') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_credit_card_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_credit_card_amount", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_credit_card_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_credit_card_amount", "resource_type": "test", "alias": "not_null_fct_orders_credit_card_amount", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_credit_card_amount.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere credit_card_amount is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere credit_card_amount is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere credit_card_amount is null\n\n", "column_name": "credit_card_amount", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "credit_card_amount"}}}, "test.jaffle_shop.not_null_fct_orders_coupon_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='coupon_amount') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_coupon_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_coupon_amount", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_coupon_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_coupon_amount", "resource_type": "test", "alias": "not_null_fct_orders_coupon_amount", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_coupon_amount.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere coupon_amount is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere coupon_amount is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere coupon_amount is null\n\n", "column_name": "coupon_amount", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "coupon_amount"}}}, "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='bank_transfer_amount') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_bank_transfer_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_bank_transfer_amount", "resource_type": "test", "alias": "not_null_fct_orders_bank_transfer_amount", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_bank_transfer_amount.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere bank_transfer_amount is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere bank_transfer_amount is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere bank_transfer_amount is null\n\n", "column_name": "bank_transfer_amount", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "bank_transfer_amount"}}}, "test.jaffle_shop.not_null_fct_orders_gift_card_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='gift_card_amount') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_gift_card_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_gift_card_amount", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_gift_card_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_gift_card_amount", "resource_type": "test", "alias": "not_null_fct_orders_gift_card_amount", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_gift_card_amount.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere gift_card_amount is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere gift_card_amount is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere gift_card_amount is null\n\n", "column_name": "gift_card_amount", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "gift_card_amount"}}}, "source.jaffle_shop.payments.orders": {"fqn": ["jaffle_shop", "payments", "orders"], "database": "analytics", "schema": "test_schema", "unique_id": "source.jaffle_shop.payments.orders", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "models/staging/schema.yml", "original_file_path": "models/staging/schema.yml", "name": "orders", "source_name": "payments", "source_description": "", "loader": "", "identifier": "raw_orders", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": {"location": null, "file_format": null, "row_format": null, "tbl_properties": null, "partitions": null}, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": []}}, "macros": {"macro.dbt.statement": {"raw_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set status, res = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}\n\n{% macro noop_statement(name=None, status=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_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "resource_type": "macro", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set status, res = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.noop_statement": {"raw_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set status, res = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}\n\n{% macro noop_statement(name=None, status=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_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "resource_type": "macro", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, status=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_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.run_hooks": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.column_list": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.column_list", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "column_list", "macro_sql": "{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.column_list_for_create_table": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.column_list_for_create_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "column_list_for_create_table", "macro_sql": "{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.make_hook_config": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.before_begin": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.in_transaction": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.after_commit": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.drop_relation_if_exists": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.load_relation": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_merge_sql": {"raw_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter_macro('snapshot_merge_sql', target, source, insert_cols) }}\n{%- endmacro %}\n\n\n{% 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 = 'update'\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 %}", "unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "resource_type": "macro", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter_macro('snapshot_merge_sql', target, source, insert_cols) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_merge_sql": {"raw_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter_macro('snapshot_merge_sql', target, source, insert_cols) }}\n{%- endmacro %}\n\n\n{% 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 = 'update'\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 %}", "unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "resource_type": "macro", "name": "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 = 'update'\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.strategy_dispatch": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_hash_arguments": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_hash_arguments": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_get_time": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_get_time": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_timestamp_strategy": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_string_as_time": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_string_as_time": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_check_all_get_existing_columns": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_check_strategy": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_columns": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_columns": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.post_snapshot": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__post_snapshot": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_staging_table_inserts": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.snapshot_staging_table_inserts", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "snapshot_staging_table_inserts", "macro_sql": "{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_staging_table_updates": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.snapshot_staging_table_updates", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "snapshot_staging_table_updates", "macro_sql": "{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.build_snapshot_table": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "build_snapshot_table", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_or_create_relation": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "get_or_create_relation", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.build_snapshot_staging_table": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_snapshot_default": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_csv_table": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.reset_csv_table": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.load_csv_rows": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_csv_table": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__reset_csv_table": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_seed_column_quoted_csv": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.basic_load_csv_rows": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.basic_load_csv_rows", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "basic_load_csv_rows", "macro_sql": "{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__load_csv_rows": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_seed_default": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.incremental_upsert": {"raw_sql": "{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}", "unique_id": "macro.dbt.incremental_upsert", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/incremental/helpers.sql", "original_file_path": "macros/materializations/incremental/helpers.sql", "resource_type": "macro", "name": "incremental_upsert", "macro_sql": "{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_incremental_default": {"raw_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n {% set full_refresh_mode = flags.FULL_REFRESH %}\n\n {% set target_relation = this %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(this) %}\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 {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or full_refresh_mode %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set backup_identifier = existing_relation.identifier ~ \"__dbt_backup\" %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\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 %}", "unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/incremental/incremental.sql", "original_file_path": "macros/materializations/incremental/incremental.sql", "resource_type": "macro", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n {% set full_refresh_mode = flags.FULL_REFRESH %}\n\n {% set target_relation = this %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(this) %}\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 {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or full_refresh_mode %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set backup_identifier = existing_relation.identifier ~ \"__dbt_backup\" %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_merge_sql": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_delete_insert_merge_sql": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_merge_sql": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_quoted_csv": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\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{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.common_get_delete_insert_merge_sql": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.common_get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "common_get_delete_insert_merge_sql", "macro_sql": "{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_delete_insert_merge_sql": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_table_default": {"raw_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\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\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(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 {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_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 -- `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 %}", "unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/table/table.sql", "original_file_path": "macros/materializations/table/table.sql", "resource_type": "macro", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\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\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(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 {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_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 -- `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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_view_default": {"raw_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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 -%}", "unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/view/view.sql", "original_file_path": "macros/materializations/view/view.sql", "resource_type": "macro", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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 -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.handle_existing_table": {"raw_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter_macro(\"dbt.handle_existing_table\", full_refresh, old_relation) }}\n{% endmacro %}\n\n{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}\n\n{# /*\n Core materialization implementation. BigQuery and Snowflake are similar\n because both can use `create or replace view` where the resulting view schema\n is not necessarily the same as the existing view. On Redshift, this would\n result in: ERROR: cannot change number of columns in view\n\n This implementation is superior to the create_temp, swap_with_existing, drop_old\n paradigm because transactions don't run DDL queries atomically on Snowflake. By using\n `create or replace view`, the materialization becomes atomic in nature.\n */\n#}\n\n{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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(flags.FULL_REFRESH, old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "resource_type": "macro", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter_macro(\"dbt.handle_existing_table\", full_refresh, old_relation) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__handle_existing_table": {"raw_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter_macro(\"dbt.handle_existing_table\", full_refresh, old_relation) }}\n{% endmacro %}\n\n{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}\n\n{# /*\n Core materialization implementation. BigQuery and Snowflake are similar\n because both can use `create or replace view` where the resulting view schema\n is not necessarily the same as the existing view. On Redshift, this would\n result in: ERROR: cannot change number of columns in view\n\n This implementation is superior to the create_temp, swap_with_existing, drop_old\n paradigm because transactions don't run DDL queries atomically on Snowflake. By using\n `create or replace view`, the materialization becomes atomic in nature.\n */\n#}\n\n{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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(flags.FULL_REFRESH, old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "resource_type": "macro", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_or_replace_view": {"raw_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter_macro(\"dbt.handle_existing_table\", full_refresh, old_relation) }}\n{% endmacro %}\n\n{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}\n\n{# /*\n Core materialization implementation. BigQuery and Snowflake are similar\n because both can use `create or replace view` where the resulting view schema\n is not necessarily the same as the existing view. On Redshift, this would\n result in: ERROR: cannot change number of columns in view\n\n This implementation is superior to the create_temp, swap_with_existing, drop_old\n paradigm because transactions don't run DDL queries atomically on Snowflake. By using\n `create or replace view`, the materialization becomes atomic in nature.\n */\n#}\n\n{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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(flags.FULL_REFRESH, old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "resource_type": "macro", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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(flags.FULL_REFRESH, old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.generate_alias_name": {"raw_sql": "{#\n Renders a alias name given a custom alias name. If the custom\n alias name is none, then the resulting alias is just the filename of the\n model. If an alias override is specified, then that is used.\n\n This macro can be overriden in projects to define different semantics\n for rendering a alias name.\n\n Arguments:\n custom_alias_name: The custom alias name specified for a model, or none\n node: The available node that an alias is being generated for, or none\n\n#}\n{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_custom_alias.sql", "original_file_path": "macros/etc/get_custom_alias.sql", "resource_type": "macro", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.run_query": {"raw_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 %}", "unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/query.sql", "original_file_path": "macros/etc/query.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.is_incremental": {"raw_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 flags.FULL_REFRESH) }}\n {% endif %}\n{% endmacro %}", "unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/is_incremental.sql", "original_file_path": "macros/etc/is_incremental.sql", "resource_type": "macro", "name": "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 flags.FULL_REFRESH) }}\n {% endif %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.table_options": {"raw_sql": "{% macro table_options() %}\n {%- set raw_persist_docs = config.get('persist_docs', {}) -%}\n\n{%- endmacro -%}\n\n{% macro get_relation_comment(persist_docs, model) %}\n\n {%- if persist_docs is not mapping -%}\n {{ exceptions.raise_compiler_error(\"Invalid value provided for 'persist_docs'. Expected dict but got value: \" ~ raw_persist_docs) }}\n {% endif %}\n\n {% if persist_docs.get('relation', false) %}\n {{ return((model.description | tojson)[1:-1]) }}\n {%- else -%}\n {{ return(none) }}\n {% endif %}\n\n{% endmacro %}", "unique_id": "macro.dbt.table_options", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_relation_comment.sql", "original_file_path": "macros/etc/get_relation_comment.sql", "resource_type": "macro", "name": "table_options", "macro_sql": "{% macro table_options() %}\n {%- set raw_persist_docs = config.get('persist_docs', {}) -%}\n\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_relation_comment": {"raw_sql": "{% macro table_options() %}\n {%- set raw_persist_docs = config.get('persist_docs', {}) -%}\n\n{%- endmacro -%}\n\n{% macro get_relation_comment(persist_docs, model) %}\n\n {%- if persist_docs is not mapping -%}\n {{ exceptions.raise_compiler_error(\"Invalid value provided for 'persist_docs'. Expected dict but got value: \" ~ raw_persist_docs) }}\n {% endif %}\n\n {% if persist_docs.get('relation', false) %}\n {{ return((model.description | tojson)[1:-1]) }}\n {%- else -%}\n {{ return(none) }}\n {% endif %}\n\n{% endmacro %}", "unique_id": "macro.dbt.get_relation_comment", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_relation_comment.sql", "original_file_path": "macros/etc/get_relation_comment.sql", "resource_type": "macro", "name": "get_relation_comment", "macro_sql": "{% macro get_relation_comment(persist_docs, model) %}\n\n {%- if persist_docs is not mapping -%}\n {{ exceptions.raise_compiler_error(\"Invalid value provided for 'persist_docs'. Expected dict but got value: \" ~ raw_persist_docs) }}\n {% endif %}\n\n {% if persist_docs.get('relation', false) %}\n {{ return((model.description | tojson)[1:-1]) }}\n {%- else -%}\n {{ return(none) }}\n {% endif %}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.convert_datetime": {"raw_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 %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% 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 %}", "unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.dates_in_range": {"raw_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 %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% 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 %}", "unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.partition_range": {"raw_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 %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% 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 %}", "unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.py_current_timestring": {"raw_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 %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% 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 %}", "unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.generate_schema_name": {"raw_sql": "{#\n Renders a schema name given a custom schema name. If the custom\n schema name is none, then the resulting schema is just the \"schema\"\n value in the specified target. If a schema override is specified, then\n the resulting schema is the default schema concatenated with the\n custom schema.\n\n This macro can be overriden in projects to define different semantics\n for rendering a schema name.\n\n Arguments:\n custom_schema_name: The custom schema name specified for a model, or none\n node: The node the schema is being generated for\n\n#}\n{% macro 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 %}\n\n\n{#\n Renders a schema name given a custom schema name. In production, this macro\n will render out the overriden schema name for a model. Otherwise, the default\n schema specified in the active target is used.\n\n Arguments:\n custom_schema_name: The custom schema name specified for a model, or none\n node: The node the schema is being generated for\n\n#}\n{% 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 %}", "unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "resource_type": "macro", "name": "generate_schema_name", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.generate_schema_name_for_env": {"raw_sql": "{#\n Renders a schema name given a custom schema name. If the custom\n schema name is none, then the resulting schema is just the \"schema\"\n value in the specified target. If a schema override is specified, then\n the resulting schema is the default schema concatenated with the\n custom schema.\n\n This macro can be overriden in projects to define different semantics\n for rendering a schema name.\n\n Arguments:\n custom_schema_name: The custom schema name specified for a model, or none\n node: The node the schema is being generated for\n\n#}\n{% macro 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 %}\n\n\n{#\n Renders a schema name given a custom schema name. In production, this macro\n will render out the overriden schema name for a model. Otherwise, the default\n schema specified in the active target is used.\n\n Arguments:\n custom_schema_name: The custom schema name specified for a model, or none\n node: The node the schema is being generated for\n\n#}\n{% 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 %}", "unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.generate_database_name": {"raw_sql": "{#\n Renders a database name given a custom database name. If the custom\n database name is none, then the resulting database is just the \"database\"\n value in the specified target. If a database override is specified, then\n the resulting database is the default database concatenated with the\n custom database.\n\n This macro can be overriden in projects to define different semantics\n for rendering a database name.\n\n Arguments:\n custom_database_name: The custom database name specified for a model, or none\n node: The node the database is being generated for\n\n#}\n{% macro 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 %}", "unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "resource_type": "macro", "name": "generate_database_name", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.adapter_macro": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.adapter_macro", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "adapter_macro", "macro_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_columns_in_query": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_columns_in_query": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_schema": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "create_schema", "macro_sql": "{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_schema": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.drop_schema": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "drop_schema", "macro_sql": "{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__drop_schema": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_table_as": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_table_as": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 as (\n {{ sql }}\n );\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_view_as": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_view_as": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 }} as (\n {{ sql }}\n );\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_catalog": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": ["macro.dbt.adapter_macro"]}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_catalog": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_columns_in_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.sql_convert_columns_in_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_columns_in_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.alter_column_type": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__alter_column_type": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.drop_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__drop_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.truncate_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__truncate_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.rename_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__rename_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.information_schema_name": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__information_schema_name": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.list_schemas": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__list_schemas": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.check_schema_exists": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__check_schema_exists": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.list_relations_without_caching": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__list_relations_without_caching": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.current_timestamp": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__current_timestamp": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.collect_freshness": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__collect_freshness": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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').table) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.make_temp_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__make_temp_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.set_sql_header": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.test_relationships": {"raw_sql": "{% macro test_relationships(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nselect count(*)\nfrom (\n select {{ column_name }} as id from {{ model }}\n) as child\nleft join (\n select {{ field }} as id from {{ to }}\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n{% endmacro %}", "unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "resource_type": "macro", "name": "test_relationships", "macro_sql": "{% macro test_relationships(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nselect count(*)\nfrom (\n select {{ column_name }} as id from {{ model }}\n) as child\nleft join (\n select {{ field }} as id from {{ to }}\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.test_not_null": {"raw_sql": "{% macro test_not_null(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "resource_type": "macro", "name": "test_not_null", "macro_sql": "{% macro test_not_null(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.test_unique": {"raw_sql": "{% macro test_unique(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom (\n\n select\n {{ column_name }}\n\n from {{ model }}\n where {{ column_name }} is not null\n group by {{ column_name }}\n having count(*) > 1\n\n) validation_errors\n\n{% endmacro %}", "unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "resource_type": "macro", "name": "test_unique", "macro_sql": "{% macro test_unique(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom (\n\n select\n {{ column_name }}\n\n from {{ model }}\n where {{ column_name }} is not null\n group by {{ column_name }}\n having count(*) > 1\n\n) validation_errors\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.test_accepted_values": {"raw_sql": "{% macro test_accepted_values(model, values) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n{% set quote_values = kwargs.get('quote', True) %}\n\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 not in (\n {% for value in values -%}\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "resource_type": "macro", "name": "test_accepted_values", "macro_sql": "{% macro test_accepted_values(model, values) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n{% set quote_values = kwargs.get('quote', True) %}\n\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 not in (\n {% for value in values -%}\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__get_catalog": {"raw_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n\n {%- call statement('catalog', fetch_result=True) -%}\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n else 'BASE TABLE'\n end as table_type,\n null::text as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n null::text as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n\n where (\n {%- for schema in schemas -%}\n upper(sch.nspname) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence = 'p' -- [p]ermanent table. Other values are [u]nlogged table, [t]emporary table\n and tbl.relkind in ('r', 'v', 'f', 'p') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table, [m]aterialized view\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n\n{%- endmacro %}", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "resource_type": "macro", "name": "postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n\n {%- call statement('catalog', fetch_result=True) -%}\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n else 'BASE TABLE'\n end as table_type,\n null::text as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n null::text as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n\n where (\n {%- for schema in schemas -%}\n upper(sch.nspname) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence = 'p' -- [p]ermanent table. Other values are [u]nlogged table, [t]emporary table\n and tbl.relkind in ('r', 'v', 'f', 'p') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table, [m]aterialized view\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres_get_relations": {"raw_sql": "{% macro postgres_get_relations () -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "unique_id": "macro.dbt_postgres.postgres_get_relations", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "resource_type": "macro", "name": "postgres_get_relations", "macro_sql": "{% macro postgres_get_relations () -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__create_table_as": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__create_schema": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__create_schema", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__drop_schema": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__information_schema_name": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__list_schemas": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__check_schema_exists": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__current_timestamp": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__snapshot_get_time": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__make_temp_relation": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__make_temp_relation", "macro_sql": "{% macro postgres__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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"raw_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ 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 = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text = 'update'::text\n and {{ 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{% endmacro %}", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "resource_type": "macro", "name": "postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ 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 = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text = 'update'::text\n and {{ 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{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.jaffle_shop.example_macro": {"raw_sql": "{% macro example_macro(arg_1, arg_2) %}\n\n The provided args are {{ arg_1 }} and {{ arg_2 }}\n\n{% endmacro %}", "unique_id": "macro.jaffle_shop.example_macro", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "macros/example_macro.sql", "original_file_path": "macros/example_macro.sql", "resource_type": "macro", "name": "example_macro", "macro_sql": "{% macro example_macro(arg_1, arg_2) %}\n\n The provided args are {{ arg_1 }} and {{ arg_2 }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "A macro that does a thing", "meta": {}, "patch_path": "macros/macros.yml", "arguments": [{"name": "arg_1", "type": "str", "description": "The first argument"}, {"name": "arg_2", "type": "int", "description": "The second argument"}]}, "macro.dbt_utils.except": {"raw_sql": "{% macro except() %}\n {{ adapter_macro('dbt_utils.except') }}\n{% endmacro %}\n\n\n{% macro default__except() %}\n\n except\n\n{% endmacro %}\n \n{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "resource_type": "macro", "name": "except", "macro_sql": "{% macro except() %}\n {{ adapter_macro('dbt_utils.except') }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__except": {"raw_sql": "{% macro except() %}\n {{ adapter_macro('dbt_utils.except') }}\n{% endmacro %}\n\n\n{% macro default__except() %}\n\n except\n\n{% endmacro %}\n \n{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "resource_type": "macro", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__except": {"raw_sql": "{% macro except() %}\n {{ adapter_macro('dbt_utils.except') }}\n{% endmacro %}\n\n\n{% macro default__except() %}\n\n except\n\n{% endmacro %}\n \n{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "resource_type": "macro", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.replace": {"raw_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ adapter_macro('dbt_utils.replace', field, old_chars, new_chars) }}\n{% endmacro %}\n\n\n{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "resource_type": "macro", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ adapter_macro('dbt_utils.replace', field, old_chars, new_chars) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__replace": {"raw_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ adapter_macro('dbt_utils.replace', field, old_chars, new_chars) }}\n{% endmacro %}\n\n\n{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.concat": {"raw_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}\n\n\n{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}\n\n\n{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}\n\n\n{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}\n\n\n{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "resource_type": "macro", "name": "concat", "macro_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__concat": {"raw_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}\n\n\n{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}\n\n\n{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}\n\n\n{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}\n\n\n{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "resource_type": "macro", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.alternative_concat": {"raw_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}\n\n\n{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}\n\n\n{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}\n\n\n{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}\n\n\n{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.alternative_concat", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "resource_type": "macro", "name": "alternative_concat", "macro_sql": "{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__concat": {"raw_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}\n\n\n{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}\n\n\n{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}\n\n\n{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}\n\n\n{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.redshift__concat", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "resource_type": "macro", "name": "redshift__concat", "macro_sql": "{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__concat": {"raw_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}\n\n\n{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}\n\n\n{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}\n\n\n{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}\n\n\n{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__concat", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "resource_type": "macro", "name": "snowflake__concat", "macro_sql": "{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.identifier": {"raw_sql": "{% macro identifier(value) %}\n {{ adapter_macro('dbt_utils.identifier', value) }}\n{% endmacro %}\n\n{% macro default__identifier(value) -%}\n \"{{ value }}\"\n{%- endmacro %}\n\n{% macro bigquery__identifier(value) -%}\n `{{ value }}`\n{%- endmacro %}", "unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifer.sql", "original_file_path": "macros/cross_db_utils/identifer.sql", "resource_type": "macro", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\n {{ adapter_macro('dbt_utils.identifier', value) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__identifier": {"raw_sql": "{% macro identifier(value) %}\n {{ adapter_macro('dbt_utils.identifier', value) }}\n{% endmacro %}\n\n{% macro default__identifier(value) -%}\n \"{{ value }}\"\n{%- endmacro %}\n\n{% macro bigquery__identifier(value) -%}\n `{{ value }}`\n{%- endmacro %}", "unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifer.sql", "original_file_path": "macros/cross_db_utils/identifer.sql", "resource_type": "macro", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\n \"{{ value }}\"\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__identifier": {"raw_sql": "{% macro identifier(value) %}\n {{ adapter_macro('dbt_utils.identifier', value) }}\n{% endmacro %}\n\n{% macro default__identifier(value) -%}\n \"{{ value }}\"\n{%- endmacro %}\n\n{% macro bigquery__identifier(value) -%}\n `{{ value }}`\n{%- endmacro %}", "unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifer.sql", "original_file_path": "macros/cross_db_utils/identifer.sql", "resource_type": "macro", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\n `{{ value }}`\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_string": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_string": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__type_string": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__type_string": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__type_string": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_timestamp": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_timestamp": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__type_timestamp": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_float": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_float": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_float": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_numeric": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_numeric": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_numeric": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_bigint": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_bigint": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_bigint": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_int": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_int": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_int": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils._is_relation": {"raw_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 %}", "unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "resource_type": "macro", "name": "_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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.length": {"raw_sql": "{% macro length(expression) -%}\n {{ adapter_macro('dbt_utils.length', expression) }}\n{% endmacro %}\n\n\n{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "resource_type": "macro", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ adapter_macro('dbt_utils.length', expression) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__length": {"raw_sql": "{% macro length(expression) -%}\n {{ adapter_macro('dbt_utils.length', expression) }}\n{% endmacro %}\n\n\n{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "resource_type": "macro", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__length": {"raw_sql": "{% macro length(expression) -%}\n {{ adapter_macro('dbt_utils.length', expression) }}\n{% endmacro %}\n\n\n{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "resource_type": "macro", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.dateadd": {"raw_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ adapter_macro('dbt_utils.dateadd', datepart, interval, from_date_or_timestamp) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "resource_type": "macro", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ adapter_macro('dbt_utils.dateadd', datepart, interval, from_date_or_timestamp) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__dateadd": {"raw_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ adapter_macro('dbt_utils.dateadd', datepart, interval, from_date_or_timestamp) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__dateadd": {"raw_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ adapter_macro('dbt_utils.dateadd', datepart, interval, from_date_or_timestamp) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "resource_type": "macro", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__dateadd": {"raw_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ adapter_macro('dbt_utils.dateadd', datepart, interval, from_date_or_timestamp) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "resource_type": "macro", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.intersect": {"raw_sql": "{% macro intersect() %}\n {{ adapter_macro('dbt_utils.intersect') }}\n{% endmacro %}\n\n\n{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}\n\n{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "resource_type": "macro", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ adapter_macro('dbt_utils.intersect') }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__intersect": {"raw_sql": "{% macro intersect() %}\n {{ adapter_macro('dbt_utils.intersect') }}\n{% endmacro %}\n\n\n{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}\n\n{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "resource_type": "macro", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__intersect": {"raw_sql": "{% macro intersect() %}\n {{ adapter_macro('dbt_utils.intersect') }}\n{% endmacro %}\n\n\n{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}\n\n{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "resource_type": "macro", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.right": {"raw_sql": "{% macro right(string_text, length_expression) -%}\n {{ adapter_macro('dbt_utils.right', string_text, length_expression) }}\n{% endmacro %}\n\n{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "resource_type": "macro", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ adapter_macro('dbt_utils.right', string_text, length_expression) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__right": {"raw_sql": "{% macro right(string_text, length_expression) -%}\n {{ adapter_macro('dbt_utils.right', string_text, length_expression) }}\n{% endmacro %}\n\n{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "resource_type": "macro", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__right": {"raw_sql": "{% macro right(string_text, length_expression) -%}\n {{ adapter_macro('dbt_utils.right', string_text, length_expression) }}\n{% endmacro %}\n\n{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "resource_type": "macro", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__right": {"raw_sql": "{% macro right(string_text, length_expression) -%}\n {{ adapter_macro('dbt_utils.right', string_text, length_expression) }}\n{% endmacro %}\n\n{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "resource_type": "macro", "name": "snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.datediff": {"raw_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ adapter_macro('dbt_utils.datediff', first_date, second_date, datepart) }}\n{% endmacro %}\n\n\n{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}\n\n\n{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__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 ({{ dbt_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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 %}", "unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "resource_type": "macro", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ adapter_macro('dbt_utils.datediff', first_date, second_date, datepart) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__datediff": {"raw_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ adapter_macro('dbt_utils.datediff', first_date, second_date, datepart) }}\n{% endmacro %}\n\n\n{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}\n\n\n{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__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 ({{ dbt_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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 %}", "unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__datediff": {"raw_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ adapter_macro('dbt_utils.datediff', first_date, second_date, datepart) }}\n{% endmacro %}\n\n\n{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}\n\n\n{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__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 ({{ dbt_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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 %}", "unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "resource_type": "macro", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__datediff": {"raw_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ adapter_macro('dbt_utils.datediff', first_date, second_date, datepart) }}\n{% endmacro %}\n\n\n{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}\n\n\n{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__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 ({{ dbt_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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 %}", "unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "resource_type": "macro", "name": "postgres__datediff", "macro_sql": "{% macro postgres__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 ({{ dbt_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.safe_cast": {"raw_sql": "{% macro safe_cast(field, type) %}\n {{ adapter_macro('dbt_utils.safe_cast', field, type) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}\n\n\n{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "resource_type": "macro", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ adapter_macro('dbt_utils.safe_cast', field, type) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__safe_cast": {"raw_sql": "{% macro safe_cast(field, type) %}\n {{ adapter_macro('dbt_utils.safe_cast', field, type) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}\n\n\n{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__safe_cast": {"raw_sql": "{% macro safe_cast(field, type) %}\n {{ adapter_macro('dbt_utils.safe_cast', field, type) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}\n\n\n{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "resource_type": "macro", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__safe_cast": {"raw_sql": "{% macro safe_cast(field, type) %}\n {{ adapter_macro('dbt_utils.safe_cast', field, type) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}\n\n\n{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "resource_type": "macro", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.hash": {"raw_sql": "{% macro hash(field) -%}\n {{ adapter_macro('dbt_utils.hash', field) }}\n{%- endmacro %}\n\n\n{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}\n\n\n{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "resource_type": "macro", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ adapter_macro('dbt_utils.hash', field) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__hash": {"raw_sql": "{% macro hash(field) -%}\n {{ adapter_macro('dbt_utils.hash', field) }}\n{%- endmacro %}\n\n\n{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}\n\n\n{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "resource_type": "macro", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__hash": {"raw_sql": "{% macro hash(field) -%}\n {{ adapter_macro('dbt_utils.hash', field) }}\n{%- endmacro %}\n\n\n{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}\n\n\n{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "resource_type": "macro", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.position": {"raw_sql": "{% macro position(substring_text, string_text) -%}\n {{ adapter_macro('dbt_utils.position', substring_text, string_text) }}\n{% endmacro %}\n\n\n{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "resource_type": "macro", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ adapter_macro('dbt_utils.position', substring_text, string_text) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__position": {"raw_sql": "{% macro position(substring_text, string_text) -%}\n {{ adapter_macro('dbt_utils.position', substring_text, string_text) }}\n{% endmacro %}\n\n\n{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "resource_type": "macro", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__position": {"raw_sql": "{% macro position(substring_text, string_text) -%}\n {{ adapter_macro('dbt_utils.position', substring_text, string_text) }}\n{% endmacro %}\n\n\n{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "resource_type": "macro", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.string_literal": {"raw_sql": "{%- macro string_literal(value) -%}\n {{ adapter_macro('dbt_utils.string_literal', value) }}\n{%- endmacro -%}\n\n{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "resource_type": "macro", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ adapter_macro('dbt_utils.string_literal', value) }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__string_literal": {"raw_sql": "{%- macro string_literal(value) -%}\n {{ adapter_macro('dbt_utils.string_literal', value) }}\n{%- endmacro -%}\n\n{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "resource_type": "macro", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.current_timestamp": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__current_timestamp": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__current_timestamp": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__current_timestamp": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.current_timestamp_in_utc": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__current_timestamp_in_utc": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__current_timestamp_in_utc": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "snowflake__current_timestamp_in_utc", "macro_sql": "{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__current_timestamp_in_utc": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.postgres__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "postgres__current_timestamp_in_utc", "macro_sql": "{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.width_bucket": {"raw_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ adapter_macro('dbt_utils.width_bucket', expr, min_value, max_value, num_buckets) }}\n{% endmacro %}\n\n\n{% 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_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro redshift__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 exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "resource_type": "macro", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ adapter_macro('dbt_utils.width_bucket', expr, min_value, max_value, num_buckets) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__width_bucket": {"raw_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ adapter_macro('dbt_utils.width_bucket', expr, min_value, max_value, num_buckets) }}\n{% endmacro %}\n\n\n{% 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_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro redshift__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 exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "resource_type": "macro", "name": "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_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__width_bucket": {"raw_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ adapter_macro('dbt_utils.width_bucket', expr, min_value, max_value, num_buckets) }}\n{% endmacro %}\n\n\n{% 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_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro redshift__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 exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "resource_type": "macro", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__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 exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__width_bucket": {"raw_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ adapter_macro('dbt_utils.width_bucket', expr, min_value, max_value, num_buckets) }}\n{% endmacro %}\n\n\n{% 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_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro redshift__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 exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.last_day": {"raw_sql": "/*\nThis function has been tested with dateparts of month and quarters. Further\ntesting is required to validate that it will work on other dateparts.\n*/\n\n{% macro last_day(date, datepart) %}\n {{ adapter_macro('dbt_utils.last_day', date, datepart) }}\n{% endmacro %}\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}\n\n\n{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "resource_type": "macro", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ adapter_macro('dbt_utils.last_day', date, datepart) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default_last_day": {"raw_sql": "/*\nThis function has been tested with dateparts of month and quarters. Further\ntesting is required to validate that it will work on other dateparts.\n*/\n\n{% macro last_day(date, datepart) %}\n {{ adapter_macro('dbt_utils.last_day', date, datepart) }}\n{% endmacro %}\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}\n\n\n{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "resource_type": "macro", "name": "default_last_day", "macro_sql": "\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__last_day": {"raw_sql": "/*\nThis function has been tested with dateparts of month and quarters. Further\ntesting is required to validate that it will work on other dateparts.\n*/\n\n{% macro last_day(date, datepart) %}\n {{ adapter_macro('dbt_utils.last_day', date, datepart) }}\n{% endmacro %}\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}\n\n\n{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "resource_type": "macro", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__last_day": {"raw_sql": "/*\nThis function has been tested with dateparts of month and quarters. Further\ntesting is required to validate that it will work on other dateparts.\n*/\n\n{% macro last_day(date, datepart) %}\n {{ adapter_macro('dbt_utils.last_day', date, datepart) }}\n{% endmacro %}\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}\n\n\n{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "resource_type": "macro", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.split_part": {"raw_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ adapter_macro('dbt_utils.split_part', string_text, delimiter_text, part_number) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "resource_type": "macro", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ adapter_macro('dbt_utils.split_part', string_text, delimiter_text, part_number) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__split_part": {"raw_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ adapter_macro('dbt_utils.split_part', string_text, delimiter_text, part_number) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__split_part": {"raw_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ adapter_macro('dbt_utils.split_part', string_text, delimiter_text, part_number) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "resource_type": "macro", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.date_trunc": {"raw_sql": "{% macro date_trunc(datepart, date) %}\n {{ adapter_macro('dbt_utils.date_trunc', datepart, date) }}\n{% endmacro %}\n\n{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}\n\n{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp), \n {{datepart}}\n )\n \n\n{% endmacro %}", "unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "resource_type": "macro", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) %}\n {{ adapter_macro('dbt_utils.date_trunc', datepart, date) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__date_trunc": {"raw_sql": "{% macro date_trunc(datepart, date) %}\n {{ adapter_macro('dbt_utils.date_trunc', datepart, date) }}\n{% endmacro %}\n\n{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}\n\n{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp), \n {{datepart}}\n )\n \n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "resource_type": "macro", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__date_trunc": {"raw_sql": "{% macro date_trunc(datepart, date) %}\n {{ adapter_macro('dbt_utils.date_trunc', datepart, date) }}\n{% endmacro %}\n\n{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}\n\n{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp), \n {{datepart}}\n )\n \n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "resource_type": "macro", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp), \n {{datepart}}\n )\n \n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_period_boundaries": {"raw_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}\n\n{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}\n\n{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}};\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {%- set rows_inserted = (load_result('main-' ~ i)['status'].split(\" \"))[2] | int -%}\n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement(name='main', status=status_string) -%}\n -- no-op\n {%- endcall %}\n\n{%- endmaterialization %}", "unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "resource_type": "macro", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_period_sql": {"raw_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}\n\n{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}\n\n{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}};\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {%- set rows_inserted = (load_result('main-' ~ i)['status'].split(\" \"))[2] | int -%}\n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement(name='main', status=status_string) -%}\n -- no-op\n {%- endcall %}\n\n{%- endmaterialization %}", "unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "resource_type": "macro", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.materialization_insert_by_period_default": {"raw_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}\n\n{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}\n\n{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}};\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {%- set rows_inserted = (load_result('main-' ~ i)['status'].split(\" \"))[2] | int -%}\n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement(name='main', status=status_string) -%}\n -- no-op\n {%- endcall %}\n\n{%- endmaterialization %}", "unique_id": "macro.dbt_utils.materialization_insert_by_period_default", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "resource_type": "macro", "name": "materialization_insert_by_period_default", "macro_sql": "{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}};\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {%- set rows_inserted = (load_result('main-' ~ i)['status'].split(\" \"))[2] | int -%}\n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement(name='main', status=status_string) -%}\n -- no-op\n {%- endcall %}\n\n{%- endmaterialization %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.pretty_log_format": {"raw_sql": "{% macro pretty_log_format(message) %}\n\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/logger/pretty_log_format.sql", "original_file_path": "macros/logger/pretty_log_format.sql", "resource_type": "macro", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.pretty_time": {"raw_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/logger/pretty_time.sql", "original_file_path": "macros/logger/pretty_time.sql", "resource_type": "macro", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.log_info": {"raw_sql": "{% macro log_info(message) %}\n\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/logger/log_info.sql", "original_file_path": "macros/logger/log_info.sql", "resource_type": "macro", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_intervals_between": {"raw_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.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 %}\n\n\n\n\n{% macro date_spine(datepart, start_date, end_date) %}\n\n/*\ncall as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n)\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_utils.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 %}", "unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/date_spine.sql", "resource_type": "macro", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.date_spine": {"raw_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.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 %}\n\n\n\n\n{% macro date_spine(datepart, start_date, end_date) %}\n\n/*\ncall as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n)\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_utils.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 %}", "unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/date_spine.sql", "resource_type": "macro", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n\n/*\ncall as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n)\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_utils.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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_url_host": {"raw_sql": "{% macro get_url_host(field) -%}\n\n{%- set parsed = \n dbt_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n \n-%}\n\n \n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n \n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "resource_type": "macro", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n\n{%- set parsed = \n dbt_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n \n-%}\n\n \n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n \n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_url_path": {"raw_sql": "{% macro get_url_path(field) -%}\n\n {%- set stripped_url = \n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{dbt_utils.position(\"'/'\", stripped_url)}}, 0),\n {{dbt_utils.position(\"'?'\", stripped_url)}} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt_utils.split_part(\n dbt_utils.right(\n stripped_url, \n dbt_utils.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ), \n \"'?'\", 1\n )\n -%}\n\n {{ dbt_utils.safe_cast(\n parsed_path,\n dbt_utils.type_string()\n )}}\n \n{%- endmacro %}", "unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "resource_type": "macro", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n\n {%- set stripped_url = \n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{dbt_utils.position(\"'/'\", stripped_url)}}, 0),\n {{dbt_utils.position(\"'?'\", stripped_url)}} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt_utils.split_part(\n dbt_utils.right(\n stripped_url, \n dbt_utils.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ), \n \"'?'\", 1\n )\n -%}\n\n {{ dbt_utils.safe_cast(\n parsed_path,\n dbt_utils.type_string()\n )}}\n \n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_url_parameter": {"raw_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "resource_type": "macro", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.haversine_distance": {"raw_sql": "{#\nThis calculates the distance between two sets of latitude and longitude.\nThe formula is from the following blog post:\nhttp://daynebatten.com/2015/09/latitude-longitude-distance-sql/\n\nThe arguments should be float type. \n#}\n\n{% macro haversine_distance(lat1,lon1,lat2,lon2) -%}\n\n 2 * 3961 * asin(sqrt((sin(radians(({{lat2}} - {{lat1}}) / 2))) ^ 2 +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n (sin(radians(({{lon2}} - {{lon1}}) / 2))) ^ 2))\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/geo/haversine_distance.sql", "original_file_path": "macros/geo/haversine_distance.sql", "resource_type": "macro", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1,lon1,lat2,lon2) -%}\n\n 2 * 3961 * asin(sqrt((sin(radians(({{lat2}} - {{lat1}}) / 2))) ^ 2 +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n (sin(radians(({{lon2}} - {{lon1}}) / 2))) ^ 2))\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_equal_rowcount": {"raw_sql": "{% macro test_equal_rowcount(model) %}\n\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\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\nwith a as (\n\n select count(*) as count_a from {{ model }}\n\n),\nb as (\n\n select count(*) as count_b from {{ compare_model }}\n\n),\nfinal as (\n\n select abs(\n (select count_a from a) -\n (select count_b from b)\n )\n as diff_count\n\n)\n\nselect diff_count from final\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "resource_type": "macro", "name": "test_equal_rowcount", "macro_sql": "{% macro test_equal_rowcount(model) %}\n\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\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\nwith a as (\n\n select count(*) as count_a from {{ model }}\n\n),\nb as (\n\n select count(*) as count_b from {{ compare_model }}\n\n),\nfinal as (\n\n select abs(\n (select count_a from a) -\n (select count_b from b)\n )\n as diff_count\n\n)\n\nselect diff_count from final\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_relationships_where": {"raw_sql": "{% macro test_relationships_where(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n{% set from_condition = kwargs.get('from_condition', \"true\") %}\n{% set to_condition = kwargs.get('to_condition', \"true\") %}\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 count(*) from exceptions\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "resource_type": "macro", "name": "test_relationships_where", "macro_sql": "{% macro test_relationships_where(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n{% set from_condition = kwargs.get('from_condition', \"true\") %}\n{% set to_condition = kwargs.get('to_condition', \"true\") %}\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 count(*) from exceptions\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_recency": {"raw_sql": "{% macro test_recency(model, datepart, interval) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n\nselect\n case when count(*) > 0 then 0\n else 1\n end as error_result\nfrom {{model}}\nwhere {{column_name}} >=\n {{dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp())}}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "resource_type": "macro", "name": "test_recency", "macro_sql": "{% macro test_recency(model, datepart, interval) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n\nselect\n case when count(*) > 0 then 0\n else 1\n end as error_result\nfrom {{model}}\nwhere {{column_name}} >=\n {{dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp())}}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_not_constant": {"raw_sql": "{% macro test_not_constant(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\n\nfrom (\n\n select\n count(distinct {{ column_name }})\n\n from {{ model }}\n\n having count(distinct {{ column_name }}) = 1\n\n ) validation_errors\n\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "resource_type": "macro", "name": "test_not_constant", "macro_sql": "{% macro test_not_constant(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\n\nfrom (\n\n select\n count(distinct {{ column_name }})\n\n from {{ model }}\n\n having count(distinct {{ column_name }}) = 1\n\n ) validation_errors\n\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_at_least_one": {"raw_sql": "{% macro test_at_least_one(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom (\n select\n\n count({{ column_name }})\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "resource_type": "macro", "name": "test_at_least_one", "macro_sql": "{% macro test_at_least_one(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom (\n select\n\n count({{ column_name }})\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_unique_combination_of_columns": {"raw_sql": "{% macro test_unique_combination_of_columns(model) %}\n\n{%- set columns = kwargs.get('combination_of_columns', kwargs.get('arg')) %}\n\n{%- set columns_csv=columns | join(', ') %}\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect count(*)\nfrom validation_errors\n\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "resource_type": "macro", "name": "test_unique_combination_of_columns", "macro_sql": "{% macro test_unique_combination_of_columns(model) %}\n\n{%- set columns = kwargs.get('combination_of_columns', kwargs.get('arg')) %}\n\n{%- set columns_csv=columns | join(', ') %}\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect count(*)\nfrom validation_errors\n\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_cardinality_equality": {"raw_sql": "{% macro test_cardinality_equality(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by 1\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by 1\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_utils.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt_utils.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 count(*)\nfrom unioned\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "resource_type": "macro", "name": "test_cardinality_equality", "macro_sql": "{% macro test_cardinality_equality(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by 1\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by 1\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_utils.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt_utils.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 count(*)\nfrom unioned\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_expression_is_true": {"raw_sql": "{% macro test_expression_is_true(model, condition='true') %}\n\n{% set expression = kwargs.get('expression', kwargs.get('arg')) %}\n\nwith meet_condition as (\n\n select * from {{ model }} where {{ condition }}\n\n),\nvalidation_errors as (\n\n select\n *\n from meet_condition\n where not({{expression}})\n\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "resource_type": "macro", "name": "test_expression_is_true", "macro_sql": "{% macro test_expression_is_true(model, condition='true') %}\n\n{% set expression = kwargs.get('expression', kwargs.get('arg')) %}\n\nwith meet_condition as (\n\n select * from {{ model }} where {{ condition }}\n\n),\nvalidation_errors as (\n\n select\n *\n from meet_condition\n where not({{expression}})\n\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_equality": {"raw_sql": "{% macro test_equality(model) %}\n\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-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\n{% set compare_columns = kwargs.get('compare_columns', adapter.get_columns_in_relation(model) | map(attribute='quoted') ) %}\n{% set compare_cols_csv = compare_columns | join(', ') %}\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_utils.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_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select * from a_minus_b\n union all\n select * from b_minus_a\n\n),\n\nfinal as (\n\n select (select count(*) from unioned) +\n (select abs(\n (select count(*) from a_minus_b) -\n (select count(*) from b_minus_a)\n ))\n as count\n\n)\n\nselect count from final\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "resource_type": "macro", "name": "test_equality", "macro_sql": "{% macro test_equality(model) %}\n\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-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\n{% set compare_columns = kwargs.get('compare_columns', adapter.get_columns_in_relation(model) | map(attribute='quoted') ) %}\n{% set compare_cols_csv = compare_columns | join(', ') %}\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_utils.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_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select * from a_minus_b\n union all\n select * from b_minus_a\n\n),\n\nfinal as (\n\n select (select count(*) from unioned) +\n (select abs(\n (select count(*) from a_minus_b) -\n (select count(*) from b_minus_a)\n ))\n as count\n\n)\n\nselect count from final\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"raw_sql": "{% macro test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed') %}\n\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\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 }},\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 }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_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 nore 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 < upper_bound,\n false\n ) as lower_bound_less_than_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_less_than_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect count(*) from validation_errors\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "resource_type": "macro", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% macro test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed') %}\n\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\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 }},\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 }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_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 nore 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 < upper_bound,\n false\n ) as lower_bound_less_than_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_less_than_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect count(*) from validation_errors\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.nullcheck_table": {"raw_sql": "{% macro nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(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 %}", "unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "resource_type": "macro", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_powers_of_two": {"raw_sql": "{% macro 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 %}\n\n\n{% macro 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 * pow(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 %}", "unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "resource_type": "macro", "name": "get_powers_of_two", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.generate_series": {"raw_sql": "{% macro 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 %}\n\n\n{% macro 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 * pow(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 %}", "unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "resource_type": "macro", "name": "generate_series", "macro_sql": "{% macro 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 * pow(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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_relations_by_prefix": {"raw_sql": "{% macro 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(database, row.table_schema, row.table_name) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}\n\n{% macro get_tables_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {% if execute %}\n {{ log(\"Warning: the `get_tables_by_prefix` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `get_relations_by_prefix` macro instead\", info=True) }}\n {% endif %}\n\n\n {{ return(dbt_utils.get_relations_by_prefix(schema, prefix, exclude, database)) }}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "resource_type": "macro", "name": "get_relations_by_prefix", "macro_sql": "{% macro 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(database, row.table_schema, row.table_name) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_tables_by_prefix": {"raw_sql": "{% macro 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(database, row.table_schema, row.table_name) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}\n\n{% macro get_tables_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {% if execute %}\n {{ log(\"Warning: the `get_tables_by_prefix` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `get_relations_by_prefix` macro instead\", info=True) }}\n {% endif %}\n\n\n {{ return(dbt_utils.get_relations_by_prefix(schema, prefix, exclude, database)) }}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.get_tables_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "resource_type": "macro", "name": "get_tables_by_prefix", "macro_sql": "{% macro get_tables_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {% if execute %}\n {{ log(\"Warning: the `get_tables_by_prefix` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `get_relations_by_prefix` macro instead\", info=True) }}\n {% endif %}\n\n\n {{ return(dbt_utils.get_relations_by_prefix(schema, prefix, exclude, database)) }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_tables_by_prefix_sql": {"raw_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ adapter_macro('dbt_utils.get_tables_by_prefix_sql', schema, prefix, exclude, database) }}\n{% endmacro %}\n\n{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n select distinct \n table_schema as \"table_schema\", table_name as \"table_name\"\n from {{database}}.information_schema.tables\n where table_schema ilike '{{ schema }}'\n and table_name ilike '{{ prefix }}%'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}\n\n\n{% macro bigquery__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n \n select distinct\n dataset_id as table_schema, table_id as table_name\n\n from {{adapter.quote(database)}}.{{schema}}.__TABLES_SUMMARY__\n where dataset_id = '{{schema}}'\n and lower(table_id) like lower ('{{prefix}}%')\n and lower(table_id) not like lower ('{{exclude}}')\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "resource_type": "macro", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ adapter_macro('dbt_utils.get_tables_by_prefix_sql', schema, prefix, exclude, database) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"raw_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ adapter_macro('dbt_utils.get_tables_by_prefix_sql', schema, prefix, exclude, database) }}\n{% endmacro %}\n\n{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n select distinct \n table_schema as \"table_schema\", table_name as \"table_name\"\n from {{database}}.information_schema.tables\n where table_schema ilike '{{ schema }}'\n and table_name ilike '{{ prefix }}%'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}\n\n\n{% macro bigquery__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n \n select distinct\n dataset_id as table_schema, table_id as table_name\n\n from {{adapter.quote(database)}}.{{schema}}.__TABLES_SUMMARY__\n where dataset_id = '{{schema}}'\n and lower(table_id) like lower ('{{prefix}}%')\n and lower(table_id) not like lower ('{{exclude}}')\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "resource_type": "macro", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n select distinct \n table_schema as \"table_schema\", table_name as \"table_name\"\n from {{database}}.information_schema.tables\n where table_schema ilike '{{ schema }}'\n and table_name ilike '{{ prefix }}%'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__get_tables_by_prefix_sql": {"raw_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ adapter_macro('dbt_utils.get_tables_by_prefix_sql', schema, prefix, exclude, database) }}\n{% endmacro %}\n\n{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n select distinct \n table_schema as \"table_schema\", table_name as \"table_name\"\n from {{database}}.information_schema.tables\n where table_schema ilike '{{ schema }}'\n and table_name ilike '{{ prefix }}%'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}\n\n\n{% macro bigquery__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n \n select distinct\n dataset_id as table_schema, table_id as table_name\n\n from {{adapter.quote(database)}}.{{schema}}.__TABLES_SUMMARY__\n where dataset_id = '{{schema}}'\n and lower(table_id) like lower ('{{prefix}}%')\n and lower(table_id) not like lower ('{{exclude}}')\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "resource_type": "macro", "name": "bigquery__get_tables_by_prefix_sql", "macro_sql": "{% macro bigquery__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n \n select distinct\n dataset_id as table_schema, table_id as table_name\n\n from {{adapter.quote(database)}}.{{schema}}.__TABLES_SUMMARY__\n where dataset_id = '{{schema}}'\n and lower(table_id) like lower ('{{prefix}}%')\n and lower(table_id) not like lower ('{{exclude}}')\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.star": {"raw_sql": "{% macro star(from, relation_alias=False, except=[]) -%}\n\n {%- do dbt_utils._is_relation(from, 'star') -%}\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 {%- for col in cols -%}\n\n {%- if col.column not in except -%}\n {% do include_cols.append(col.column) %}\n\n {%- endif %}\n {%- endfor %}\n\n {%- for col in include_cols %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ dbt_utils.identifier(col)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "resource_type": "macro", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[]) -%}\n\n {%- do dbt_utils._is_relation(from, 'star') -%}\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 {%- for col in cols -%}\n\n {%- if col.column not in except -%}\n {% do include_cols.append(col.column) %}\n\n {%- endif %}\n {%- endfor %}\n\n {%- for col in include_cols %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ dbt_utils.identifier(col)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.unpivot": {"raw_sql": "{#\nPivot values from columns to rows. Similar to pandas DataFrame melt() function.\n\nExample Usage: {{ unpivot(relation=ref('users'), cast_to='integer', exclude=['id','created_at']) }}\n\nArguments:\n relation: Relation object, required.\n cast_to: The datatype to cast all unpivoted columns to. Default is varchar.\n exclude: A list of columns to keep but exclude from the unpivot operation. Default is none.\n remove: A list of columns to remove from the resulting table. Default is none.\n field_name: Destination table column name for the source table column names.\n value_name: Destination table column name for the pivoted values\n#}\n\n{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if execute and table %}\n {{ log(\"Warning: the `unpivot` macro no longer accepts a `table` parameter. This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead\", info=True) }}\n {% endif %}\n\n {% if relation and table %}\n {{ exceptions.raise_compiler_error(\"Error: both the `relation` and `table` parameters were provided to `unpivot` macro. Choose one only (we recommend `relation`).\") }}\n {% elif not relation and table %}\n {% set relation=table %}\n {% elif not relation and not table %}\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 {%- 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 select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt_utils.type_string() }}) as {{ field_name }},\n cast({{ col.column }} as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "resource_type": "macro", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if execute and table %}\n {{ log(\"Warning: the `unpivot` macro no longer accepts a `table` parameter. This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead\", info=True) }}\n {% endif %}\n\n {% if relation and table %}\n {{ exceptions.raise_compiler_error(\"Error: both the `relation` and `table` parameters were provided to `unpivot` macro. Choose one only (we recommend `relation`).\") }}\n {% elif not relation and table %}\n {% set relation=table %}\n {% elif not relation and not table %}\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 {%- 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 select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt_utils.type_string() }}) as {{ field_name }},\n cast({{ col.column }} as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.union_relations": {"raw_sql": "{%- macro union_relations(relations, 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_utils.string_literal(relation) }} as {{ dbt_utils.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 {{ relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- if execute -%}\n {{ log(\"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\", info=True) }}\n {%- endif -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "resource_type": "macro", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, 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_utils.string_literal(relation) }} as {{ dbt_utils.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 {{ relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.union_tables": {"raw_sql": "{%- macro union_relations(relations, 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_utils.string_literal(relation) }} as {{ dbt_utils.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 {{ relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- if execute -%}\n {{ log(\"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\", info=True) }}\n {%- endif -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.union_tables", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "resource_type": "macro", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- if execute -%}\n {{ log(\"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\", info=True) }}\n {%- endif -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.group_by": {"raw_sql": "{%- macro 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 -%}", "unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "resource_type": "macro", "name": "group_by", "macro_sql": "{%- macro 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 -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.surrogate_key": {"raw_sql": "{%- macro surrogate_key() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% set _ = fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt_utils.type_string() ~ \"), '')\"\n ) %}\n\n {% if not loop.last %}\n {% set _ = fields.append(\"'-'\") %}\n {% endif %}\n\n{%- endfor -%}\n\n{{dbt_utils.hash(dbt_utils.concat(fields))}}\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "resource_type": "macro", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% set _ = fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt_utils.type_string() ~ \"), '')\"\n ) %}\n\n {% if not loop.last %}\n {% set _ = fields.append(\"'-'\") %}\n {% endif %}\n\n{%- endfor -%}\n\n{{dbt_utils.hash(dbt_utils.concat(fields))}}\n\n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.safe_add": {"raw_sql": "{%- macro safe_add() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "resource_type": "macro", "name": "safe_add", "macro_sql": "{%- macro safe_add() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.nullcheck": {"raw_sql": "{% macro 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 %}", "unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "resource_type": "macro", "name": "nullcheck", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_column_values": {"raw_sql": "{#\nThis macro fetches the unique values for `column` in the table `table`\n\nArguments:\n table: A model `ref`, or a schema.table string for the table to query (Required)\n column: The column to query for unique values\n max_records: If provided, the maximum number of unique records to return (default: none)\n\nReturns:\n A list of distinct values for the specified columns\n#}\n\n{% macro get_column_values(table, column, max_records=none, default=none) -%}\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 {%- set target_relation = adapter.get_relation(database=table.database,\n schema=table.schema,\n identifier=table.identifier) -%}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not target_relation and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ table ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not target_relation and default is not none -%}\n\n {{ log(\"Relation \" ~ table ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by 1\n order by count(*) desc\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 %}", "unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "resource_type": "macro", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, max_records=none, default=none) -%}\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 {%- set target_relation = adapter.get_relation(database=table.database,\n schema=table.schema,\n identifier=table.identifier) -%}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not target_relation and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ table ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not target_relation and default is not none -%}\n\n {{ log(\"Relation \" ~ table ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by 1\n order by count(*) desc\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.pivot": {"raw_sql": "{#\nPivot values from rows to columns.\n\nExample:\n\n Input: `public.test`\n\n | size | color |\n |------+-------|\n | S | red |\n | S | blue |\n | S | red |\n | M | red |\n\n select\n size,\n {{ dbt_utils.pivot('color', dbt_utils.get_column_values('public.test',\n 'color')) }}\n from public.test\n group by size\n\n Output:\n\n | size | red | blue |\n |------+-----+------|\n | S | 2 | 1 |\n | M | 1 | 0 |\n\nArguments:\n column: Column name, required\n values: List of row values to turn into columns, required\n alias: Whether to create column aliases, default is True\n agg: SQL aggregation function, default is sum\n cmp: SQL value comparison, default is =\n prefix: Column alias prefix, default is blank\n suffix: Column alias postfix, default is blank\n then_value: Value to use if comparison succeeds, default is 1\n else_value: Value to use if comparison fails, default is 0\n quote_identifiers: Whether to surround column aliases with double quotes, default is true\n#}\n\n{% 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 {% for v in values %}\n {{ agg }}(\n case\n when {{ column }} {{ cmp }} '{{ v }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ v ~ suffix) }}\n {% else %}\n as {{prefix ~ v ~ suffix }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "resource_type": "macro", "name": "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 {% for v in values %}\n {{ agg }}(\n case\n when {{ column }} {{ cmp }} '{{ v }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ v ~ suffix) }}\n {% else %}\n as {{prefix ~ v ~ suffix }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_query_results_as_dict": {"raw_sql": "{% macro get_query_results_as_dict(query) %}\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 %}", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "resource_type": "macro", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}}, "docs": {"jaffle_shop.__overview__": {"unique_id": "jaffle_shop.__overview__", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "overview.md", "original_file_path": "models/overview.md", "file_contents": "{% docs __overview__ %}\n\n## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for demonstrations and tutorials.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop).\n\n{% enddocs %}", "name": "__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 demonstrations and tutorials.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "jaffle_shop.orders_status": {"unique_id": "jaffle_shop.orders_status", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/docs.md", "original_file_path": "models/marts/core/docs.md", "file_contents": "{% docs orders_status %}\n\nOrders 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 |\n\n\n{% enddocs %}", "name": "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 |"}, "dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "file_contents": "{% docs __overview__ %}\n\n### 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 `--models` 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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://slack.getdbt.com/) on Slack for live questions and support.\n\n{% enddocs %}", "name": "__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 `--models` 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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://slack.getdbt.com/) on Slack for live questions and support."}}, "disabled": [], "generated_at": "2020-03-04T16:18:40.721355Z", "parent_map": {"model.jaffle_shop.stg_customers": ["seed.jaffle_shop.raw_customers"], "model.jaffle_shop.stg_payments": ["seed.jaffle_shop.raw_payments"], "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], "model.jaffle_shop.hidden_model": ["model.jaffle_shop.stg_orders", "source.jaffle_shop.payments.orders"], "model.jaffle_shop.dim_customers": ["model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments", "model.jaffle_shop.stg_customers"], "model.jaffle_shop.fct_orders": ["model.jaffle_shop.order_payments", "model.jaffle_shop.stg_orders"], "model.jaffle_shop.order_payments": ["model.jaffle_shop.stg_payments"], "model.jaffle_shop.customer_payments": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.stg_payments"], "model.jaffle_shop.customer_orders": ["model.jaffle_shop.stg_orders"], "analysis.jaffle_shop.my_analysis": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.example_data_test": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_customers": [], "seed.jaffle_shop.raw_orders": [], "seed.jaffle_shop.raw_payments": [], "test.jaffle_shop.unique_stg_customers_customer_id": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.not_null_stg_customers_customer_id": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.unique_stg_orders_order_id": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.not_null_stg_orders_order_id": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.unique_stg_payments_payment_id": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.not_null_stg_payments_payment_id": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_dim_customers_customer_id": ["model.jaffle_shop.dim_customers"], "test.jaffle_shop.not_null_dim_customers_customer_id": ["model.jaffle_shop.dim_customers"], "test.jaffle_shop.unique_fct_orders_order_id": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_order_id": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_customer_id": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_": ["model.jaffle_shop.dim_customers", "model.jaffle_shop.fct_orders"], "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_credit_card_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_coupon_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_gift_card_amount": ["model.jaffle_shop.fct_orders"], "source.jaffle_shop.payments.orders": []}, "child_map": {"model.jaffle_shop.stg_customers": ["model.jaffle_shop.dim_customers", "test.jaffle_shop.not_null_stg_customers_customer_id", "test.jaffle_shop.unique_stg_customers_customer_id"], "model.jaffle_shop.stg_payments": ["model.jaffle_shop.customer_payments", "model.jaffle_shop.order_payments", "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "test.jaffle_shop.not_null_stg_payments_payment_id", "test.jaffle_shop.unique_stg_payments_payment_id"], "model.jaffle_shop.stg_orders": ["analysis.jaffle_shop.my_analysis", "model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments", "model.jaffle_shop.fct_orders", "model.jaffle_shop.hidden_model", "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "test.jaffle_shop.example_data_test", "test.jaffle_shop.not_null_stg_orders_order_id", "test.jaffle_shop.unique_stg_orders_order_id"], "model.jaffle_shop.hidden_model": [], "model.jaffle_shop.dim_customers": ["test.jaffle_shop.not_null_dim_customers_customer_id", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "test.jaffle_shop.unique_dim_customers_customer_id"], "model.jaffle_shop.fct_orders": ["test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "test.jaffle_shop.not_null_fct_orders_amount", "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount", "test.jaffle_shop.not_null_fct_orders_coupon_amount", "test.jaffle_shop.not_null_fct_orders_credit_card_amount", "test.jaffle_shop.not_null_fct_orders_customer_id", "test.jaffle_shop.not_null_fct_orders_gift_card_amount", "test.jaffle_shop.not_null_fct_orders_order_id", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "test.jaffle_shop.unique_fct_orders_order_id"], "model.jaffle_shop.order_payments": ["model.jaffle_shop.fct_orders"], "model.jaffle_shop.customer_payments": ["model.jaffle_shop.dim_customers"], "model.jaffle_shop.customer_orders": ["model.jaffle_shop.dim_customers"], "analysis.jaffle_shop.my_analysis": [], "test.jaffle_shop.example_data_test": [], "seed.jaffle_shop.raw_customers": ["model.jaffle_shop.stg_customers"], "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_stg_customers_customer_id": [], "test.jaffle_shop.not_null_stg_customers_customer_id": [], "test.jaffle_shop.unique_stg_orders_order_id": [], "test.jaffle_shop.not_null_stg_orders_order_id": [], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned": [], "test.jaffle_shop.unique_stg_payments_payment_id": [], "test.jaffle_shop.not_null_stg_payments_payment_id": [], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card": [], "test.jaffle_shop.unique_dim_customers_customer_id": [], "test.jaffle_shop.not_null_dim_customers_customer_id": [], "test.jaffle_shop.unique_fct_orders_order_id": [], "test.jaffle_shop.not_null_fct_orders_order_id": [], "test.jaffle_shop.not_null_fct_orders_customer_id": [], "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_": [], "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned": [], "test.jaffle_shop.not_null_fct_orders_amount": [], "test.jaffle_shop.not_null_fct_orders_credit_card_amount": [], "test.jaffle_shop.not_null_fct_orders_coupon_amount": [], "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount": [], "test.jaffle_shop.not_null_fct_orders_gift_card_amount": [], "source.jaffle_shop.payments.orders": ["model.jaffle_shop.hidden_model"]}, "metadata": {"project_id": "06e5b98c2db46f8a72cc4f66410e9b3b", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres"}, "files": {"/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/core.sql": {"path": {"searched_path": "macros", "relative_path": "core.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "9dde6e3cf4b01799f44b1c6d4f23e77f471567a1cbbeab763da5032f0d102821"}, "nodes": [], "docs": [], "macros": ["macro.dbt.statement", "macro.dbt.noop_statement"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/helpers.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/helpers.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "f29316a03082e0c4e9e0b9cc5d73af75206c9db845d01b1e2068d7bb2ab58090"}, "nodes": [], "docs": [], "macros": ["macro.dbt.run_hooks", "macro.dbt.column_list", "macro.dbt.column_list_for_create_table", "macro.dbt.make_hook_config", "macro.dbt.before_begin", "macro.dbt.in_transaction", "macro.dbt.after_commit", "macro.dbt.drop_relation_if_exists", "macro.dbt.load_relation"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/snapshot/snapshot_merge.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/snapshot/snapshot_merge.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "5c6f5982ea4f6a4efe7106b9706c78197d355ef5a50d9ca1c254ba9fe8b5d114"}, "nodes": [], "docs": [], "macros": ["macro.dbt.snapshot_merge_sql", "macro.dbt.default__snapshot_merge_sql"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/snapshot/strategies.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/snapshot/strategies.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "3f88751a98bef086ae59d67a8090e28140aebad8c3c4dbbf7fd462e422d808da"}, "nodes": [], "docs": [], "macros": ["macro.dbt.strategy_dispatch", "macro.dbt.snapshot_hash_arguments", "macro.dbt.default__snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.default__snapshot_get_time", "macro.dbt.snapshot_timestamp_strategy", "macro.dbt.snapshot_string_as_time", "macro.dbt.default__snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_check_strategy"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/snapshot/snapshot.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/snapshot/snapshot.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "3f8c4854169daa7257c62bb2ecf4ee532d0e87b59ed2151382e6c4728b259cce"}, "nodes": [], "docs": [], "macros": ["macro.dbt.create_columns", "macro.dbt.default__create_columns", "macro.dbt.post_snapshot", "macro.dbt.default__post_snapshot", "macro.dbt.snapshot_staging_table_inserts", "macro.dbt.snapshot_staging_table_updates", "macro.dbt.build_snapshot_table", "macro.dbt.get_or_create_relation", "macro.dbt.build_snapshot_staging_table", "macro.dbt.materialization_snapshot_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/seed/seed.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/seed/seed.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "3108894047b1bbf22594ec0e7e1cc9769c58bf3caa4f699b6827aa67dcdbc5dd"}, "nodes": [], "docs": [], "macros": ["macro.dbt.create_csv_table", "macro.dbt.reset_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.default__create_csv_table", "macro.dbt.default__reset_csv_table", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.basic_load_csv_rows", "macro.dbt.default__load_csv_rows", "macro.dbt.materialization_seed_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/incremental/helpers.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/incremental/helpers.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "c37f9127e9c8a575db6ac76470aa8e4bea07d5d8c714511349a74607e32306e1"}, "nodes": [], "docs": [], "macros": ["macro.dbt.incremental_upsert"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/incremental/incremental.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/incremental/incremental.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "f29fd9555f8f24be85b629603b4499e3eac7dde2e52d92343921b6506fad07c7"}, "nodes": [], "docs": [], "macros": ["macro.dbt.materialization_incremental_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/common/merge.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/common/merge.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "11e647c11ca8449c0400eca04bf6486c0e583d108f0bbdb325f2557b0ffe5827"}, "nodes": [], "docs": [], "macros": ["macro.dbt.get_merge_sql", "macro.dbt.get_delete_insert_merge_sql", "macro.dbt.default__get_merge_sql", "macro.dbt.get_quoted_csv", "macro.dbt.common_get_delete_insert_merge_sql", "macro.dbt.default__get_delete_insert_merge_sql"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/table/table.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/table/table.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "7532a98937b3f467b639610ab7d68b121f94f2570576e84ebb285e326c52d93f"}, "nodes": [], "docs": [], "macros": ["macro.dbt.materialization_table_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/view/view.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/view/view.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "495441a9fa472aa6e369a9e87c469e3e82bd2f5cdf90605a3e574b6bfcf9a999"}, "nodes": [], "docs": [], "macros": ["macro.dbt.materialization_view_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/view/create_or_replace_view.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/view/create_or_replace_view.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "f248f585af455af494d885fb929bcca529e44e080670740feb2c792674599eba"}, "nodes": [], "docs": [], "macros": ["macro.dbt.handle_existing_table", "macro.dbt.default__handle_existing_table", "macro.dbt.create_or_replace_view"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/get_custom_alias.sql": {"path": {"searched_path": "macros", "relative_path": "etc/get_custom_alias.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "a5e6fbf352700a021e2a4726818beb8b164bb8f29d664fbb68aa8fe142ec589e"}, "nodes": [], "docs": [], "macros": ["macro.dbt.generate_alias_name"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/query.sql": {"path": {"searched_path": "macros", "relative_path": "etc/query.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "332f51dd1615c90e372c87aeb65651c2a66a6f8313be34dfae1e91eb7c5e1316"}, "nodes": [], "docs": [], "macros": ["macro.dbt.run_query"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/is_incremental.sql": {"path": {"searched_path": "macros", "relative_path": "etc/is_incremental.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "08a74e7b1a42476e996dedbd89c97ffb47e95c864b9fec6ddad6e9771eeeb7f1"}, "nodes": [], "docs": [], "macros": ["macro.dbt.is_incremental"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/get_relation_comment.sql": {"path": {"searched_path": "macros", "relative_path": "etc/get_relation_comment.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "653267a61c95a535c6d47f8baea9dbbc533fcb3c671e6cd1d8ac5419d218da26"}, "nodes": [], "docs": [], "macros": ["macro.dbt.table_options", "macro.dbt.get_relation_comment"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/datetime.sql": {"path": {"searched_path": "macros", "relative_path": "etc/datetime.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "0ebb8f28f68f1506962974dd513917a68a196f0cabf70ce3a43d9a72159ddc6c"}, "nodes": [], "docs": [], "macros": ["macro.dbt.convert_datetime", "macro.dbt.dates_in_range", "macro.dbt.partition_range", "macro.dbt.py_current_timestring"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/get_custom_schema.sql": {"path": {"searched_path": "macros", "relative_path": "etc/get_custom_schema.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "3a7d4b9d5105010dd92327027f81c9e079b9a5cd68098b02682fedde376fa5de"}, "nodes": [], "docs": [], "macros": ["macro.dbt.generate_schema_name", "macro.dbt.generate_schema_name_for_env"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/get_custom_database.sql": {"path": {"searched_path": "macros", "relative_path": "etc/get_custom_database.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "2b76c8cc7aede4270f5e37d5623788978688e5c382f4dc4e222453a592b0b532"}, "nodes": [], "docs": [], "macros": ["macro.dbt.generate_database_name"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/adapters/common.sql": {"path": {"searched_path": "macros", "relative_path": "adapters/common.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "b20f3411a1cb7997bdbbe6df7867d993d405230b63c8bf14710eb9fefd96ca56"}, "nodes": [], "docs": [], "macros": ["macro.dbt.adapter_macro", "macro.dbt.get_columns_in_query", "macro.dbt.default__get_columns_in_query", "macro.dbt.create_schema", "macro.dbt.default__create_schema", "macro.dbt.drop_schema", "macro.dbt.default__drop_schema", "macro.dbt.create_table_as", "macro.dbt.default__create_table_as", "macro.dbt.create_view_as", "macro.dbt.default__create_view_as", "macro.dbt.get_catalog", "macro.dbt.default__get_catalog", "macro.dbt.get_columns_in_relation", "macro.dbt.sql_convert_columns_in_relation", "macro.dbt.default__get_columns_in_relation", "macro.dbt.alter_column_type", "macro.dbt.default__alter_column_type", "macro.dbt.drop_relation", "macro.dbt.default__drop_relation", "macro.dbt.truncate_relation", "macro.dbt.default__truncate_relation", "macro.dbt.rename_relation", "macro.dbt.default__rename_relation", "macro.dbt.information_schema_name", "macro.dbt.default__information_schema_name", "macro.dbt.list_schemas", "macro.dbt.default__list_schemas", "macro.dbt.check_schema_exists", "macro.dbt.default__check_schema_exists", "macro.dbt.list_relations_without_caching", "macro.dbt.default__list_relations_without_caching", "macro.dbt.current_timestamp", "macro.dbt.default__current_timestamp", "macro.dbt.collect_freshness", "macro.dbt.default__collect_freshness", "macro.dbt.make_temp_relation", "macro.dbt.default__make_temp_relation", "macro.dbt.set_sql_header"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/schema_tests/relationships.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/relationships.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "4f50036d55fcfe56fbe7d283b8d29b6af935ca7e9abffa57043e20e5680609be"}, "nodes": [], "docs": [], "macros": ["macro.dbt.test_relationships"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/schema_tests/not_null.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/not_null.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "a7fd6f2e1f9645059f33cd6a94598a2d72a7bf9c5d568eefc604b1824640efc7"}, "nodes": [], "docs": [], "macros": ["macro.dbt.test_not_null"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/schema_tests/unique.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/unique.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "a4d53f54a4fa7e846d347418471ebf00e364f4e850f2655e3ce8c6fb49e83bf4"}, "nodes": [], "docs": [], "macros": ["macro.dbt.test_unique"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/schema_tests/accepted_values.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/accepted_values.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "b7c3adabeeb96b9e19e19a8fe0e9f56dcc5af20804a613f71f100eba8ae520a9"}, "nodes": [], "docs": [], "macros": ["macro.dbt.test_accepted_values"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres/macros/catalog.sql": {"path": {"searched_path": "macros", "relative_path": "catalog.sql", "project_root": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres"}, "checksum": {"name": "sha256", "checksum": "66026d3423ab9e6ed0f2ab7fb7924d2f474de06cb19453072df22fc13addf3cd"}, "nodes": [], "docs": [], "macros": ["macro.dbt_postgres.postgres__get_catalog"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres/macros/relations.sql": {"path": {"searched_path": "macros", "relative_path": "relations.sql", "project_root": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres"}, "checksum": {"name": "sha256", "checksum": "6b4cb13349d8314702b5eee62d8b6d4d1a14586b1851bcae7dc77ee5d1956ba9"}, "nodes": [], "docs": [], "macros": ["macro.dbt_postgres.postgres_get_relations"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres/macros/adapters.sql": {"path": {"searched_path": "macros", "relative_path": "adapters.sql", "project_root": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres"}, "checksum": {"name": "sha256", "checksum": "e8b9338cc35fd28109ed2b282dd89b18803bd8bfa7e9861dd7432d862896005d"}, "nodes": [], "docs": [], "macros": ["macro.dbt_postgres.postgres__create_table_as", "macro.dbt_postgres.postgres__create_schema", "macro.dbt_postgres.postgres__drop_schema", "macro.dbt_postgres.postgres__get_columns_in_relation", "macro.dbt_postgres.postgres__list_relations_without_caching", "macro.dbt_postgres.postgres__information_schema_name", "macro.dbt_postgres.postgres__list_schemas", "macro.dbt_postgres.postgres__check_schema_exists", "macro.dbt_postgres.postgres__current_timestamp", "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt_postgres.postgres__make_temp_relation"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres/macros/materializations/snapshot_merge.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/snapshot_merge.sql", "project_root": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres"}, "checksum": {"name": "sha256", "checksum": "8b3bbe37eddd6ac43d224b116c4c9d4fa7c2729412c4ec69d409e15d2e140aa7"}, "nodes": [], "docs": [], "macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/macros/example_macro.sql": {"path": {"searched_path": "macros", "relative_path": "example_macro.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "78e34dcee0fafb73ccfcbccf6065636c57b9e96a186848a250f7137c62884c8e"}, "nodes": [], "docs": [], "macros": ["macro.jaffle_shop.example_macro"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/except.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/except.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "6695ddb45bb31cebda6ddbd4d41b18552cf74cf5752c8a3c4ecaee4304274fa4"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.except", "macro.dbt_utils.default__except", "macro.dbt_utils.bigquery__except"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/replace.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/replace.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "31b87b44de1b4c36337a04baf357b92aaec9968c4b24361e65f345097c6106b8"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.replace", "macro.dbt_utils.default__replace"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/concat.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/concat.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1e548194e9c92d6cd0a60e53651516fa28582854051d83523cd705e87da38832"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.concat", "macro.dbt_utils.default__concat", "macro.dbt_utils.alternative_concat", "macro.dbt_utils.redshift__concat", "macro.dbt_utils.snowflake__concat"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/identifer.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/identifer.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "bdaaf100faa62e971a7e2b766f21127cb9d9fd0aa11412c2840dc66f1355aaae"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.identifier", "macro.dbt_utils.default__identifier", "macro.dbt_utils.bigquery__identifier"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/datatypes.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/datatypes.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "4845d6c9a9e47dadfc39aa4e1bdd47c0b68152def7e3825cb700a1831015ab11"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.default__type_string", "macro.dbt_utils.redshift__type_string", "macro.dbt_utils.postgres__type_string", "macro.dbt_utils.snowflake__type_string", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.default__type_timestamp", "macro.dbt_utils.snowflake__type_timestamp", "macro.dbt_utils.type_float", "macro.dbt_utils.default__type_float", "macro.dbt_utils.bigquery__type_float", "macro.dbt_utils.type_numeric", "macro.dbt_utils.default__type_numeric", "macro.dbt_utils.bigquery__type_numeric", "macro.dbt_utils.type_bigint", "macro.dbt_utils.default__type_bigint", "macro.dbt_utils.bigquery__type_bigint", "macro.dbt_utils.type_int", "macro.dbt_utils.default__type_int", "macro.dbt_utils.bigquery__type_int"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/_is_relation.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/_is_relation.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "9d37d4547affe42d0f29d215fa3b68bfe00ab075aa8d988de70093b55ad6a68b"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils._is_relation"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/length.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/length.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "85f8613d4e8d7c7dbf5c2a0ff64723e6d756913271277d875683b54cece3b6b0"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.length", "macro.dbt_utils.default__length", "macro.dbt_utils.redshift__length"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/dateadd.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/dateadd.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "4463f081c3275fcf5e9e5e8af182fb2e81fafd9ac3e09d77035ea6473c843b7d"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.default__dateadd", "macro.dbt_utils.bigquery__dateadd", "macro.dbt_utils.postgres__dateadd"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/intersect.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/intersect.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "f5abb85f0b7d9e80b24ed0b3b11dd6a91b6b5b4caf0dbf0c21a070353b5b1d82"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.intersect", "macro.dbt_utils.default__intersect", "macro.dbt_utils.bigquery__intersect"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/right.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/right.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "ce8b346909fc377f131b8de6e40e49dc822da29ccd5d3add77079608a198a375"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.right", "macro.dbt_utils.default__right", "macro.dbt_utils.bigquery__right", "macro.dbt_utils.snowflake__right"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/datediff.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/datediff.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "ce3e4aecff7027028cfb3b91a6da561b63a4ec6c77320572abf20d7c4c086937"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.datediff", "macro.dbt_utils.default__datediff", "macro.dbt_utils.bigquery__datediff", "macro.dbt_utils.postgres__datediff"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/safe_cast.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/safe_cast.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1ad027695168ced61cdba224ddca8f07e861d32aab95efd30008a0bce76241ac"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.default__safe_cast", "macro.dbt_utils.snowflake__safe_cast", "macro.dbt_utils.bigquery__safe_cast"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/hash.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/hash.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "9ac8186a8bfa84a019a05caf6fbb6ecbdd15f9965ea4739dc565115df4c20cb4"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.hash", "macro.dbt_utils.default__hash", "macro.dbt_utils.bigquery__hash"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/position.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/position.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "b5d4dde3fa181616bcd106ae094cb6c75b21d14503e76c0d736d0dc65d92ceeb"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.position", "macro.dbt_utils.default__position", "macro.dbt_utils.bigquery__position"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/literal.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/literal.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "21185e8340fe4f9a3669930768bd3e2aa43c82bb83df847cfe8ed06290337402"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.string_literal", "macro.dbt_utils.default__string_literal"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/current_timestamp.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/current_timestamp.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1e3d0b51c513a0670e0e4851cbc33801890e9813d64376ab2e43dc3c3744f039"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.default__current_timestamp", "macro.dbt_utils.redshift__current_timestamp", "macro.dbt_utils.bigquery__current_timestamp", "macro.dbt_utils.current_timestamp_in_utc", "macro.dbt_utils.default__current_timestamp_in_utc", "macro.dbt_utils.snowflake__current_timestamp_in_utc", "macro.dbt_utils.postgres__current_timestamp_in_utc"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/width_bucket.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/width_bucket.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "287296cc63427c7bd046e85aed1de4aa7fc73ebb3223b7f59e4ba68a20f23de1"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.width_bucket", "macro.dbt_utils.default__width_bucket", "macro.dbt_utils.redshift__width_bucket", "macro.dbt_utils.snowflake__width_bucket"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/last_day.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/last_day.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1e207372f905a7d14f800b518761d85fedec738444b4e9ed7be02b9aeb5bbbfe"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.last_day", "macro.dbt_utils.default_last_day", "macro.dbt_utils.default__last_day", "macro.dbt_utils.postgres__last_day"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/split_part.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/split_part.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "ec1d9db903a2a00b513f90c8345682c076800e99e109228dce881b67c0e00cf7"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.default__split_part", "macro.dbt_utils.bigquery__split_part"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/date_trunc.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/date_trunc.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "2fec19945722b85c7fd737436589122d2959ed9c0bcc2d4778da32687ff992f2"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.date_trunc", "macro.dbt_utils.default__date_trunc", "macro.dbt_utils.bigquery__date_trunc"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/materializations/insert_by_period_materialization.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/insert_by_period_materialization.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "6f4e65d6de0fe33a5f5259507b234831a288c563f56df9eaa70ef3eb5dd3b1b8"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.get_period_sql", "macro.dbt_utils.materialization_insert_by_period_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/logger/pretty_log_format.sql": {"path": {"searched_path": "macros", "relative_path": "logger/pretty_log_format.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "788092f1026c7d2fd3398f31870caf4f81d43b686c4af633a57fafd1aeef304a"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.pretty_log_format"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/logger/pretty_time.sql": {"path": {"searched_path": "macros", "relative_path": "logger/pretty_time.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "d5cdb4ceb135e1d855367d2ecb54e63b1fd01d3c9aa074852a553de789f45e5f"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.pretty_time"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/logger/log_info.sql": {"path": {"searched_path": "macros", "relative_path": "logger/log_info.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "6a0420dcc9a03bb7748026162ababb6e877a0e45d7697f77d8b228fd7c6cf717"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.log_info"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/datetime/date_spine.sql": {"path": {"searched_path": "macros", "relative_path": "datetime/date_spine.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "6e164f9e7198e71e4c2f18b0478b69405288b2a5cf8958596271eee490131575"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_intervals_between", "macro.dbt_utils.date_spine"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/web/get_url_host.sql": {"path": {"searched_path": "macros", "relative_path": "web/get_url_host.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "75246509db12e34e95190175211e0331063c8ed017a0bfac1dcbfd5da79c6ce8"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_url_host"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/web/get_url_path.sql": {"path": {"searched_path": "macros", "relative_path": "web/get_url_path.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "b976b094bc2a26a7b553431dc93fdefe28b129abd7155d8846e254046f02a39c"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_url_path"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/web/get_url_parameter.sql": {"path": {"searched_path": "macros", "relative_path": "web/get_url_parameter.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "b10234d9d0b1030a402a6a72a94f78a0d2293661a32cec604b0ef48c50511a56"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_url_parameter"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/geo/haversine_distance.sql": {"path": {"searched_path": "macros", "relative_path": "geo/haversine_distance.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "b5f48844bc062e5ad283aedbd9dd11d68863db6b0f81efbc767b384115079d62"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.haversine_distance"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/equal_rowcount.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/equal_rowcount.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "7163ce75cb298af96172c41a0ba73a184d9116a92d63889573d24a12e551f560"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_equal_rowcount"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/relationships_where.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/relationships_where.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "48c6eb8de34d6925bccf56ce59ee7d3d8dc2c1426f951b15f8ca4560125005b9"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_relationships_where"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/recency.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/recency.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "b2542d28abc4e53309c744b111fb1f2f4be2cfcf4f611b4a31b37aba0fed6bc2"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_recency"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/not_constant.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/not_constant.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "8710079ef29da7534dcb9728407af27814a247fa8d17080f5d1d4c39eee44023"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_not_constant"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/at_least_one.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/at_least_one.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "cc5c686c96681f67f0e97f49cc987b6d65115e8aaf51ea487e39f7865e3d335d"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_at_least_one"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/unique_combination_of_columns.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/unique_combination_of_columns.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "785bbaca0448f809197823afd810753c6a55124ece7bec7d4befe4dbd9eb39dd"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_unique_combination_of_columns"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/cardinality_equality.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/cardinality_equality.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "e037e4539e2f94632db24ca2526fc06a489dd60663bfbb5246e1d24ac4fdcae7"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_cardinality_equality"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/expression_is_true.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/expression_is_true.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "be92c446fea64c14d543c9b9944cf725d28161cf459fa3a17ce9f7be91cb1cac"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_expression_is_true"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/equality.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/equality.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1bdac20b6a7592fe91748dfa489c964dbd433c1e1a9e9839937396b0b297a864"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_equality"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/mutually_exclusive_ranges.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/mutually_exclusive_ranges.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "6d92959cd620e418f5faed654e21e126c956f1b370ca932675a5a7a53ace2539"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_mutually_exclusive_ranges"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/nullcheck_table.sql": {"path": {"searched_path": "macros", "relative_path": "sql/nullcheck_table.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "9fd89ad3b49bf05c5ea4769e84687510cafcf255f7e3579613d1f8588ceb19cc"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.nullcheck_table"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/generate_series.sql": {"path": {"searched_path": "macros", "relative_path": "sql/generate_series.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1ca1782077c9ffef4532460d20b9f9f7a94495cff99f1342c48e46f2cd3c070b"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_powers_of_two", "macro.dbt_utils.generate_series"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/get_relations_by_prefix.sql": {"path": {"searched_path": "macros", "relative_path": "sql/get_relations_by_prefix.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "86e15bf943f7a9bddf0ceb2fac257c944cf77143e9b0d16fd3f8c21c04adba64"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_relations_by_prefix", "macro.dbt_utils.get_tables_by_prefix"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/get_tables_by_prefix_sql.sql": {"path": {"searched_path": "macros", "relative_path": "sql/get_tables_by_prefix_sql.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "e4eb8a02c7d6051e583231bd2f516f799611de36febf68599f8a7a74f883f08c"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_tables_by_prefix_sql", "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro.dbt_utils.bigquery__get_tables_by_prefix_sql"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/star.sql": {"path": {"searched_path": "macros", "relative_path": "sql/star.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "8c0fd7e5f0dba7ca12fae6baa5532685c5bbdf3aa1489b54253f95494fc6344b"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.star"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/unpivot.sql": {"path": {"searched_path": "macros", "relative_path": "sql/unpivot.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "071b5b6f49b07cf7de141fb67878f942a7eb5d50d6b20bd44d678b1edd1a774f"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.unpivot"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/union.sql": {"path": {"searched_path": "macros", "relative_path": "sql/union.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "e6de70f04c0769d636993de83b1a7611ca92558277c348e83ad69c4062de3201"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.union_relations", "macro.dbt_utils.union_tables"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/groupby.sql": {"path": {"searched_path": "macros", "relative_path": "sql/groupby.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "ee3fb695561e40aeeed2d05a0dbea10331be8f039b07bd771e6a5741e02adead"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.group_by"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/surrogate_key.sql": {"path": {"searched_path": "macros", "relative_path": "sql/surrogate_key.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "12bd84d1303045d702ad913c23a00913d2bd450e343818123ef39ed12a30387d"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.surrogate_key"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/safe_add.sql": {"path": {"searched_path": "macros", "relative_path": "sql/safe_add.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "7f544c77ed9402d2c130aa1883ab2419215bac58405ab2ec1d2d70229a94737b"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.safe_add"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/nullcheck.sql": {"path": {"searched_path": "macros", "relative_path": "sql/nullcheck.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "d2cd945bca708f6660ea54685dc57ee4abaa1266306dfb3d2e84e04174058c68"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.nullcheck"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/get_column_values.sql": {"path": {"searched_path": "macros", "relative_path": "sql/get_column_values.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "ab0317329a6a695608746064c7a1cccca7d45e908b5f796bcb30cb53fea006fc"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_column_values"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/pivot.sql": {"path": {"searched_path": "macros", "relative_path": "sql/pivot.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "d9ee0399b76d4b7c575a7dad9ba1ad0c2a2c20f9531edec2e2e4233b7d35a9f2"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.pivot"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/get_query_results_as_dict.sql": {"path": {"searched_path": "macros", "relative_path": "sql/get_query_results_as_dict.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "9b4b370b1667d3a3a0fd3cf2bdebcd04d2223bbc020f929132a99022589da2d5"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_query_results_as_dict"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/staging/stg_customers.sql": {"path": {"searched_path": "models", "relative_path": "staging/stg_customers.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "8aaf3f82d6948a706a8fd6e40493a59446ab84436c800b9bb986d6af6d3dc073"}, "nodes": ["model.jaffle_shop.stg_customers"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/staging/stg_payments.sql": {"path": {"searched_path": "models", "relative_path": "staging/stg_payments.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "113502ed19f04efb2af0629ff139f57f7463347b6d5218f3b80a8d128cc96852"}, "nodes": ["model.jaffle_shop.stg_payments"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/staging/stg_orders.sql": {"path": {"searched_path": "models", "relative_path": "staging/stg_orders.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "5a2807569bc8d9b74f7ffecfbf12d1e3b6dfbc6cbff66dd38ce20306532b6f77"}, "nodes": ["model.jaffle_shop.stg_orders"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/staging/hidden_model.sql": {"path": {"searched_path": "models", "relative_path": "staging/hidden_model.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "ab09cc6daa39542203d5cbba28e07b823193bf0ce81a86f88a7f705b71fffda5"}, "nodes": ["model.jaffle_shop.hidden_model"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/dim_customers.sql": {"path": {"searched_path": "models", "relative_path": "marts/core/dim_customers.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "95d544c0e900d9ac69d0471bad24e03c63a268dbc493559023b58b7618c49b3a"}, "nodes": ["model.jaffle_shop.dim_customers"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/fct_orders.sql": {"path": {"searched_path": "models", "relative_path": "marts/core/fct_orders.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "49634cca4e40171ea98f62a1a3a9999e3487c42aca3ee79ecaaf99900ead1fd8"}, "nodes": ["model.jaffle_shop.fct_orders"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/intermediate/order_payments.sql": {"path": {"searched_path": "models", "relative_path": "marts/core/intermediate/order_payments.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "6af89b1b7d0e9fe6b2b54118cf2addf0bab34ccc49b054eab93f8d7056fb7c52"}, "nodes": ["model.jaffle_shop.order_payments"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/intermediate/customer_payments.sql": {"path": {"searched_path": "models", "relative_path": "marts/core/intermediate/customer_payments.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "feb9a66904fe7968464b947a2289c795d58fbc7f1e14a3c9975dc261d94cb351"}, "nodes": ["model.jaffle_shop.customer_payments"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/intermediate/customer_orders.sql": {"path": {"searched_path": "models", "relative_path": "marts/core/intermediate/customer_orders.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "20c96fcb3cf2235582de807d64cd1cdbdd3a419786bf1ceaae0ef208e7ed3dd7"}, "nodes": ["model.jaffle_shop.customer_orders"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/analysis/my_analysis.sql": {"path": {"searched_path": "analysis", "relative_path": "my_analysis.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "73dbf1cfe9b0cb2d6c44583012e36dd3526a4db58bfd628e0485e10de95dae84"}, "nodes": ["analysis.jaffle_shop.my_analysis"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/tests/example_data_test.sql": {"path": {"searched_path": "tests", "relative_path": "example_data_test.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "b68d2666d3502ec95f54174a518b6d43ee67fac443bf1a66746863f00f053f3b"}, "nodes": ["test.jaffle_shop.example_data_test"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_customers.csv": {"path": {"searched_path": "data", "relative_path": "raw_customers.csv", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "path", "checksum": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_customers.csv"}, "nodes": ["seed.jaffle_shop.raw_customers"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_orders.csv": {"path": {"searched_path": "data", "relative_path": "raw_orders.csv", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "path", "checksum": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_orders.csv"}, "nodes": ["seed.jaffle_shop.raw_orders"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_payments.csv": {"path": {"searched_path": "data", "relative_path": "raw_payments.csv", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "path", "checksum": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_payments.csv"}, "nodes": ["seed.jaffle_shop.raw_payments"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/overview.md": {"path": {"searched_path": "models", "relative_path": "overview.md", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "1392d9f53d59e2b7996bee10012f0232607985522434c3af1372e0c886cce5e3"}, "nodes": [], "docs": ["jaffle_shop.__overview__"], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/docs.md": {"path": {"searched_path": "models", "relative_path": "marts/core/docs.md", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "28e3aee589b6731980cfe1a280c171486224a093776ee3ccde474c8a0d87901e"}, "nodes": [], "docs": ["jaffle_shop.orders_status"], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/staging/schema.yml": {"path": {"searched_path": "models", "relative_path": "staging/schema.yml", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "9a1da13d643d196a4dd54e0080002984d695c7dff7bd46c8d906702837f63940"}, "nodes": ["test.jaffle_shop.unique_stg_customers_customer_id", "test.jaffle_shop.not_null_stg_customers_customer_id", "test.jaffle_shop.unique_stg_orders_order_id", "test.jaffle_shop.not_null_stg_orders_order_id", "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "test.jaffle_shop.unique_stg_payments_payment_id", "test.jaffle_shop.not_null_stg_payments_payment_id", "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "docs": [], "macros": [], "sources": ["source.jaffle_shop.payments.orders"], "patches": ["stg_customers", "stg_orders", "stg_payments", "hidden_model"], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/schema.yml": {"path": {"searched_path": "models", "relative_path": "marts/core/schema.yml", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "0c0fd2ab7c6c9068427f2a26d7bee36731be3d68c8c936b5d5f8a2474fe8dc52"}, "nodes": ["test.jaffle_shop.unique_dim_customers_customer_id", "test.jaffle_shop.not_null_dim_customers_customer_id", "test.jaffle_shop.unique_fct_orders_order_id", "test.jaffle_shop.not_null_fct_orders_order_id", "test.jaffle_shop.not_null_fct_orders_customer_id", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "test.jaffle_shop.not_null_fct_orders_amount", "test.jaffle_shop.not_null_fct_orders_credit_card_amount", "test.jaffle_shop.not_null_fct_orders_coupon_amount", "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount", "test.jaffle_shop.not_null_fct_orders_gift_card_amount"], "docs": [], "macros": [], "sources": [], "patches": ["dim_customers", "fct_orders"], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/analysis/analysis.yml": {"path": {"searched_path": "analysis", "relative_path": "analysis.yml", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "75a01bd4d06cda0ae6e1758fe9d9de6051566449ddb80c424400e401a8ae592e"}, "nodes": [], "docs": [], "macros": [], "sources": [], "patches": ["my_analysis"], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/macros/macros.yml": {"path": {"searched_path": "macros", "relative_path": "macros.yml", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "f99e7bd45bb89b897eb929280f7c89961cb671316331fa0ee564dee65fcf9a94"}, "nodes": [], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": [["jaffle_shop", "example_macro"]]}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/docs/overview.md": {"path": {"searched_path": "docs", "relative_path": "overview.md", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "66db3d93aa0f4fa15a61ea3441e71b887d93e11c626bb000d73b6da808231747"}, "nodes": [], "docs": ["dbt.__overview__"], "macros": [], "sources": [], "patches": [], "macro_patches": []}}} \ No newline at end of file +{"nodes":{"model.jaffle_shop.stg_customers":{"raw_sql":"with 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('customer_snapshot') }}\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","staging","stg_customers"],"unique_id":"model.jaffle_shop.stg_customers","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"staging/stg_customers.sql","original_file_path":"models/staging/stg_customers.sql","name":"stg_customers","resource_type":"model","alias":"stg_customers","config":{"enabled":true,"materialized":"view","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":["staging","hourly"],"full_refresh":null},"tags":["staging","hourly"],"refs":[["customer_snapshot"]],"sources":[],"depends_on":{"macros":[],"nodes":["snapshot.jaffle_shop.customer_snapshot"]},"description":"","columns":{"customer_id":{"name":"customer_id","description":"","meta":{},"data_type":null,"tags":[]}},"meta":{},"docs":{"show":true},"patch_path":"models/staging/schema.yml","build_path":"target/compiled/jaffle_shop/models/staging/stg_customers.sql","compiled":true,"compiled_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.customer_snapshot\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.customer_snapshot\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed"},"model.jaffle_shop.stg_payments":{"raw_sql":"with 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 {{ source('seeds', 'raw_payments') }}\n\n),\n\nrenamed 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 * from renamed","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","staging","stg_payments"],"unique_id":"model.jaffle_shop.stg_payments","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"staging/stg_payments.sql","original_file_path":"models/staging/stg_payments.sql","name":"stg_payments","resource_type":"model","alias":"stg_payments","config":{"enabled":true,"materialized":"view","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":["staging","hourly"],"full_refresh":null},"tags":["staging","hourly"],"refs":[],"sources":[["seeds","raw_payments"]],"depends_on":{"macros":[],"nodes":["source.jaffle_shop.seeds.raw_payments"]},"description":"","columns":{"payment_id":{"name":"payment_id","description":"","meta":{},"data_type":null,"tags":[]},"payment_method":{"name":"payment_method","description":"","meta":{},"data_type":null,"tags":[]}},"meta":{},"docs":{"show":true},"patch_path":"models/staging/schema.yml","build_path":"target/compiled/jaffle_shop/models/staging/stg_payments.sql","compiled":true,"compiled_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.raw_payments\n\n),\n\nrenamed 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 * from renamed","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.raw_payments\n\n),\n\nrenamed 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 * from renamed"},"model.jaffle_shop.stg_orders":{"raw_sql":"with 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 {{ source('seeds', 'raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n from source\n\n)\n\nselect * from renamed","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","staging","stg_orders"],"unique_id":"model.jaffle_shop.stg_orders","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"staging/stg_orders.sql","original_file_path":"models/staging/stg_orders.sql","name":"stg_orders","resource_type":"model","alias":"stg_orders","config":{"enabled":true,"materialized":"view","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":["staging","hourly"],"full_refresh":null},"tags":["staging","hourly"],"refs":[],"sources":[["seeds","raw_orders"]],"depends_on":{"macros":[],"nodes":["source.jaffle_shop.seeds.raw_orders"]},"description":"","columns":{"order_id":{"name":"order_id","description":"","meta":{},"data_type":null,"tags":[]},"status":{"name":"status","description":"","meta":{},"data_type":null,"tags":[]}},"meta":{},"docs":{"show":true},"patch_path":"models/staging/schema.yml","build_path":"target/compiled/jaffle_shop/models/staging/stg_orders.sql","compiled":true,"compiled_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.raw_orders\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n from source\n\n)\n\nselect * from renamed","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.raw_orders\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n from source\n\n)\n\nselect * from renamed"},"model.jaffle_shop.dim_customers":{"raw_sql":"with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\ncustomer_orders as (\n\n select * from {{ ref('customer_orders') }}\n\n),\n\ncustomer_payments as (\n\n select * from {{ ref('customer_payments') }}\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","marts","core","dim_customers"],"unique_id":"model.jaffle_shop.dim_customers","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/dim_customers.sql","original_file_path":"models/marts/core/dim_customers.sql","name":"dim_customers","resource_type":"model","alias":"dim_customers","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["stg_customers"],["customer_orders"],["customer_payments"]],"sources":[],"depends_on":{"macros":[],"nodes":["model.jaffle_shop.stg_customers","model.jaffle_shop.customer_orders","model.jaffle_shop.customer_payments"]},"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":null,"tags":[]},"first_name":{"name":"first_name","description":"Customer's first name. PII.","meta":{},"data_type":null,"tags":[]},"last_name":{"name":"last_name","description":"Customer's last name. PII.","meta":{},"data_type":null,"tags":[]},"email":{"name":"email","description":"Customer's email address. PII.","meta":{},"data_type":null,"tags":[]},"first_order":{"name":"first_order","description":"Date (UTC) of a customer's first order","meta":{},"data_type":null,"tags":[]},"most_recent_order":{"name":"most_recent_order","description":"Date (UTC) of a customer's most recent order","meta":{},"data_type":null,"tags":[]},"number_of_orders":{"name":"number_of_orders","description":"Count of the number of orders a customer has placed","meta":{},"data_type":null,"tags":[]},"total_order_amount":{"name":"total_order_amount","description":"Total value (AUD) of a customer's orders","meta":{},"data_type":null,"tags":[]}},"meta":{},"docs":{"show":true},"patch_path":"models/marts/core/schema.yml","build_path":"target/compiled/jaffle_shop/models/marts/core/dim_customers.sql","compiled":true,"compiled_sql":"with customers as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_customers\n\n),\n\ncustomer_orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.customer_orders\n\n),\n\ncustomer_payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.customer_payments\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with customers as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_customers\n\n),\n\ncustomer_orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.customer_orders\n\n),\n\ncustomer_payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.customer_payments\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final"},"model.jaffle_shop.fct_orders":{"raw_sql":"with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\norder_payments as (\n\n select * from {{ ref('order_payments') }}\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","marts","core","fct_orders"],"unique_id":"model.jaffle_shop.fct_orders","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/fct_orders.sql","original_file_path":"models/marts/core/fct_orders.sql","name":"fct_orders","resource_type":"model","alias":"fct_orders","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["stg_orders"],["order_payments"]],"sources":[],"depends_on":{"macros":["macro.jaffle_shop.payment_methods"],"nodes":["model.jaffle_shop.stg_orders","model.jaffle_shop.order_payments"]},"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":null,"tags":[]},"customer_id":{"name":"customer_id","description":"Foreign key to the customers table","meta":{},"data_type":null,"tags":[]},"order_date":{"name":"order_date","description":"Date (UTC) that the order was placed","meta":{},"data_type":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":null,"tags":[]},"amount":{"name":"amount","description":"Total amount (AUD) of the order","meta":{},"data_type":null,"tags":[]},"credit_card_amount":{"name":"credit_card_amount","description":"Amount of the order (AUD) paid for by credit card","meta":{},"data_type":null,"tags":[]},"coupon_amount":{"name":"coupon_amount","description":"Amount of the order (AUD) paid for by coupon","meta":{},"data_type":null,"tags":[]},"bank_transfer_amount":{"name":"bank_transfer_amount","description":"Amount of the order (AUD) paid for by bank transfer","meta":{},"data_type":null,"tags":[]},"gift_card_amount":{"name":"gift_card_amount","description":"Amount of the order (AUD) paid for by gift card","meta":{},"data_type":null,"tags":[]}},"meta":{},"docs":{"show":true},"patch_path":"models/marts/core/schema.yml","build_path":"target/compiled/jaffle_shop/models/marts/core/fct_orders.sql","compiled":true,"compiled_sql":"with orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\norder_payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.order_payments\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\norder_payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.order_payments\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final"},"model.jaffle_shop.order_payments":{"raw_sql":"with payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\nfinal as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods() -%}\n sum(case when payment_method = '{{payment_method}}' then amount else 0 end) as {{payment_method}}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","marts","core","intermediate","order_payments"],"unique_id":"model.jaffle_shop.order_payments","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/intermediate/order_payments.sql","original_file_path":"models/marts/core/intermediate/order_payments.sql","name":"order_payments","resource_type":"model","alias":"order_payments","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["stg_payments"]],"sources":[],"depends_on":{"macros":["macro.jaffle_shop.payment_methods"],"nodes":["model.jaffle_shop.stg_payments"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/intermediate/order_payments.sql","compiled":true,"compiled_sql":"with payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\nfinal as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\nfinal as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final"},"model.jaffle_shop.customer_payments":{"raw_sql":"with payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","marts","core","intermediate","customer_payments"],"unique_id":"model.jaffle_shop.customer_payments","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/intermediate/customer_payments.sql","original_file_path":"models/marts/core/intermediate/customer_payments.sql","name":"customer_payments","resource_type":"model","alias":"customer_payments","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["stg_payments"],["stg_orders"]],"sources":[],"depends_on":{"macros":[],"nodes":["model.jaffle_shop.stg_payments","model.jaffle_shop.stg_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/intermediate/customer_payments.sql","compiled":true,"compiled_sql":"with payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\norders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\norders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final"},"model.jaffle_shop.customer_orders":{"raw_sql":"with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","marts","core","intermediate","customer_orders"],"unique_id":"model.jaffle_shop.customer_orders","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/intermediate/customer_orders.sql","original_file_path":"models/marts/core/intermediate/customer_orders.sql","name":"customer_orders","resource_type":"model","alias":"customer_orders","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["stg_orders"]],"sources":[],"depends_on":{"macros":[],"nodes":["model.jaffle_shop.stg_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/intermediate/customer_orders.sql","compiled":true,"compiled_sql":"with orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final"},"snapshot.jaffle_shop.customer_snapshot":{"raw_sql":"\n\n {{-\n config(\n strategy='check',\n unique_key='id',\n target_schema=this.schema,\n check_cols=[\n 'first_name',\n 'last_name',\n 'email',\n ],\n )\n -}}\n\n select * from {{ source('seeds', 'raw_customers') }}\n\n","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","customer_snapshot","customer_snapshot"],"unique_id":"snapshot.jaffle_shop.customer_snapshot","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"customer_snapshot.sql","original_file_path":"snapshots/customer_snapshot.sql","name":"customer_snapshot","resource_type":"snapshot","alias":"customer_snapshot","config":{"enabled":true,"materialized":"snapshot","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"unique_key":"id","target_schema":"DBT_DEMO","strategy":"check","check_cols":["first_name","last_name","email"]},"tags":[],"refs":[],"sources":[["seeds","raw_customers"]],"depends_on":{"macros":[],"nodes":["source.jaffle_shop.seeds.raw_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":null,"compiled":true,"compiled_sql":"select * from LOCAL_MALLEN.DBT_DEMO.raw_customers\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"select * from LOCAL_MALLEN.DBT_DEMO.raw_customers\n"},"analysis.jaffle_shop.orders_with_customers":{"raw_sql":"with orders as (\n select * from {{ ref('fct_orders') }}\n),\ncustomers as (\n select * from {{ ref('dim_customers') }}\n),\nfinal as (\n select *\n from orders\n left join customers using (customer_id)\n)","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","analysis","orders_with_customers"],"unique_id":"analysis.jaffle_shop.orders_with_customers","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"analysis/orders_with_customers.sql","original_file_path":"analysis/orders_with_customers.sql","name":"orders_with_customers","resource_type":"analysis","alias":"orders_with_customers","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["fct_orders"],["dim_customers"]],"sources":[],"depends_on":{"macros":[],"nodes":["model.jaffle_shop.fct_orders","model.jaffle_shop.dim_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/analysis/orders_with_customers.sql","compiled":true,"compiled_sql":"with orders as (\n select * from LOCAL_MALLEN.DBT_DEMO.fct_orders\n),\ncustomers as (\n select * from LOCAL_MALLEN.DBT_DEMO.dim_customers\n),\nfinal as (\n select *\n from orders\n left join customers using (customer_id)\n)","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with orders as (\n select * from LOCAL_MALLEN.DBT_DEMO.fct_orders\n),\ncustomers as (\n select * from LOCAL_MALLEN.DBT_DEMO.dim_customers\n),\nfinal as (\n select *\n from orders\n left join customers using (customer_id)\n)"},"seed.jaffle_shop.raw_customers":{"raw_sql":"","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","raw_customers"],"unique_id":"seed.jaffle_shop.raw_customers","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"raw_customers.csv","original_file_path":"data/raw_customers.csv","name":"raw_customers","resource_type":"seed","alias":"raw_customers","config":{"enabled":true,"materialized":"seed","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"quote_columns":null},"tags":[],"refs":[],"sources":[],"depends_on":{"macros":[],"nodes":[]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":null,"compiled":true,"compiled_sql":"","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":""},"seed.jaffle_shop.raw_orders":{"raw_sql":"","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","raw_orders"],"unique_id":"seed.jaffle_shop.raw_orders","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"raw_orders.csv","original_file_path":"data/raw_orders.csv","name":"raw_orders","resource_type":"seed","alias":"raw_orders","config":{"enabled":true,"materialized":"seed","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"quote_columns":null},"tags":[],"refs":[],"sources":[],"depends_on":{"macros":[],"nodes":[]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":null,"compiled":true,"compiled_sql":"","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":""},"seed.jaffle_shop.raw_payments":{"raw_sql":"","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","raw_payments"],"unique_id":"seed.jaffle_shop.raw_payments","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"raw_payments.csv","original_file_path":"data/raw_payments.csv","name":"raw_payments","resource_type":"seed","alias":"raw_payments","config":{"enabled":true,"materialized":"seed","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"quote_columns":null},"tags":[],"refs":[],"sources":[],"depends_on":{"macros":[],"nodes":[]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":null,"compiled":true,"compiled_sql":"","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":""},"test.jaffle_shop.unique_stg_customers_customer_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"unique","kwargs":{"column_name":"customer_id","model":"{{ ref('stg_customers') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","unique_stg_customers_customer_id"],"unique_id":"test.jaffle_shop.unique_stg_customers_customer_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/unique_stg_customers_customer_id.sql","original_file_path":"models/staging/schema.yml","name":"unique_stg_customers_customer_id","resource_type":"test","alias":"unique_stg_customers_customer_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_customers"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_unique"],"nodes":["model.jaffle_shop.stg_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_customers_customer_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n customer_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_customers\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n customer_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_customers\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n","column_name":"customer_id"},"test.jaffle_shop.not_null_stg_customers_customer_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"customer_id","model":"{{ ref('stg_customers') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_stg_customers_customer_id"],"unique_id":"test.jaffle_shop.not_null_stg_customers_customer_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_stg_customers_customer_id.sql","original_file_path":"models/staging/schema.yml","name":"not_null_stg_customers_customer_id","resource_type":"test","alias":"not_null_stg_customers_customer_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_customers"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.stg_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_customers_customer_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_customers\nwhere customer_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_customers\nwhere customer_id is null\n\n","column_name":"customer_id"},"test.jaffle_shop.unique_stg_orders_order_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"unique","kwargs":{"column_name":"order_id","model":"{{ ref('stg_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","unique_stg_orders_order_id"],"unique_id":"test.jaffle_shop.unique_stg_orders_order_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/unique_stg_orders_order_id.sql","original_file_path":"models/staging/schema.yml","name":"unique_stg_orders_order_id","resource_type":"test","alias":"unique_stg_orders_order_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_unique"],"nodes":["model.jaffle_shop.stg_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_orders_order_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_orders\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_orders\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n","column_name":"order_id"},"test.jaffle_shop.not_null_stg_orders_order_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"order_id","model":"{{ ref('stg_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_stg_orders_order_id"],"unique_id":"test.jaffle_shop.not_null_stg_orders_order_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_stg_orders_order_id.sql","original_file_path":"models/staging/schema.yml","name":"not_null_stg_orders_order_id","resource_type":"test","alias":"not_null_stg_orders_order_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.stg_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_orders_order_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_orders\nwhere order_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_orders\nwhere order_id is null\n\n","column_name":"order_id"},"test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_accepted_values(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"accepted_values","kwargs":{"values":["placed","shipped","completed","return_pending","returned"],"column_name":"status","model":"{{ ref('stg_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"],"unique_id":"test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/accepted_values_stg_orders_758238c28b8980ea7fe9d60a8d851ea8.sql","original_file_path":"models/staging/schema.yml","name":"accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned","resource_type":"test","alias":"accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_accepted_values"],"nodes":["model.jaffle_shop.stg_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/accepted_values_stg_orders_758238c28b8980ea7fe9d60a8d851ea8.sql","compiled":true,"compiled_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","column_name":"status"},"test.jaffle_shop.unique_stg_payments_payment_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"unique","kwargs":{"column_name":"payment_id","model":"{{ ref('stg_payments') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","unique_stg_payments_payment_id"],"unique_id":"test.jaffle_shop.unique_stg_payments_payment_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/unique_stg_payments_payment_id.sql","original_file_path":"models/staging/schema.yml","name":"unique_stg_payments_payment_id","resource_type":"test","alias":"unique_stg_payments_payment_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_payments"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_unique"],"nodes":["model.jaffle_shop.stg_payments"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_payments_payment_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n payment_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_payments\n where payment_id is not null\n group by payment_id\n having count(*) > 1\n\n) validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n payment_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_payments\n where payment_id is not null\n group by payment_id\n having count(*) > 1\n\n) validation_errors\n\n","column_name":"payment_id"},"test.jaffle_shop.not_null_stg_payments_payment_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"payment_id","model":"{{ ref('stg_payments') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_stg_payments_payment_id"],"unique_id":"test.jaffle_shop.not_null_stg_payments_payment_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_stg_payments_payment_id.sql","original_file_path":"models/staging/schema.yml","name":"not_null_stg_payments_payment_id","resource_type":"test","alias":"not_null_stg_payments_payment_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_payments"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.stg_payments"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_payments_payment_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_payments\nwhere payment_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_payments\nwhere payment_id is null\n\n","column_name":"payment_id"},"test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_accepted_values(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"accepted_values","kwargs":{"values":["credit_card","coupon","bank_transfer","gift_card"],"column_name":"payment_method","model":"{{ ref('stg_payments') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"],"unique_id":"test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/accepted_values_stg_payments_944011baab727320a6b119d4d81589ae.sql","original_file_path":"models/staging/schema.yml","name":"accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card","resource_type":"test","alias":"accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_payments"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_accepted_values"],"nodes":["model.jaffle_shop.stg_payments"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/accepted_values_stg_payments_944011baab727320a6b119d4d81589ae.sql","compiled":true,"compiled_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n payment_method as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n payment_method as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","column_name":"payment_method"},"test.jaffle_shop.unique_dim_customers_customer_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"unique","kwargs":{"column_name":"customer_id","model":"{{ ref('dim_customers') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","unique_dim_customers_customer_id"],"unique_id":"test.jaffle_shop.unique_dim_customers_customer_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/unique_dim_customers_customer_id.sql","original_file_path":"models/marts/core/schema.yml","name":"unique_dim_customers_customer_id","resource_type":"test","alias":"unique_dim_customers_customer_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["dim_customers"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_unique"],"nodes":["model.jaffle_shop.dim_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/unique_dim_customers_customer_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n customer_id\n\n from LOCAL_MALLEN.DBT_DEMO.dim_customers\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n customer_id\n\n from LOCAL_MALLEN.DBT_DEMO.dim_customers\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n","column_name":"customer_id"},"test.jaffle_shop.not_null_dim_customers_customer_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"customer_id","model":"{{ ref('dim_customers') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_dim_customers_customer_id"],"unique_id":"test.jaffle_shop.not_null_dim_customers_customer_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_dim_customers_customer_id.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_dim_customers_customer_id","resource_type":"test","alias":"not_null_dim_customers_customer_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["dim_customers"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.dim_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_dim_customers_customer_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.dim_customers\nwhere customer_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.dim_customers\nwhere customer_id is null\n\n","column_name":"customer_id"},"test.jaffle_shop.unique_fct_orders_order_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"unique","kwargs":{"column_name":"order_id","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","unique_fct_orders_order_id"],"unique_id":"test.jaffle_shop.unique_fct_orders_order_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/unique_fct_orders_order_id.sql","original_file_path":"models/marts/core/schema.yml","name":"unique_fct_orders_order_id","resource_type":"test","alias":"unique_fct_orders_order_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_unique"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/unique_fct_orders_order_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from LOCAL_MALLEN.DBT_DEMO.fct_orders\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from LOCAL_MALLEN.DBT_DEMO.fct_orders\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n","column_name":"order_id"},"test.jaffle_shop.not_null_fct_orders_order_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"order_id","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_order_id"],"unique_id":"test.jaffle_shop.not_null_fct_orders_order_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_order_id.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_order_id","resource_type":"test","alias":"not_null_fct_orders_order_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_order_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere order_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere order_id is null\n\n","column_name":"order_id"},"test.jaffle_shop.not_null_fct_orders_customer_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"customer_id","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_customer_id"],"unique_id":"test.jaffle_shop.not_null_fct_orders_customer_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_customer_id.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_customer_id","resource_type":"test","alias":"not_null_fct_orders_customer_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_customer_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere customer_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere customer_id is null\n\n","column_name":"customer_id"},"test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_relationships(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"relationships","kwargs":{"to":"ref('dim_customers')","field":"customer_id","column_name":"customer_id","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","relationships_fct_orders_customer_id__customer_id__ref_dim_customers_"],"unique_id":"test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/relationships_fct_orders_535c445ac9111d4713c286f097da3132.sql","original_file_path":"models/marts/core/schema.yml","name":"relationships_fct_orders_customer_id__customer_id__ref_dim_customers_","resource_type":"test","alias":"relationships_fct_orders_customer_id__customer_id__ref_dim_customers_","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["dim_customers"],["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_relationships"],"nodes":["model.jaffle_shop.dim_customers","model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/relationships_fct_orders_535c445ac9111d4713c286f097da3132.sql","compiled":true,"compiled_sql":"\n\n\n\n\nselect count(*) as validation_errors\nfrom (\n select customer_id as id from LOCAL_MALLEN.DBT_DEMO.fct_orders\n) as child\nleft join (\n select customer_id as id from LOCAL_MALLEN.DBT_DEMO.dim_customers\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\n\nselect count(*) as validation_errors\nfrom (\n select customer_id as id from LOCAL_MALLEN.DBT_DEMO.fct_orders\n) as child\nleft join (\n select customer_id as id from LOCAL_MALLEN.DBT_DEMO.dim_customers\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n","column_name":"customer_id"},"test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_accepted_values(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"accepted_values","kwargs":{"values":["placed","shipped","completed","return_pending","returned"],"column_name":"status","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned"],"unique_id":"test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/accepted_values_fct_orders_758238c28b8980ea7fe9d60a8d851ea8.sql","original_file_path":"models/marts/core/schema.yml","name":"accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned","resource_type":"test","alias":"accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_accepted_values"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/accepted_values_fct_orders_758238c28b8980ea7fe9d60a8d851ea8.sql","compiled":true,"compiled_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.fct_orders\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.fct_orders\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","column_name":"status"},"test.jaffle_shop.not_null_fct_orders_amount":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"amount","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_amount"],"unique_id":"test.jaffle_shop.not_null_fct_orders_amount","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_amount.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_amount","resource_type":"test","alias":"not_null_fct_orders_amount","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_amount.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere amount is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere amount is null\n\n","column_name":"amount"},"test.jaffle_shop.not_null_fct_orders_credit_card_amount":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"credit_card_amount","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_credit_card_amount"],"unique_id":"test.jaffle_shop.not_null_fct_orders_credit_card_amount","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_credit_card_amount.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_credit_card_amount","resource_type":"test","alias":"not_null_fct_orders_credit_card_amount","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_credit_card_amount.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere credit_card_amount is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere credit_card_amount is null\n\n","column_name":"credit_card_amount"},"test.jaffle_shop.not_null_fct_orders_coupon_amount":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"coupon_amount","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_coupon_amount"],"unique_id":"test.jaffle_shop.not_null_fct_orders_coupon_amount","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_coupon_amount.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_coupon_amount","resource_type":"test","alias":"not_null_fct_orders_coupon_amount","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_coupon_amount.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere coupon_amount is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere coupon_amount is null\n\n","column_name":"coupon_amount"},"test.jaffle_shop.not_null_fct_orders_bank_transfer_amount":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"bank_transfer_amount","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_bank_transfer_amount"],"unique_id":"test.jaffle_shop.not_null_fct_orders_bank_transfer_amount","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_bank_transfer_amount.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_bank_transfer_amount","resource_type":"test","alias":"not_null_fct_orders_bank_transfer_amount","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_bank_transfer_amount.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere bank_transfer_amount is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere bank_transfer_amount is null\n\n","column_name":"bank_transfer_amount"},"test.jaffle_shop.not_null_fct_orders_gift_card_amount":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"gift_card_amount","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_gift_card_amount"],"unique_id":"test.jaffle_shop.not_null_fct_orders_gift_card_amount","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_gift_card_amount.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_gift_card_amount","resource_type":"test","alias":"not_null_fct_orders_gift_card_amount","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_gift_card_amount.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere gift_card_amount is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere gift_card_amount is null\n\n","column_name":"gift_card_amount"}},"sources":{"source.jaffle_shop.seeds.raw_customers":{"fqn":["jaffle_shop","staging","seeds","raw_customers"],"database":"LOCAL_MALLEN","schema":"DBT_DEMO","unique_id":"source.jaffle_shop.seeds.raw_customers","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"models/staging/sources.yml","original_file_path":"models/staging/sources.yml","name":"raw_customers","source_name":"seeds","source_description":"","loader":"","identifier":"raw_customers","resource_type":"source","quoting":{"database":null,"schema":null,"identifier":null,"column":null},"loaded_at_field":null,"freshness":{"warn_after":null,"error_after":null,"filter":null},"external":null,"description":"","columns":{},"meta":{},"source_meta":{},"tags":[],"config":{"enabled":true},"patch_path":null},"source.jaffle_shop.seeds.raw_orders":{"fqn":["jaffle_shop","staging","seeds","raw_orders"],"database":"LOCAL_MALLEN","schema":"DBT_DEMO","unique_id":"source.jaffle_shop.seeds.raw_orders","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"models/staging/sources.yml","original_file_path":"models/staging/sources.yml","name":"raw_orders","source_name":"seeds","source_description":"","loader":"","identifier":"raw_orders","resource_type":"source","quoting":{"database":null,"schema":null,"identifier":null,"column":null},"loaded_at_field":null,"freshness":{"warn_after":null,"error_after":null,"filter":null},"external":null,"description":"","columns":{},"meta":{},"source_meta":{},"tags":[],"config":{"enabled":true},"patch_path":null},"source.jaffle_shop.seeds.raw_payments":{"fqn":["jaffle_shop","staging","seeds","raw_payments"],"database":"LOCAL_MALLEN","schema":"DBT_DEMO","unique_id":"source.jaffle_shop.seeds.raw_payments","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"models/staging/sources.yml","original_file_path":"models/staging/sources.yml","name":"raw_payments","source_name":"seeds","source_description":"","loader":"","identifier":"raw_payments","resource_type":"source","quoting":{"database":null,"schema":null,"identifier":null,"column":null},"loaded_at_field":null,"freshness":{"warn_after":null,"error_after":null,"filter":null},"external":null,"description":"","columns":{},"meta":{},"source_meta":{},"tags":[],"config":{"enabled":true},"patch_path":null}},"macros":{"macro.dbt.statement":{"unique_id":"macro.dbt.statement","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/core.sql","original_file_path":"macros/core.sql","name":"statement","macro_sql":"{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set status, res = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.noop_statement":{"unique_id":"macro.dbt.noop_statement","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/core.sql","original_file_path":"macros/core.sql","name":"noop_statement","macro_sql":"{% macro noop_statement(name=None, status=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_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.run_hooks":{"unique_id":"macro.dbt.run_hooks","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.column_list":{"unique_id":"macro.dbt.column_list","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"column_list","macro_sql":"{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.column_list_for_create_table":{"unique_id":"macro.dbt.column_list_for_create_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"column_list_for_create_table","macro_sql":"{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.make_hook_config":{"unique_id":"macro.dbt.make_hook_config","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"make_hook_config","macro_sql":"{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.before_begin":{"unique_id":"macro.dbt.before_begin","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"before_begin","macro_sql":"{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.in_transaction":{"unique_id":"macro.dbt.in_transaction","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"in_transaction","macro_sql":"{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.after_commit":{"unique_id":"macro.dbt.after_commit","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"after_commit","macro_sql":"{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.drop_relation_if_exists":{"unique_id":"macro.dbt.drop_relation_if_exists","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.load_relation":{"unique_id":"macro.dbt.load_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"load_relation","macro_sql":"{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.should_full_refresh":{"unique_id":"macro.dbt.should_full_refresh","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_merge_sql":{"unique_id":"macro.dbt.snapshot_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot_merge.sql","original_file_path":"macros/materializations/snapshot/snapshot_merge.sql","name":"snapshot_merge_sql","macro_sql":"{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter_macro('snapshot_merge_sql', target, source, insert_cols) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__snapshot_merge_sql":{"unique_id":"macro.dbt.default__snapshot_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot_merge.sql","original_file_path":"macros/materializations/snapshot/snapshot_merge.sql","name":"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 = 'update'\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.strategy_dispatch":{"unique_id":"macro.dbt.strategy_dispatch","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_hash_arguments":{"unique_id":"macro.dbt.snapshot_hash_arguments","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"snapshot_hash_arguments","macro_sql":"{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__snapshot_hash_arguments":{"unique_id":"macro.dbt.default__snapshot_hash_arguments","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_get_time":{"unique_id":"macro.dbt.snapshot_get_time","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"snapshot_get_time","macro_sql":"{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__snapshot_get_time":{"unique_id":"macro.dbt.default__snapshot_get_time","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"default__snapshot_get_time","macro_sql":"{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_timestamp_strategy":{"unique_id":"macro.dbt.snapshot_timestamp_strategy","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"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\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/fishtown-analytics/dbt/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 }) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_string_as_time":{"unique_id":"macro.dbt.snapshot_string_as_time","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"snapshot_string_as_time","macro_sql":"{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__snapshot_string_as_time":{"unique_id":"macro.dbt.default__snapshot_string_as_time","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_check_all_get_existing_columns":{"unique_id":"macro.dbt.snapshot_check_all_get_existing_columns","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"snapshot_check_all_get_existing_columns","macro_sql":"{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_check_strategy":{"unique_id":"macro.dbt.snapshot_check_strategy","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_columns":{"unique_id":"macro.dbt.create_columns","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"create_columns","macro_sql":"{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__create_columns":{"unique_id":"macro.dbt.default__create_columns","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.post_snapshot":{"unique_id":"macro.dbt.post_snapshot","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"post_snapshot","macro_sql":"{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__post_snapshot":{"unique_id":"macro.dbt.default__post_snapshot","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"default__post_snapshot","macro_sql":"{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_staging_table":{"unique_id":"macro.dbt.snapshot_staging_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"snapshot_staging_table","macro_sql":"{% macro 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\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 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 snapshotted_data.dbt_valid_to is 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n select * from insertions\n union all\n select * from updates\n\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.build_snapshot_table":{"unique_id":"macro.dbt.build_snapshot_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"build_snapshot_table","macro_sql":"{% macro 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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_or_create_relation":{"unique_id":"macro.dbt.get_or_create_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"get_or_create_relation","macro_sql":"{% macro 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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.build_snapshot_staging_table":{"unique_id":"macro.dbt.build_snapshot_staging_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"build_snapshot_staging_table","macro_sql":"{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_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, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.materialization_snapshot_default":{"unique_id":"macro.dbt.materialization_snapshot_default","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\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 {% do persist_docs(target_relation, model) %}\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_csv_table":{"unique_id":"macro.dbt.create_csv_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"create_csv_table","macro_sql":"{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.reset_csv_table":{"unique_id":"macro.dbt.reset_csv_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"reset_csv_table","macro_sql":"{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.load_csv_rows":{"unique_id":"macro.dbt.load_csv_rows","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"load_csv_rows","macro_sql":"{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__create_csv_table":{"unique_id":"macro.dbt.default__create_csv_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__reset_csv_table":{"unique_id":"macro.dbt.default__reset_csv_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_seed_column_quoted_csv":{"unique_id":"macro.dbt.get_seed_column_quoted_csv","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.basic_load_csv_rows":{"unique_id":"macro.dbt.basic_load_csv_rows","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"basic_load_csv_rows","macro_sql":"{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__load_csv_rows":{"unique_id":"macro.dbt.default__load_csv_rows","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"default__load_csv_rows","macro_sql":"{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.materialization_seed_default":{"unique_id":"macro.dbt.materialization_seed_default","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.incremental_upsert":{"unique_id":"macro.dbt.incremental_upsert","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/incremental/helpers.sql","original_file_path":"macros/materializations/incremental/helpers.sql","name":"incremental_upsert","macro_sql":"{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.materialization_incremental_default":{"unique_id":"macro.dbt.materialization_incremental_default","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/incremental/incremental.sql","original_file_path":"macros/materializations/incremental/incremental.sql","name":"materialization_incremental_default","macro_sql":"{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(this) %}\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 {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or should_full_refresh() %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set backup_identifier = existing_relation.identifier ~ \"__dbt_backup\" %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% do persist_docs(target_relation, model) %}\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_merge_sql":{"unique_id":"macro.dbt.get_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"get_merge_sql","macro_sql":"{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_delete_insert_merge_sql":{"unique_id":"macro.dbt.get_delete_insert_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"get_delete_insert_merge_sql","macro_sql":"{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_insert_overwrite_merge_sql":{"unique_id":"macro.dbt.get_insert_overwrite_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"get_insert_overwrite_merge_sql","macro_sql":"{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter_macro('get_insert_overwrite_merge_sql', target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_merge_sql":{"unique_id":"macro.dbt.default__get_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"default__get_merge_sql","macro_sql":"{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\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 {% if unique_key %}\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 {% 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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_quoted_csv":{"unique_id":"macro.dbt.get_quoted_csv","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"get_quoted_csv","macro_sql":"{% macro get_quoted_csv(column_names) %}\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{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.common_get_delete_insert_merge_sql":{"unique_id":"macro.dbt.common_get_delete_insert_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"common_get_delete_insert_merge_sql","macro_sql":"{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_delete_insert_merge_sql":{"unique_id":"macro.dbt.default__get_delete_insert_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"default__get_delete_insert_merge_sql","macro_sql":"{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_insert_overwrite_merge_sql":{"unique_id":"macro.dbt.default__get_insert_overwrite_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"default__get_insert_overwrite_merge_sql","macro_sql":"{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.materialization_table_default":{"unique_id":"macro.dbt.materialization_table_default","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/table/table.sql","original_file_path":"macros/materializations/table/table.sql","name":"materialization_table_default","macro_sql":"{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\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\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(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 {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_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 {% 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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.materialization_view_default":{"unique_id":"macro.dbt.materialization_view_default","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/view/view.sql","original_file_path":"macros/materializations/view/view.sql","name":"materialization_view_default","macro_sql":"{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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 -%}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.handle_existing_table":{"unique_id":"macro.dbt.handle_existing_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/view/create_or_replace_view.sql","original_file_path":"macros/materializations/view/create_or_replace_view.sql","name":"handle_existing_table","macro_sql":"{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter_macro(\"dbt.handle_existing_table\", full_refresh, old_relation) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__handle_existing_table":{"unique_id":"macro.dbt.default__handle_existing_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/view/create_or_replace_view.sql","original_file_path":"macros/materializations/view/create_or_replace_view.sql","name":"default__handle_existing_table","macro_sql":"{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_or_replace_view":{"unique_id":"macro.dbt.create_or_replace_view","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/view/create_or_replace_view.sql","original_file_path":"macros/materializations/view/create_or_replace_view.sql","name":"create_or_replace_view","macro_sql":"{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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 {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.generate_alias_name":{"unique_id":"macro.dbt.generate_alias_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/get_custom_alias.sql","original_file_path":"macros/etc/get_custom_alias.sql","name":"generate_alias_name","macro_sql":"{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.run_query":{"unique_id":"macro.dbt.run_query","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/query.sql","original_file_path":"macros/etc/query.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.is_incremental":{"unique_id":"macro.dbt.is_incremental","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/is_incremental.sql","original_file_path":"macros/etc/is_incremental.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.convert_datetime":{"unique_id":"macro.dbt.convert_datetime","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/datetime.sql","original_file_path":"macros/etc/datetime.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.dates_in_range":{"unique_id":"macro.dbt.dates_in_range","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/datetime.sql","original_file_path":"macros/etc/datetime.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.partition_range":{"unique_id":"macro.dbt.partition_range","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/datetime.sql","original_file_path":"macros/etc/datetime.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.py_current_timestring":{"unique_id":"macro.dbt.py_current_timestring","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/datetime.sql","original_file_path":"macros/etc/datetime.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.generate_schema_name":{"unique_id":"macro.dbt.generate_schema_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/get_custom_schema.sql","original_file_path":"macros/etc/get_custom_schema.sql","name":"generate_schema_name","macro_sql":"{% macro 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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.generate_schema_name_for_env":{"unique_id":"macro.dbt.generate_schema_name_for_env","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/get_custom_schema.sql","original_file_path":"macros/etc/get_custom_schema.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.generate_database_name":{"unique_id":"macro.dbt.generate_database_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/get_custom_database.sql","original_file_path":"macros/etc/get_custom_database.sql","name":"generate_database_name","macro_sql":"{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter_macro('generate_database_name', custom_database_name, node)) %}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":["macro.dbt.adapter_macro"]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__generate_database_name":{"unique_id":"macro.dbt.default__generate_database_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/get_custom_database.sql","original_file_path":"macros/etc/get_custom_database.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.adapter_macro":{"unique_id":"macro.dbt.adapter_macro","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"adapter_macro","macro_sql":"{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_columns_in_query":{"unique_id":"macro.dbt.get_columns_in_query","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"get_columns_in_query","macro_sql":"{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_columns_in_query":{"unique_id":"macro.dbt.default__get_columns_in_query","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_schema":{"unique_id":"macro.dbt.create_schema","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"create_schema","macro_sql":"{% macro create_schema(relation) -%}\n {{ adapter_macro('create_schema', relation) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__create_schema":{"unique_id":"macro.dbt.default__create_schema","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.drop_schema":{"unique_id":"macro.dbt.drop_schema","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"drop_schema","macro_sql":"{% macro drop_schema(relation) -%}\n {{ adapter_macro('drop_schema', relation) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__drop_schema":{"unique_id":"macro.dbt.default__drop_schema","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_table_as":{"unique_id":"macro.dbt.create_table_as","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"create_table_as","macro_sql":"{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__create_table_as":{"unique_id":"macro.dbt.default__create_table_as","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 as (\n {{ sql }}\n );\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_view_as":{"unique_id":"macro.dbt.create_view_as","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"create_view_as","macro_sql":"{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__create_view_as":{"unique_id":"macro.dbt.default__create_view_as","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 }} as (\n {{ sql }}\n );\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_catalog":{"unique_id":"macro.dbt.get_catalog","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"get_catalog","macro_sql":"{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":["macro.dbt.adapter_macro"]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_catalog":{"unique_id":"macro.dbt.default__get_catalog","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_columns_in_relation":{"unique_id":"macro.dbt.get_columns_in_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"get_columns_in_relation","macro_sql":"{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.sql_convert_columns_in_relation":{"unique_id":"macro.dbt.sql_convert_columns_in_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_columns_in_relation":{"unique_id":"macro.dbt.default__get_columns_in_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.alter_column_type":{"unique_id":"macro.dbt.alter_column_type","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"alter_column_type","macro_sql":"{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.alter_column_comment":{"unique_id":"macro.dbt.alter_column_comment","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"alter_column_comment","macro_sql":"{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter_macro('alter_column_comment', relation, column_dict)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__alter_column_comment":{"unique_id":"macro.dbt.default__alter_column_comment","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.alter_relation_comment":{"unique_id":"macro.dbt.alter_relation_comment","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"alter_relation_comment","macro_sql":"{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter_macro('alter_relation_comment', relation, relation_comment)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__alter_relation_comment":{"unique_id":"macro.dbt.default__alter_relation_comment","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.persist_docs":{"unique_id":"macro.dbt.persist_docs","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"persist_docs","macro_sql":"{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter_macro('persist_docs', relation, model, for_relation, for_columns)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__persist_docs":{"unique_id":"macro.dbt.default__persist_docs","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__alter_column_type":{"unique_id":"macro.dbt.default__alter_column_type","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.drop_relation":{"unique_id":"macro.dbt.drop_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"drop_relation","macro_sql":"{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__drop_relation":{"unique_id":"macro.dbt.default__drop_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"default__drop_relation","macro_sql":"{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.truncate_relation":{"unique_id":"macro.dbt.truncate_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"truncate_relation","macro_sql":"{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__truncate_relation":{"unique_id":"macro.dbt.default__truncate_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"default__truncate_relation","macro_sql":"{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.rename_relation":{"unique_id":"macro.dbt.rename_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"rename_relation","macro_sql":"{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__rename_relation":{"unique_id":"macro.dbt.default__rename_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.information_schema_name":{"unique_id":"macro.dbt.information_schema_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"information_schema_name","macro_sql":"{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__information_schema_name":{"unique_id":"macro.dbt.default__information_schema_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.list_schemas":{"unique_id":"macro.dbt.list_schemas","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"list_schemas","macro_sql":"{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":["macro.dbt.adapter_macro"]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__list_schemas":{"unique_id":"macro.dbt.default__list_schemas","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.check_schema_exists":{"unique_id":"macro.dbt.check_schema_exists","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"check_schema_exists","macro_sql":"{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__check_schema_exists":{"unique_id":"macro.dbt.default__check_schema_exists","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.list_relations_without_caching":{"unique_id":"macro.dbt.list_relations_without_caching","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"list_relations_without_caching","macro_sql":"{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter_macro('list_relations_without_caching', schema_relation)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":["macro.dbt.adapter_macro"]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__list_relations_without_caching":{"unique_id":"macro.dbt.default__list_relations_without_caching","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.current_timestamp":{"unique_id":"macro.dbt.current_timestamp","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"current_timestamp","macro_sql":"{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__current_timestamp":{"unique_id":"macro.dbt.default__current_timestamp","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.collect_freshness":{"unique_id":"macro.dbt.collect_freshness","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"collect_freshness","macro_sql":"{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__collect_freshness":{"unique_id":"macro.dbt.default__collect_freshness","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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').table) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.make_temp_relation":{"unique_id":"macro.dbt.make_temp_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"make_temp_relation","macro_sql":"{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__make_temp_relation":{"unique_id":"macro.dbt.default__make_temp_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"default__make_temp_relation","macro_sql":"{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.set_sql_header":{"unique_id":"macro.dbt.set_sql_header","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"set_sql_header","macro_sql":"{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.test_relationships":{"unique_id":"macro.dbt.test_relationships","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/schema_tests/relationships.sql","original_file_path":"macros/schema_tests/relationships.sql","name":"test_relationships","macro_sql":"{% macro test_relationships(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nselect count(*) as validation_errors\nfrom (\n select {{ column_name }} as id from {{ model }}\n) as child\nleft join (\n select {{ field }} as id from {{ to }}\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.test_not_null":{"unique_id":"macro.dbt.test_not_null","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/schema_tests/not_null.sql","original_file_path":"macros/schema_tests/not_null.sql","name":"test_not_null","macro_sql":"{% macro test_not_null(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*) as validation_errors\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.test_unique":{"unique_id":"macro.dbt.test_unique","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/schema_tests/unique.sql","original_file_path":"macros/schema_tests/unique.sql","name":"test_unique","macro_sql":"{% macro test_unique(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*) as validation_errors\nfrom (\n\n select\n {{ column_name }}\n\n from {{ model }}\n where {{ column_name }} is not null\n group by {{ column_name }}\n having count(*) > 1\n\n) validation_errors\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.test_accepted_values":{"unique_id":"macro.dbt.test_accepted_values","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/schema_tests/accepted_values.sql","original_file_path":"macros/schema_tests/accepted_values.sql","name":"test_accepted_values","macro_sql":"{% macro test_accepted_values(model, values) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n{% set quote_values = kwargs.get('quote', True) %}\n\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 not in (\n {% for value in values -%}\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__get_catalog":{"unique_id":"macro.dbt_snowflake.snowflake__get_catalog","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/catalog.sql","original_file_path":"macros/catalog.sql","name":"snowflake__get_catalog","macro_sql":"{% macro snowflake__get_catalog(information_schema, schemas) -%}\n {% set query %}\n with tables as (\n\n select\n table_catalog as \"table_database\",\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n table_type as \"table_type\",\n\n -- note: this is the _role_ that owns the table\n table_owner as \"table_owner\",\n\n 'Clustering Key' as \"stats:clustering_key:label\",\n clustering_key as \"stats:clustering_key:value\",\n 'The key used to cluster this table' as \"stats:clustering_key:description\",\n (clustering_key is not null) as \"stats:clustering_key:include\",\n\n 'Row Count' as \"stats:row_count:label\",\n row_count as \"stats:row_count:value\",\n 'An approximate count of rows in this table' as \"stats:row_count:description\",\n (row_count is not null) as \"stats:row_count:include\",\n\n 'Approximate Size' as \"stats:bytes:label\",\n bytes as \"stats:bytes:value\",\n 'Approximate size of the table as reported by Snowflake' as \"stats:bytes:description\",\n (bytes is not null) as \"stats:bytes:include\"\n\n from {{ information_schema }}.tables\n\n ),\n\n columns as (\n\n select\n table_catalog as \"table_database\",\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n null as \"table_comment\",\n\n column_name as \"column_name\",\n ordinal_position as \"column_index\",\n data_type as \"column_type\",\n null as \"column_comment\"\n\n from {{ information_schema }}.columns\n )\n\n select *\n from tables\n join columns using (\"table_database\", \"table_schema\", \"table_name\")\n where (\n {%- for schema in schemas -%}\n upper(\"table_schema\") = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n order by \"column_index\"\n {%- endset -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__create_table_as":{"unique_id":"macro.dbt_snowflake.snowflake__create_table_as","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__create_table_as","macro_sql":"{% macro snowflake__create_table_as(temporary, relation, sql) -%}\n {%- set transient = config.get('transient', default=true) -%}\n {%- set cluster_by_keys = config.get('cluster_by', default=none) -%}\n {%- set enable_automatic_clustering = config.get('automatic_clustering', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n\n {%- if cluster_by_keys is not none and cluster_by_keys is string -%}\n {%- set cluster_by_keys = [cluster_by_keys] -%}\n {%- endif -%}\n {%- if cluster_by_keys is not none -%}\n {%- set cluster_by_string = cluster_by_keys|join(\", \")-%}\n {% else %}\n {%- set cluster_by_string = none -%}\n {%- endif -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace {% if temporary -%}\n temporary\n {%- elif transient -%}\n transient\n {%- endif %} table {{ relation }} {% if copy_grants and not temporary -%} copy grants {%- endif %} as\n (\n {%- if cluster_by_string is not none -%}\n select * from(\n {{ sql }}\n ) order by ({{ cluster_by_string }})\n {%- else -%}\n {{ sql }}\n {%- endif %}\n );\n {% if cluster_by_string is not none and not temporary -%}\n alter table {{relation}} cluster by ({{cluster_by_string}});\n {%- endif -%}\n {% if enable_automatic_clustering and cluster_by_string is not none and not temporary -%}\n alter table {{relation}} resume recluster;\n {%- endif -%}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__create_view_as":{"unique_id":"macro.dbt_snowflake.snowflake__create_view_as","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__create_view_as","macro_sql":"{% macro snowflake__create_view_as(relation, sql) -%}\n {%- set secure = config.get('secure', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create or replace {% if secure -%}\n secure\n {%- endif %} view {{ relation }} {% if copy_grants -%} copy grants {%- endif %} as (\n {{ sql }}\n );\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__get_columns_in_relation":{"unique_id":"macro.dbt_snowflake.snowflake__get_columns_in_relation","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__get_columns_in_relation","macro_sql":"{% macro snowflake__get_columns_in_relation(relation) -%}\n {%- set sql -%}\n describe table {{ relation }}\n {%- endset -%}\n {%- set result = run_query(sql) -%}\n\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many columns in relation {{ relation }}! dbt can only get\n information about relations with fewer than {{ maximum }} columns.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n\n {% set columns = [] %}\n {% for row in result %}\n {% do columns.append(api.Column.from_description(row['name'], row['type'])) %}\n {% endfor %}\n {% do return(columns) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__list_schemas":{"unique_id":"macro.dbt_snowflake.snowflake__list_schemas","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__list_schemas","macro_sql":"{% macro snowflake__list_schemas(database) -%}\n {# 10k limit from here: https://docs.snowflake.net/manuals/sql-reference/sql/show-schemas.html#usage-notes #}\n {% set maximum = 10000 %}\n {% set sql -%}\n show terse schemas in database {{ database }}\n limit {{ maximum }}\n {%- endset %}\n {% set result = run_query(sql) %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many schemas in database {{ database }}! dbt can only get\n information about databases with fewer than {{ maximum }} schemas.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {{ return(result) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__list_relations_without_caching":{"unique_id":"macro.dbt_snowflake.snowflake__list_relations_without_caching","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__list_relations_without_caching","macro_sql":"{% macro snowflake__list_relations_without_caching(schema_relation) %}\n {%- set sql -%}\n show terse objects in {{ schema_relation }}\n {%- endset -%}\n\n {%- set result = run_query(sql) -%}\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many schemas in schema {{ schema_relation }}! dbt can only get\n information about schemas with fewer than {{ maximum }} objects.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {%- do return(result) -%}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__check_schema_exists":{"unique_id":"macro.dbt_snowflake.snowflake__check_schema_exists","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__check_schema_exists","macro_sql":"{% macro snowflake__check_schema_exists(information_schema, schema) -%}\n {% call statement('check_schema_exists', fetch_result=True) -%}\n select count(*)\n from {{ information_schema }}.schemata\n where upper(schema_name) = upper('{{ schema }}')\n and upper(catalog_name) = upper('{{ information_schema.database }}')\n {%- endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__current_timestamp":{"unique_id":"macro.dbt_snowflake.snowflake__current_timestamp","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__current_timestamp","macro_sql":"{% macro snowflake__current_timestamp() -%}\n convert_timezone('UTC', current_timestamp())\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__snapshot_string_as_time":{"unique_id":"macro.dbt_snowflake.snowflake__snapshot_string_as_time","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__snapshot_string_as_time","macro_sql":"{% macro snowflake__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"to_timestamp_ntz('\" ~ timestamp ~ \"')\" -%}\n {{ return(result) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__snapshot_get_time":{"unique_id":"macro.dbt_snowflake.snowflake__snapshot_get_time","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__snapshot_get_time","macro_sql":"{% macro snowflake__snapshot_get_time() -%}\n to_timestamp_ntz({{ current_timestamp() }})\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__rename_relation":{"unique_id":"macro.dbt_snowflake.snowflake__rename_relation","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__rename_relation","macro_sql":"{% macro snowflake__rename_relation(from_relation, to_relation) -%}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ to_relation }}\n {%- endcall %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__alter_column_type":{"unique_id":"macro.dbt_snowflake.snowflake__alter_column_type","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__alter_column_type","macro_sql":"{% macro snowflake__alter_column_type(relation, column_name, new_column_type) -%}\n {% call statement('alter_column_type') %}\n alter table {{ relation }} alter {{ adapter.quote(column_name) }} set data type {{ new_column_type }};\n {% endcall %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__alter_relation_comment":{"unique_id":"macro.dbt_snowflake.snowflake__alter_relation_comment","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__alter_relation_comment","macro_sql":"{% macro snowflake__alter_relation_comment(relation, relation_comment) -%}\n comment on {{ relation.type }} {{ relation }} IS $${{ relation_comment | replace('$', '[$]') }}$$;\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__alter_column_comment":{"unique_id":"macro.dbt_snowflake.snowflake__alter_column_comment","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__alter_column_comment","macro_sql":"{% macro snowflake__alter_column_comment(relation, column_dict) -%}\n alter {{ relation.type }} {{ relation }} alter\n {% for column_name in column_dict %}\n {{ column_name }} COMMENT $${{ column_dict[column_name]['description'] | replace('$', '[$]') }}$$ {{ ',' if not loop.last else ';' }}\n {% endfor %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__get_merge_sql":{"unique_id":"macro.dbt_snowflake.snowflake__get_merge_sql","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/merge.sql","original_file_path":"macros/materializations/merge.sql","name":"snowflake__get_merge_sql","macro_sql":"{% macro snowflake__get_merge_sql(target, source_sql, unique_key, dest_columns, predicates) -%}\n\n {#\n Workaround for Snowflake not being happy with a merge on a constant-false predicate.\n When no unique_key is provided, this macro will do a regular insert. If a unique_key\n is provided, then this macro will do a proper merge instead.\n #}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute='name')) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- if unique_key is none -%}\n\n {{ sql_header if sql_header is not none }}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source_sql }}\n );\n\n {%- else -%}\n\n {{ default__get_merge_sql(target, source_sql, unique_key, dest_columns, predicates) }}\n\n {%- endif -%}\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.materialization_view_snowflake":{"unique_id":"macro.dbt_snowflake.materialization_view_snowflake","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/view.sql","original_file_path":"macros/materializations/view.sql","name":"materialization_view_snowflake","macro_sql":"{% materialization view, adapter='snowflake' -%}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model, for_columns=false) %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.materialization_table_snowflake":{"unique_id":"macro.dbt_snowflake.materialization_table_snowflake","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/table.sql","original_file_path":"macros/materializations/table.sql","name":"materialization_table_snowflake","macro_sql":"{% materialization table, adapter='snowflake' %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database, type='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 {#-- Drop the relation if it was a view to \"convert\" it in a table. This may lead to\n -- downtime, but it should be a relatively infrequent occurrence #}\n {% if old_relation is not none and not old_relation.is_table %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ drop_relation_if_exists(old_relation) }}\n {% endif %}\n\n --build model\n {% call statement('main') -%}\n {{ create_table_as(false, target_relation, sql) }}\n {%- endcall %}\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 {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.dbt_snowflake_validate_get_incremental_strategy":{"unique_id":"macro.dbt_snowflake.dbt_snowflake_validate_get_incremental_strategy","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/incremental.sql","original_file_path":"macros/materializations/incremental.sql","name":"dbt_snowflake_validate_get_incremental_strategy","macro_sql":"{% macro dbt_snowflake_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'delete+insert'\n {%- endset %}\n {% if strategy not in ['merge', 'delete+insert'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.dbt_snowflake_get_incremental_sql":{"unique_id":"macro.dbt_snowflake.dbt_snowflake_get_incremental_sql","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/incremental.sql","original_file_path":"macros/materializations/incremental.sql","name":"dbt_snowflake_get_incremental_sql","macro_sql":"{% macro dbt_snowflake_get_incremental_sql(strategy, tmp_relation, target_relation, unique_key, dest_columns) %}\n {% if strategy == 'merge' %}\n {% do return(get_merge_sql(target_relation, tmp_relation, unique_key, dest_columns)) %}\n {% elif strategy == 'delete+insert' %}\n {% do return(get_delete_insert_merge_sql(target_relation, tmp_relation, unique_key, dest_columns)) %}\n {% else %}\n {% do exceptions.raise_compiler_error('invalid strategy: ' ~ strategy) %}\n {% endif %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.materialization_incremental_snowflake":{"unique_id":"macro.dbt_snowflake.materialization_incremental_snowflake","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/incremental.sql","original_file_path":"macros/materializations/incremental.sql","name":"materialization_incremental_snowflake","macro_sql":"{% materialization incremental, adapter='snowflake' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set target_relation = this %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_snowflake_validate_get_incremental_strategy(config) -%}\n\n -- setup\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view %}\n {#-- Can't overwrite a view with a table - we must drop --#}\n {{ log(\"Dropping relation \" ~ target_relation ~ \" because it is a view and this model is a table.\") }}\n {% do adapter.drop_relation(existing_relation) %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% else %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set dest_columns = adapter.get_columns_in_relation(target_relation) %}\n {% set build_sql = dbt_snowflake_get_incremental_sql(strategy, tmp_relation, target_relation, unique_key, dest_columns) %}\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {%- endcall -%}\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 {% set target_relation = target_relation.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.jaffle_shop.payment_methods":{"unique_id":"macro.jaffle_shop.payment_methods","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"macros/payment_methods.sql","original_file_path":"macros/payment_methods.sql","name":"payment_methods","macro_sql":"{% macro payment_methods() %}\n {% do return([jaffle_shop.lowerstr('Credit_Card'), 'coupon', 'bank_transfer', 'gift_card']) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":["macro.jaffle_shop.lowerstr"]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.jaffle_shop.lowerstr":{"unique_id":"macro.jaffle_shop.lowerstr","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"macros/lowerstr.sql","original_file_path":"macros/lowerstr.sql","name":"lowerstr","macro_sql":"{% macro lowerstr(string) %}\n {% do return(string | lower) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]}},"docs":{"jaffle_shop.__overview__":{"unique_id":"jaffle_shop.__overview__","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"overview.md","original_file_path":"models/overview.md","name":"__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 demonstrations and tutorials.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop).\n\ntest"},"jaffle_shop.orders_status":{"unique_id":"jaffle_shop.orders_status","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/docs.md","original_file_path":"models/marts/core/docs.md","name":"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 |"},"dbt.__overview__":{"unique_id":"dbt.__overview__","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"overview.md","original_file_path":"docs/overview.md","name":"__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 `--models` 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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://community.getdbt.com/) on Slack for live questions and support."}},"disabled":[],"generated_at":"2020-06-22T20:06:55.224210Z","parent_map":{"model.jaffle_shop.stg_customers":["snapshot.jaffle_shop.customer_snapshot"],"model.jaffle_shop.stg_payments":["source.jaffle_shop.seeds.raw_payments"],"model.jaffle_shop.stg_orders":["source.jaffle_shop.seeds.raw_orders"],"model.jaffle_shop.dim_customers":["model.jaffle_shop.customer_orders","model.jaffle_shop.customer_payments","model.jaffle_shop.stg_customers"],"model.jaffle_shop.fct_orders":["model.jaffle_shop.order_payments","model.jaffle_shop.stg_orders"],"model.jaffle_shop.order_payments":["model.jaffle_shop.stg_payments"],"model.jaffle_shop.customer_payments":["model.jaffle_shop.stg_orders","model.jaffle_shop.stg_payments"],"model.jaffle_shop.customer_orders":["model.jaffle_shop.stg_orders"],"snapshot.jaffle_shop.customer_snapshot":["source.jaffle_shop.seeds.raw_customers"],"analysis.jaffle_shop.orders_with_customers":["model.jaffle_shop.dim_customers","model.jaffle_shop.fct_orders"],"seed.jaffle_shop.raw_customers":[],"seed.jaffle_shop.raw_orders":[],"seed.jaffle_shop.raw_payments":[],"test.jaffle_shop.unique_stg_customers_customer_id":["model.jaffle_shop.stg_customers"],"test.jaffle_shop.not_null_stg_customers_customer_id":["model.jaffle_shop.stg_customers"],"test.jaffle_shop.unique_stg_orders_order_id":["model.jaffle_shop.stg_orders"],"test.jaffle_shop.not_null_stg_orders_order_id":["model.jaffle_shop.stg_orders"],"test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned":["model.jaffle_shop.stg_orders"],"test.jaffle_shop.unique_stg_payments_payment_id":["model.jaffle_shop.stg_payments"],"test.jaffle_shop.not_null_stg_payments_payment_id":["model.jaffle_shop.stg_payments"],"test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card":["model.jaffle_shop.stg_payments"],"test.jaffle_shop.unique_dim_customers_customer_id":["model.jaffle_shop.dim_customers"],"test.jaffle_shop.not_null_dim_customers_customer_id":["model.jaffle_shop.dim_customers"],"test.jaffle_shop.unique_fct_orders_order_id":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_order_id":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_customer_id":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_":["model.jaffle_shop.dim_customers","model.jaffle_shop.fct_orders"],"test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_amount":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_credit_card_amount":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_coupon_amount":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_bank_transfer_amount":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_gift_card_amount":["model.jaffle_shop.fct_orders"],"source.jaffle_shop.seeds.raw_customers":[],"source.jaffle_shop.seeds.raw_orders":[],"source.jaffle_shop.seeds.raw_payments":[]},"child_map":{"model.jaffle_shop.stg_customers":["model.jaffle_shop.dim_customers","test.jaffle_shop.not_null_stg_customers_customer_id","test.jaffle_shop.unique_stg_customers_customer_id"],"model.jaffle_shop.stg_payments":["model.jaffle_shop.customer_payments","model.jaffle_shop.order_payments","test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card","test.jaffle_shop.not_null_stg_payments_payment_id","test.jaffle_shop.unique_stg_payments_payment_id"],"model.jaffle_shop.stg_orders":["model.jaffle_shop.customer_orders","model.jaffle_shop.customer_payments","model.jaffle_shop.fct_orders","test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned","test.jaffle_shop.not_null_stg_orders_order_id","test.jaffle_shop.unique_stg_orders_order_id"],"model.jaffle_shop.dim_customers":["analysis.jaffle_shop.orders_with_customers","test.jaffle_shop.not_null_dim_customers_customer_id","test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_","test.jaffle_shop.unique_dim_customers_customer_id"],"model.jaffle_shop.fct_orders":["analysis.jaffle_shop.orders_with_customers","test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned","test.jaffle_shop.not_null_fct_orders_amount","test.jaffle_shop.not_null_fct_orders_bank_transfer_amount","test.jaffle_shop.not_null_fct_orders_coupon_amount","test.jaffle_shop.not_null_fct_orders_credit_card_amount","test.jaffle_shop.not_null_fct_orders_customer_id","test.jaffle_shop.not_null_fct_orders_gift_card_amount","test.jaffle_shop.not_null_fct_orders_order_id","test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_","test.jaffle_shop.unique_fct_orders_order_id"],"model.jaffle_shop.order_payments":["model.jaffle_shop.fct_orders"],"model.jaffle_shop.customer_payments":["model.jaffle_shop.dim_customers"],"model.jaffle_shop.customer_orders":["model.jaffle_shop.dim_customers"],"snapshot.jaffle_shop.customer_snapshot":["model.jaffle_shop.stg_customers"],"analysis.jaffle_shop.orders_with_customers":[],"seed.jaffle_shop.raw_customers":[],"seed.jaffle_shop.raw_orders":[],"seed.jaffle_shop.raw_payments":[],"test.jaffle_shop.unique_stg_customers_customer_id":[],"test.jaffle_shop.not_null_stg_customers_customer_id":[],"test.jaffle_shop.unique_stg_orders_order_id":[],"test.jaffle_shop.not_null_stg_orders_order_id":[],"test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned":[],"test.jaffle_shop.unique_stg_payments_payment_id":[],"test.jaffle_shop.not_null_stg_payments_payment_id":[],"test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card":[],"test.jaffle_shop.unique_dim_customers_customer_id":[],"test.jaffle_shop.not_null_dim_customers_customer_id":[],"test.jaffle_shop.unique_fct_orders_order_id":[],"test.jaffle_shop.not_null_fct_orders_order_id":[],"test.jaffle_shop.not_null_fct_orders_customer_id":[],"test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_":[],"test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned":[],"test.jaffle_shop.not_null_fct_orders_amount":[],"test.jaffle_shop.not_null_fct_orders_credit_card_amount":[],"test.jaffle_shop.not_null_fct_orders_coupon_amount":[],"test.jaffle_shop.not_null_fct_orders_bank_transfer_amount":[],"test.jaffle_shop.not_null_fct_orders_gift_card_amount":[],"source.jaffle_shop.seeds.raw_customers":["snapshot.jaffle_shop.customer_snapshot"],"source.jaffle_shop.seeds.raw_orders":["model.jaffle_shop.stg_orders"],"source.jaffle_shop.seeds.raw_payments":["model.jaffle_shop.stg_payments"]},"metadata":{"project_id":"06e5b98c2db46f8a72cc4f66410e9b3b","user_id":null,"send_anonymous_usage_stats":false,"adapter_type":"snowflake"}} diff --git a/src/app/components/references/index.js b/src/app/components/references/index.js index 277b75524..072accee8 100644 --- a/src/app/components/references/index.js +++ b/src/app/components/references/index.js @@ -36,6 +36,8 @@ angular return 'Snapshots' } else if (type == 'analysis') { return 'Analyses'; + } else if (type == 'macro') { + return 'Macros'; } else { return 'Nodes'; } diff --git a/src/app/docs/analysis.html b/src/app/docs/analysis.html index ef385709a..46b4c71cd 100644 --- a/src/app/docs/analysis.html +++ b/src/app/docs/analysis.html @@ -33,8 +33,10 @@

@@ -54,6 +56,22 @@

Description
+
+
+
+
Referenced By
+ +
+
+ +
+
+
+
Depends On
+ +
+
+
diff --git a/src/app/docs/analysis.js b/src/app/docs/analysis.js index 34ba23b24..f9290f475 100644 --- a/src/app/docs/analysis.js +++ b/src/app/docs/analysis.js @@ -1,6 +1,8 @@ 'use strict'; const angular = require('angular'); +const _ = require('underscore'); +const utils = require('./utils') require("./styles.css"); angular @@ -8,6 +10,32 @@ angular .controller('AnalysisCtrl', ['$scope', '$state', 'project', 'code', '$transitions', '$anchorScroll', '$location', function($scope, $state, projectService, codeService, $transitions, $anchorScroll, $location) { + function getReferences(project, macro) { + var references = _.filter(project.nodes, function(node) { + if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { + if (_.contains(node.depends_on.nodes, macro.unique_id)) { + return true; + } + } + return false; + }); + + // TODO : include macros? + return _.groupBy(references, 'resource_type'); + } + + function getParents (project, model) { + var parents = _.filter(project.nodes, function(node) { + if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { + if (_.contains(model.depends_on.nodes, node.unique_id)) { + return true; + } + } + return false; + }); + + return _.groupBy(parents, 'resource_type'); + } $scope.model_uid = $state.params.unique_id; $scope.project = projectService; $scope.codeService = codeService; @@ -20,7 +48,10 @@ angular $scope.model = {}; projectService.ready(function(project) { - $scope.model = project.nodes[$scope.model_uid]; + var mod = project.nodes[$scope.model_uid]; + $scope.model = mod; + $scope.references = utils.getReferences(project, mod); + $scope.parents = utils.getParents(project, mod); $scope.versions = { 'Source': $scope.model.raw_sql, diff --git a/src/app/docs/macro.html b/src/app/docs/macro.html index 1ee290330..8b89ce433 100644 --- a/src/app/docs/macro.html +++ b/src/app/docs/macro.html @@ -31,6 +31,7 @@

  • Description
  • Arguments
  • Referenced By
  • +
  • Depends On
  • Code
  • @@ -51,7 +52,7 @@
    Description
    -
    +
    Arguments
    @@ -66,6 +67,14 @@
    Referenced By
    +
    +
    +
    +
    Depends On
    + +
    +
    +
    diff --git a/src/app/docs/macro.js b/src/app/docs/macro.js index 3d39a3b36..62204a13b 100644 --- a/src/app/docs/macro.js +++ b/src/app/docs/macro.js @@ -15,10 +15,19 @@ angular $scope.project = projectService; $scope.codeService = codeService; - function getReferences(project, macro) { + function getReferences(project, self) { var references = _.filter(project.nodes, function(node) { if (node.depends_on && node.depends_on.macros && node.depends_on.macros.length) { - if (_.contains(node.depends_on.macros, macro.unique_id)) { + if (_.contains(node.depends_on.macros, self.unique_id)) { + return true; + } + } + return false; + }); + + var macroReferences = _.filter(project.macros, function(macro) { + if (macro.depends_on && macro.depends_on.macros && macro.depends_on.macros.length) { + if (_.contains(macro.depends_on.macros, self.unique_id)) { return true; } } @@ -26,7 +35,20 @@ angular }); // TODO : include macros? - return _.groupBy(references, 'resource_type'); + return _.groupBy(references.concat(macroReferences), 'resource_type'); + } + + function getMacroParents (project, self) { + var macroParents = _.filter(project.macros, function(macro) { + if (self.depends_on && self.depends_on.macros && self.depends_on.macros.length) { + if (_.contains(self.depends_on.macros, macro.unique_id)) { + return true; + } + } + return false; + }); + + return _.groupBy(macroParents, 'resource_type'); } $scope.macro = {}; @@ -34,6 +56,7 @@ angular var macro = project.macros[$scope.model_uid]; $scope.macro = macro; $scope.references = getReferences(project, macro); + $scope.parents = getMacroParents(project, macro); // adapter macros if ($scope.macro.is_adapter_macro) { diff --git a/src/app/docs/model.html b/src/app/docs/model.html index f85afc223..b1b929ded 100644 --- a/src/app/docs/model.html +++ b/src/app/docs/model.html @@ -36,6 +36,8 @@

  • Details
  • Description
  • Columns
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -68,6 +70,22 @@
    Columns
    +
    +
    +
    +
    Referenced By
    + +
    +
    + +
    +
    +
    +
    Depends On
    + +
    +
    +
    diff --git a/src/app/docs/model.js b/src/app/docs/model.js index 64bc4cb73..8ec25fc45 100644 --- a/src/app/docs/model.js +++ b/src/app/docs/model.js @@ -1,18 +1,46 @@ 'use strict'; const angular = require('angular'); +const _ = require('underscore'); +const utils = require('./utils') require("./styles.css"); angular .module('dbt') .controller('ModelCtrl', ['$scope', '$state', 'project', 'code', '$anchorScroll', '$location', function($scope, $state, projectService, codeService, $anchorScroll, $location) { + + function getReferences(project, macro) { + var references = _.filter(project.nodes, function(node) { + if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { + if (_.contains(node.depends_on.nodes, macro.unique_id)) { + return true; + } + } + return false; + }); + + // TODO : include macros? + return _.groupBy(references, 'resource_type'); + } + + function getParents (project, model) { + var parents = _.filter(project.nodes, function(node) { + if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { + if (_.contains(model.depends_on.nodes, node.unique_id)) { + return true; + } + } + return false; + }); + + return _.groupBy(parents, 'resource_type'); + } $scope.model_uid = $state.params.unique_id; $scope.tab = $state.params.tab; $scope.project = projectService; $scope.codeService = codeService; - $scope.versions = {} $scope.copied = false; @@ -28,7 +56,10 @@ angular $scope.model = {}; projectService.ready(function(project) { - $scope.model = project.nodes[$scope.model_uid]; + var mod = project.nodes[$scope.model_uid]; + $scope.model = mod; + $scope.references = utils.getReferences(project, mod); + $scope.parents = utils.getParents(project, mod); var default_compiled = '\n-- compiled SQL not found for this model\n'; $scope.versions = { diff --git a/src/app/docs/seed.html b/src/app/docs/seed.html index dcf14e299..d95822132 100644 --- a/src/app/docs/seed.html +++ b/src/app/docs/seed.html @@ -36,6 +36,8 @@

  • Details
  • Description
  • Columns
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -67,6 +69,22 @@
    Columns
    +
    +
    +
    +
    Referenced By
    + +
    +
    + +
    +
    +
    +
    Depends On
    + +
    +
    +
    diff --git a/src/app/docs/seed.js b/src/app/docs/seed.js index 641025100..160a0ec29 100644 --- a/src/app/docs/seed.js +++ b/src/app/docs/seed.js @@ -1,6 +1,8 @@ 'use strict'; const angular = require('angular'); +const _ = require('underscore'); +const utils = require('./utils') require("./styles.css"); angular @@ -8,6 +10,32 @@ angular .controller('SeedCtrl', ['$scope', '$state', 'project', 'code', '$transitions', '$anchorScroll', '$location', function($scope, $state, projectService, codeService, $transitions, $anchorScroll, $location) { + function getReferences(project, macro) { + var references = _.filter(project.nodes, function(node) { + if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { + if (_.contains(node.depends_on.nodes, macro.unique_id)) { + return true; + } + } + return false; + }); + + // TODO : include macros? + return _.groupBy(references, 'resource_type'); + } + + function getParents (project, model) { + var parents = _.filter(project.nodes, function(node) { + if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { + if (_.contains(model.depends_on.nodes, node.unique_id)) { + return true; + } + } + return false; + }); + + return _.groupBy(parents, 'resource_type'); + } $scope.model_uid = $state.params.unique_id; $scope.tab = $state.params.tab; $scope.project = projectService; @@ -17,7 +45,10 @@ angular $scope.model = {}; projectService.ready(function(project) { - $scope.model = project.nodes[$scope.model_uid]; + var mod = project.nodes[$scope.model_uid]; + $scope.model = mod; + $scope.references = utils.getReferences(project, mod); + $scope.parents = utils.getParents(project, mod); $scope.versions = { 'Example SQL': codeService.generateSourceSQL($scope.model) diff --git a/src/app/docs/snapshot.html b/src/app/docs/snapshot.html index 5aad93b20..f00db159c 100644 --- a/src/app/docs/snapshot.html +++ b/src/app/docs/snapshot.html @@ -36,6 +36,8 @@

  • Details
  • Description
  • Columns
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -68,6 +70,22 @@
    Columns
    +
    +
    +
    +
    Referenced By
    + +
    +
    + +
    +
    +
    +
    Depends On
    + +
    +
    +
    diff --git a/src/app/docs/snapshot.js b/src/app/docs/snapshot.js index f53bbe38f..1aa78d199 100644 --- a/src/app/docs/snapshot.js +++ b/src/app/docs/snapshot.js @@ -1,6 +1,8 @@ 'use strict'; const angular = require('angular'); +const _ = require('underscore'); +const utils = require('./utils') require("./styles.css"); angular @@ -8,6 +10,33 @@ angular .controller('SnapshotCtrl', ['$scope', '$state', 'project', 'code', '$anchorScroll', '$location', function($scope, $state, projectService, codeService, $anchorScroll, $location) { + function getReferences(project, macro) { + var references = _.filter(project.nodes, function(node) { + if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { + if (_.contains(node.depends_on.nodes, macro.unique_id)) { + return true; + } + } + return false; + }); + + // TODO : include macros? + return _.groupBy(references, 'resource_type'); + } + + function getParents (project, model) { + var parents = _.filter(project.nodes, function(node) { + if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { + if (_.contains(model.depends_on.nodes, node.unique_id)) { + return true; + } + } + return false; + }); + + return _.groupBy(parents, 'resource_type'); + } + $scope.model_uid = $state.params.unique_id; $scope.tab = $state.params.tab; $scope.project = projectService; @@ -17,7 +46,10 @@ angular $scope.model = {}; projectService.ready(function(project) { - $scope.model = project.nodes[$scope.model_uid]; + var mod = project.nodes[$scope.model_uid]; + $scope.model = mod; + $scope.references = utils.getReferences(project, mod); + $scope.parents = utils.getParents(project, mod); var default_compiled = "Compiled SQL is not available for this snapshot"; $scope.versions = { diff --git a/src/app/docs/test.html b/src/app/docs/test.html index d11e53261..ee55bf796 100644 --- a/src/app/docs/test.html +++ b/src/app/docs/test.html @@ -28,6 +28,8 @@

    @@ -47,6 +49,22 @@

    Description
    +
    +
    +
    +
    Referenced By
    + +
    +
    + +
    +
    +
    +
    Depends On
    + +
    +
    +
    diff --git a/src/app/docs/test.js b/src/app/docs/test.js index 3bd8f087f..2616d8820 100644 --- a/src/app/docs/test.js +++ b/src/app/docs/test.js @@ -1,6 +1,8 @@ 'use strict'; const angular = require('angular'); +const _ = require('underscore'); +const utils = require('./utils') require("./styles.css"); angular @@ -8,6 +10,33 @@ angular .controller('TestCtrl', ['$scope', '$state', 'project', 'code', '$anchorScroll', '$location', function($scope, $state, projectService, codeService, $anchorScroll, $location) { + function getReferences(project, macro) { + var references = _.filter(project.nodes, function(node) { + if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { + if (_.contains(node.depends_on.nodes, macro.unique_id)) { + return true; + } + } + return false; + }); + + // TODO : include macros? + return _.groupBy(references, 'resource_type'); + } + + function getParents (project, model) { + var parents = _.filter(project.nodes, function(node) { + if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { + if (_.contains(model.depends_on.nodes, node.unique_id)) { + return true; + } + } + return false; + }); + + return _.groupBy(parents, 'resource_type'); + } + $scope.model_uid = $state.params.unique_id; $scope.tab = $state.params.tab; $scope.project = projectService; @@ -17,7 +46,10 @@ angular $scope.model = {}; projectService.ready(function(project) { - $scope.model = project.nodes[$scope.model_uid]; + var mod = project.nodes[$scope.model_uid]; + $scope.model = mod; + $scope.references = utils.getReferences(project, mod); + $scope.parents = utils.getParents(project, mod); var default_compiled = '\n-- compiled SQL not found for this model\n'; $scope.versions = { diff --git a/src/app/docs/utils.js b/src/app/docs/utils.js new file mode 100644 index 000000000..348be4122 --- /dev/null +++ b/src/app/docs/utils.js @@ -0,0 +1,37 @@ +const _ = require('underscore'); +export function getReferences(project, model) { + var references = _.filter(project.nodes, function(node) { + if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { + if (_.contains(node.depends_on.nodes, model.unique_id)) { + return true; + } + } + return false; + }); + + // TODO : include macros? + return _.groupBy(references, 'resource_type'); +} + +export function getParents (project, model) { + var parents = _.filter(project.nodes, function(node) { + if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { + if (_.contains(model.depends_on.nodes, node.unique_id)) { + return true; + } + } + return false; + }); + + var macroParents = _.filter(project.macros, function(macro) { + if (model.depends_on && model.depends_on.macros && model.depends_on.macros.length) { + if (_.contains(model.depends_on.macros, macro.unique_id)) { + return true; + } + } + return false; + }); + + + return _.groupBy(parents.concat(macroParents), 'resource_type'); +} \ No newline at end of file diff --git a/src/app/overview/overview.html b/src/app/overview/overview.html index 240da6d4a..343c20cfc 100644 --- a/src/app/overview/overview.html +++ b/src/app/overview/overview.html @@ -1,4 +1,5 @@
    +

    H

    From a413f1a920926ce1ca6455e1170bc678b1bfd88f Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Tue, 23 Jun 2020 13:44:16 -0500 Subject: [PATCH 02/13] Overview header fix and removal of getParents and getReferences in all docs files --- src/app/docs/analysis.js | 26 -------------------------- src/app/docs/model.js | 27 --------------------------- src/app/docs/seed.js | 26 -------------------------- src/app/docs/snapshot.js | 27 --------------------------- src/app/docs/test.js | 27 --------------------------- src/app/overview/overview.html | 2 +- 6 files changed, 1 insertion(+), 134 deletions(-) diff --git a/src/app/docs/analysis.js b/src/app/docs/analysis.js index f9290f475..84ae22ef9 100644 --- a/src/app/docs/analysis.js +++ b/src/app/docs/analysis.js @@ -10,32 +10,6 @@ angular .controller('AnalysisCtrl', ['$scope', '$state', 'project', 'code', '$transitions', '$anchorScroll', '$location', function($scope, $state, projectService, codeService, $transitions, $anchorScroll, $location) { - function getReferences(project, macro) { - var references = _.filter(project.nodes, function(node) { - if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { - if (_.contains(node.depends_on.nodes, macro.unique_id)) { - return true; - } - } - return false; - }); - - // TODO : include macros? - return _.groupBy(references, 'resource_type'); - } - - function getParents (project, model) { - var parents = _.filter(project.nodes, function(node) { - if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { - if (_.contains(model.depends_on.nodes, node.unique_id)) { - return true; - } - } - return false; - }); - - return _.groupBy(parents, 'resource_type'); - } $scope.model_uid = $state.params.unique_id; $scope.project = projectService; $scope.codeService = codeService; diff --git a/src/app/docs/model.js b/src/app/docs/model.js index 8ec25fc45..d263442d7 100644 --- a/src/app/docs/model.js +++ b/src/app/docs/model.js @@ -9,33 +9,6 @@ angular .module('dbt') .controller('ModelCtrl', ['$scope', '$state', 'project', 'code', '$anchorScroll', '$location', function($scope, $state, projectService, codeService, $anchorScroll, $location) { - - function getReferences(project, macro) { - var references = _.filter(project.nodes, function(node) { - if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { - if (_.contains(node.depends_on.nodes, macro.unique_id)) { - return true; - } - } - return false; - }); - - // TODO : include macros? - return _.groupBy(references, 'resource_type'); - } - - function getParents (project, model) { - var parents = _.filter(project.nodes, function(node) { - if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { - if (_.contains(model.depends_on.nodes, node.unique_id)) { - return true; - } - } - return false; - }); - - return _.groupBy(parents, 'resource_type'); - } $scope.model_uid = $state.params.unique_id; $scope.tab = $state.params.tab; diff --git a/src/app/docs/seed.js b/src/app/docs/seed.js index 160a0ec29..473f0b2f3 100644 --- a/src/app/docs/seed.js +++ b/src/app/docs/seed.js @@ -10,32 +10,6 @@ angular .controller('SeedCtrl', ['$scope', '$state', 'project', 'code', '$transitions', '$anchorScroll', '$location', function($scope, $state, projectService, codeService, $transitions, $anchorScroll, $location) { - function getReferences(project, macro) { - var references = _.filter(project.nodes, function(node) { - if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { - if (_.contains(node.depends_on.nodes, macro.unique_id)) { - return true; - } - } - return false; - }); - - // TODO : include macros? - return _.groupBy(references, 'resource_type'); - } - - function getParents (project, model) { - var parents = _.filter(project.nodes, function(node) { - if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { - if (_.contains(model.depends_on.nodes, node.unique_id)) { - return true; - } - } - return false; - }); - - return _.groupBy(parents, 'resource_type'); - } $scope.model_uid = $state.params.unique_id; $scope.tab = $state.params.tab; $scope.project = projectService; diff --git a/src/app/docs/snapshot.js b/src/app/docs/snapshot.js index 1aa78d199..8403f710a 100644 --- a/src/app/docs/snapshot.js +++ b/src/app/docs/snapshot.js @@ -10,33 +10,6 @@ angular .controller('SnapshotCtrl', ['$scope', '$state', 'project', 'code', '$anchorScroll', '$location', function($scope, $state, projectService, codeService, $anchorScroll, $location) { - function getReferences(project, macro) { - var references = _.filter(project.nodes, function(node) { - if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { - if (_.contains(node.depends_on.nodes, macro.unique_id)) { - return true; - } - } - return false; - }); - - // TODO : include macros? - return _.groupBy(references, 'resource_type'); - } - - function getParents (project, model) { - var parents = _.filter(project.nodes, function(node) { - if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { - if (_.contains(model.depends_on.nodes, node.unique_id)) { - return true; - } - } - return false; - }); - - return _.groupBy(parents, 'resource_type'); - } - $scope.model_uid = $state.params.unique_id; $scope.tab = $state.params.tab; $scope.project = projectService; diff --git a/src/app/docs/test.js b/src/app/docs/test.js index 2616d8820..1ab4403d2 100644 --- a/src/app/docs/test.js +++ b/src/app/docs/test.js @@ -10,33 +10,6 @@ angular .controller('TestCtrl', ['$scope', '$state', 'project', 'code', '$anchorScroll', '$location', function($scope, $state, projectService, codeService, $anchorScroll, $location) { - function getReferences(project, macro) { - var references = _.filter(project.nodes, function(node) { - if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { - if (_.contains(node.depends_on.nodes, macro.unique_id)) { - return true; - } - } - return false; - }); - - // TODO : include macros? - return _.groupBy(references, 'resource_type'); - } - - function getParents (project, model) { - var parents = _.filter(project.nodes, function(node) { - if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { - if (_.contains(model.depends_on.nodes, node.unique_id)) { - return true; - } - } - return false; - }); - - return _.groupBy(parents, 'resource_type'); - } - $scope.model_uid = $state.params.unique_id; $scope.tab = $state.params.tab; $scope.project = projectService; diff --git a/src/app/overview/overview.html b/src/app/overview/overview.html index 343c20cfc..df08d795a 100644 --- a/src/app/overview/overview.html +++ b/src/app/overview/overview.html @@ -1,5 +1,5 @@
    -

    H

    +

    Welcome to DBT!

    From 1a282b95f756498abfd8727b110c35fa86948af2 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Tue, 23 Jun 2020 13:57:13 -0500 Subject: [PATCH 03/13] Deleted data/manifest.json --- data/manifest.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 data/manifest.json diff --git a/data/manifest.json b/data/manifest.json deleted file mode 100644 index 5ee91a66c..000000000 --- a/data/manifest.json +++ /dev/null @@ -1 +0,0 @@ -{"nodes":{"model.jaffle_shop.stg_customers":{"raw_sql":"with 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('customer_snapshot') }}\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","staging","stg_customers"],"unique_id":"model.jaffle_shop.stg_customers","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"staging/stg_customers.sql","original_file_path":"models/staging/stg_customers.sql","name":"stg_customers","resource_type":"model","alias":"stg_customers","config":{"enabled":true,"materialized":"view","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":["staging","hourly"],"full_refresh":null},"tags":["staging","hourly"],"refs":[["customer_snapshot"]],"sources":[],"depends_on":{"macros":[],"nodes":["snapshot.jaffle_shop.customer_snapshot"]},"description":"","columns":{"customer_id":{"name":"customer_id","description":"","meta":{},"data_type":null,"tags":[]}},"meta":{},"docs":{"show":true},"patch_path":"models/staging/schema.yml","build_path":"target/compiled/jaffle_shop/models/staging/stg_customers.sql","compiled":true,"compiled_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.customer_snapshot\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.customer_snapshot\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed"},"model.jaffle_shop.stg_payments":{"raw_sql":"with 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 {{ source('seeds', 'raw_payments') }}\n\n),\n\nrenamed 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 * from renamed","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","staging","stg_payments"],"unique_id":"model.jaffle_shop.stg_payments","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"staging/stg_payments.sql","original_file_path":"models/staging/stg_payments.sql","name":"stg_payments","resource_type":"model","alias":"stg_payments","config":{"enabled":true,"materialized":"view","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":["staging","hourly"],"full_refresh":null},"tags":["staging","hourly"],"refs":[],"sources":[["seeds","raw_payments"]],"depends_on":{"macros":[],"nodes":["source.jaffle_shop.seeds.raw_payments"]},"description":"","columns":{"payment_id":{"name":"payment_id","description":"","meta":{},"data_type":null,"tags":[]},"payment_method":{"name":"payment_method","description":"","meta":{},"data_type":null,"tags":[]}},"meta":{},"docs":{"show":true},"patch_path":"models/staging/schema.yml","build_path":"target/compiled/jaffle_shop/models/staging/stg_payments.sql","compiled":true,"compiled_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.raw_payments\n\n),\n\nrenamed 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 * from renamed","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.raw_payments\n\n),\n\nrenamed 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 * from renamed"},"model.jaffle_shop.stg_orders":{"raw_sql":"with 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 {{ source('seeds', 'raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n from source\n\n)\n\nselect * from renamed","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","staging","stg_orders"],"unique_id":"model.jaffle_shop.stg_orders","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"staging/stg_orders.sql","original_file_path":"models/staging/stg_orders.sql","name":"stg_orders","resource_type":"model","alias":"stg_orders","config":{"enabled":true,"materialized":"view","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":["staging","hourly"],"full_refresh":null},"tags":["staging","hourly"],"refs":[],"sources":[["seeds","raw_orders"]],"depends_on":{"macros":[],"nodes":["source.jaffle_shop.seeds.raw_orders"]},"description":"","columns":{"order_id":{"name":"order_id","description":"","meta":{},"data_type":null,"tags":[]},"status":{"name":"status","description":"","meta":{},"data_type":null,"tags":[]}},"meta":{},"docs":{"show":true},"patch_path":"models/staging/schema.yml","build_path":"target/compiled/jaffle_shop/models/staging/stg_orders.sql","compiled":true,"compiled_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.raw_orders\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n from source\n\n)\n\nselect * from renamed","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with source as (\n select * from LOCAL_MALLEN.DBT_DEMO.raw_orders\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n from source\n\n)\n\nselect * from renamed"},"model.jaffle_shop.dim_customers":{"raw_sql":"with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\ncustomer_orders as (\n\n select * from {{ ref('customer_orders') }}\n\n),\n\ncustomer_payments as (\n\n select * from {{ ref('customer_payments') }}\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","marts","core","dim_customers"],"unique_id":"model.jaffle_shop.dim_customers","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/dim_customers.sql","original_file_path":"models/marts/core/dim_customers.sql","name":"dim_customers","resource_type":"model","alias":"dim_customers","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["stg_customers"],["customer_orders"],["customer_payments"]],"sources":[],"depends_on":{"macros":[],"nodes":["model.jaffle_shop.stg_customers","model.jaffle_shop.customer_orders","model.jaffle_shop.customer_payments"]},"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":null,"tags":[]},"first_name":{"name":"first_name","description":"Customer's first name. PII.","meta":{},"data_type":null,"tags":[]},"last_name":{"name":"last_name","description":"Customer's last name. PII.","meta":{},"data_type":null,"tags":[]},"email":{"name":"email","description":"Customer's email address. PII.","meta":{},"data_type":null,"tags":[]},"first_order":{"name":"first_order","description":"Date (UTC) of a customer's first order","meta":{},"data_type":null,"tags":[]},"most_recent_order":{"name":"most_recent_order","description":"Date (UTC) of a customer's most recent order","meta":{},"data_type":null,"tags":[]},"number_of_orders":{"name":"number_of_orders","description":"Count of the number of orders a customer has placed","meta":{},"data_type":null,"tags":[]},"total_order_amount":{"name":"total_order_amount","description":"Total value (AUD) of a customer's orders","meta":{},"data_type":null,"tags":[]}},"meta":{},"docs":{"show":true},"patch_path":"models/marts/core/schema.yml","build_path":"target/compiled/jaffle_shop/models/marts/core/dim_customers.sql","compiled":true,"compiled_sql":"with customers as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_customers\n\n),\n\ncustomer_orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.customer_orders\n\n),\n\ncustomer_payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.customer_payments\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with customers as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_customers\n\n),\n\ncustomer_orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.customer_orders\n\n),\n\ncustomer_payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.customer_payments\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final"},"model.jaffle_shop.fct_orders":{"raw_sql":"with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\norder_payments as (\n\n select * from {{ ref('order_payments') }}\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","marts","core","fct_orders"],"unique_id":"model.jaffle_shop.fct_orders","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/fct_orders.sql","original_file_path":"models/marts/core/fct_orders.sql","name":"fct_orders","resource_type":"model","alias":"fct_orders","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["stg_orders"],["order_payments"]],"sources":[],"depends_on":{"macros":["macro.jaffle_shop.payment_methods"],"nodes":["model.jaffle_shop.stg_orders","model.jaffle_shop.order_payments"]},"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":null,"tags":[]},"customer_id":{"name":"customer_id","description":"Foreign key to the customers table","meta":{},"data_type":null,"tags":[]},"order_date":{"name":"order_date","description":"Date (UTC) that the order was placed","meta":{},"data_type":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":null,"tags":[]},"amount":{"name":"amount","description":"Total amount (AUD) of the order","meta":{},"data_type":null,"tags":[]},"credit_card_amount":{"name":"credit_card_amount","description":"Amount of the order (AUD) paid for by credit card","meta":{},"data_type":null,"tags":[]},"coupon_amount":{"name":"coupon_amount","description":"Amount of the order (AUD) paid for by coupon","meta":{},"data_type":null,"tags":[]},"bank_transfer_amount":{"name":"bank_transfer_amount","description":"Amount of the order (AUD) paid for by bank transfer","meta":{},"data_type":null,"tags":[]},"gift_card_amount":{"name":"gift_card_amount","description":"Amount of the order (AUD) paid for by gift card","meta":{},"data_type":null,"tags":[]}},"meta":{},"docs":{"show":true},"patch_path":"models/marts/core/schema.yml","build_path":"target/compiled/jaffle_shop/models/marts/core/fct_orders.sql","compiled":true,"compiled_sql":"with orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\norder_payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.order_payments\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\norder_payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.order_payments\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final"},"model.jaffle_shop.order_payments":{"raw_sql":"with payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\nfinal as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods() -%}\n sum(case when payment_method = '{{payment_method}}' then amount else 0 end) as {{payment_method}}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","marts","core","intermediate","order_payments"],"unique_id":"model.jaffle_shop.order_payments","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/intermediate/order_payments.sql","original_file_path":"models/marts/core/intermediate/order_payments.sql","name":"order_payments","resource_type":"model","alias":"order_payments","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["stg_payments"]],"sources":[],"depends_on":{"macros":["macro.jaffle_shop.payment_methods"],"nodes":["model.jaffle_shop.stg_payments"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/intermediate/order_payments.sql","compiled":true,"compiled_sql":"with payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\nfinal as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\nfinal as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final"},"model.jaffle_shop.customer_payments":{"raw_sql":"with payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","marts","core","intermediate","customer_payments"],"unique_id":"model.jaffle_shop.customer_payments","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/intermediate/customer_payments.sql","original_file_path":"models/marts/core/intermediate/customer_payments.sql","name":"customer_payments","resource_type":"model","alias":"customer_payments","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["stg_payments"],["stg_orders"]],"sources":[],"depends_on":{"macros":[],"nodes":["model.jaffle_shop.stg_payments","model.jaffle_shop.stg_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/intermediate/customer_payments.sql","compiled":true,"compiled_sql":"with payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\norders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with payments as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\norders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final"},"model.jaffle_shop.customer_orders":{"raw_sql":"with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","marts","core","intermediate","customer_orders"],"unique_id":"model.jaffle_shop.customer_orders","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/intermediate/customer_orders.sql","original_file_path":"models/marts/core/intermediate/customer_orders.sql","name":"customer_orders","resource_type":"model","alias":"customer_orders","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["stg_orders"]],"sources":[],"depends_on":{"macros":[],"nodes":["model.jaffle_shop.stg_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/intermediate/customer_orders.sql","compiled":true,"compiled_sql":"with orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with orders as (\n\n select * from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final"},"snapshot.jaffle_shop.customer_snapshot":{"raw_sql":"\n\n {{-\n config(\n strategy='check',\n unique_key='id',\n target_schema=this.schema,\n check_cols=[\n 'first_name',\n 'last_name',\n 'email',\n ],\n )\n -}}\n\n select * from {{ source('seeds', 'raw_customers') }}\n\n","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","customer_snapshot","customer_snapshot"],"unique_id":"snapshot.jaffle_shop.customer_snapshot","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"customer_snapshot.sql","original_file_path":"snapshots/customer_snapshot.sql","name":"customer_snapshot","resource_type":"snapshot","alias":"customer_snapshot","config":{"enabled":true,"materialized":"snapshot","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"unique_key":"id","target_schema":"DBT_DEMO","strategy":"check","check_cols":["first_name","last_name","email"]},"tags":[],"refs":[],"sources":[["seeds","raw_customers"]],"depends_on":{"macros":[],"nodes":["source.jaffle_shop.seeds.raw_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":null,"compiled":true,"compiled_sql":"select * from LOCAL_MALLEN.DBT_DEMO.raw_customers\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"select * from LOCAL_MALLEN.DBT_DEMO.raw_customers\n"},"analysis.jaffle_shop.orders_with_customers":{"raw_sql":"with orders as (\n select * from {{ ref('fct_orders') }}\n),\ncustomers as (\n select * from {{ ref('dim_customers') }}\n),\nfinal as (\n select *\n from orders\n left join customers using (customer_id)\n)","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","analysis","orders_with_customers"],"unique_id":"analysis.jaffle_shop.orders_with_customers","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"analysis/orders_with_customers.sql","original_file_path":"analysis/orders_with_customers.sql","name":"orders_with_customers","resource_type":"analysis","alias":"orders_with_customers","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null},"tags":[],"refs":[["fct_orders"],["dim_customers"]],"sources":[],"depends_on":{"macros":[],"nodes":["model.jaffle_shop.fct_orders","model.jaffle_shop.dim_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/analysis/orders_with_customers.sql","compiled":true,"compiled_sql":"with orders as (\n select * from LOCAL_MALLEN.DBT_DEMO.fct_orders\n),\ncustomers as (\n select * from LOCAL_MALLEN.DBT_DEMO.dim_customers\n),\nfinal as (\n select *\n from orders\n left join customers using (customer_id)\n)","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"with orders as (\n select * from LOCAL_MALLEN.DBT_DEMO.fct_orders\n),\ncustomers as (\n select * from LOCAL_MALLEN.DBT_DEMO.dim_customers\n),\nfinal as (\n select *\n from orders\n left join customers using (customer_id)\n)"},"seed.jaffle_shop.raw_customers":{"raw_sql":"","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","raw_customers"],"unique_id":"seed.jaffle_shop.raw_customers","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"raw_customers.csv","original_file_path":"data/raw_customers.csv","name":"raw_customers","resource_type":"seed","alias":"raw_customers","config":{"enabled":true,"materialized":"seed","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"quote_columns":null},"tags":[],"refs":[],"sources":[],"depends_on":{"macros":[],"nodes":[]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":null,"compiled":true,"compiled_sql":"","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":""},"seed.jaffle_shop.raw_orders":{"raw_sql":"","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","raw_orders"],"unique_id":"seed.jaffle_shop.raw_orders","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"raw_orders.csv","original_file_path":"data/raw_orders.csv","name":"raw_orders","resource_type":"seed","alias":"raw_orders","config":{"enabled":true,"materialized":"seed","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"quote_columns":null},"tags":[],"refs":[],"sources":[],"depends_on":{"macros":[],"nodes":[]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":null,"compiled":true,"compiled_sql":"","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":""},"seed.jaffle_shop.raw_payments":{"raw_sql":"","database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","raw_payments"],"unique_id":"seed.jaffle_shop.raw_payments","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"raw_payments.csv","original_file_path":"data/raw_payments.csv","name":"raw_payments","resource_type":"seed","alias":"raw_payments","config":{"enabled":true,"materialized":"seed","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"quote_columns":null},"tags":[],"refs":[],"sources":[],"depends_on":{"macros":[],"nodes":[]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":null,"compiled":true,"compiled_sql":"","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":""},"test.jaffle_shop.unique_stg_customers_customer_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"unique","kwargs":{"column_name":"customer_id","model":"{{ ref('stg_customers') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","unique_stg_customers_customer_id"],"unique_id":"test.jaffle_shop.unique_stg_customers_customer_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/unique_stg_customers_customer_id.sql","original_file_path":"models/staging/schema.yml","name":"unique_stg_customers_customer_id","resource_type":"test","alias":"unique_stg_customers_customer_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_customers"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_unique"],"nodes":["model.jaffle_shop.stg_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_customers_customer_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n customer_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_customers\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n customer_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_customers\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n","column_name":"customer_id"},"test.jaffle_shop.not_null_stg_customers_customer_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"customer_id","model":"{{ ref('stg_customers') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_stg_customers_customer_id"],"unique_id":"test.jaffle_shop.not_null_stg_customers_customer_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_stg_customers_customer_id.sql","original_file_path":"models/staging/schema.yml","name":"not_null_stg_customers_customer_id","resource_type":"test","alias":"not_null_stg_customers_customer_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_customers"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.stg_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_customers_customer_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_customers\nwhere customer_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_customers\nwhere customer_id is null\n\n","column_name":"customer_id"},"test.jaffle_shop.unique_stg_orders_order_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"unique","kwargs":{"column_name":"order_id","model":"{{ ref('stg_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","unique_stg_orders_order_id"],"unique_id":"test.jaffle_shop.unique_stg_orders_order_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/unique_stg_orders_order_id.sql","original_file_path":"models/staging/schema.yml","name":"unique_stg_orders_order_id","resource_type":"test","alias":"unique_stg_orders_order_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_unique"],"nodes":["model.jaffle_shop.stg_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_orders_order_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_orders\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_orders\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n","column_name":"order_id"},"test.jaffle_shop.not_null_stg_orders_order_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"order_id","model":"{{ ref('stg_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_stg_orders_order_id"],"unique_id":"test.jaffle_shop.not_null_stg_orders_order_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_stg_orders_order_id.sql","original_file_path":"models/staging/schema.yml","name":"not_null_stg_orders_order_id","resource_type":"test","alias":"not_null_stg_orders_order_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.stg_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_orders_order_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_orders\nwhere order_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_orders\nwhere order_id is null\n\n","column_name":"order_id"},"test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_accepted_values(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"accepted_values","kwargs":{"values":["placed","shipped","completed","return_pending","returned"],"column_name":"status","model":"{{ ref('stg_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"],"unique_id":"test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/accepted_values_stg_orders_758238c28b8980ea7fe9d60a8d851ea8.sql","original_file_path":"models/staging/schema.yml","name":"accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned","resource_type":"test","alias":"accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_accepted_values"],"nodes":["model.jaffle_shop.stg_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/accepted_values_stg_orders_758238c28b8980ea7fe9d60a8d851ea8.sql","compiled":true,"compiled_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.stg_orders\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","column_name":"status"},"test.jaffle_shop.unique_stg_payments_payment_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"unique","kwargs":{"column_name":"payment_id","model":"{{ ref('stg_payments') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","unique_stg_payments_payment_id"],"unique_id":"test.jaffle_shop.unique_stg_payments_payment_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/unique_stg_payments_payment_id.sql","original_file_path":"models/staging/schema.yml","name":"unique_stg_payments_payment_id","resource_type":"test","alias":"unique_stg_payments_payment_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_payments"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_unique"],"nodes":["model.jaffle_shop.stg_payments"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_payments_payment_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n payment_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_payments\n where payment_id is not null\n group by payment_id\n having count(*) > 1\n\n) validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n payment_id\n\n from LOCAL_MALLEN.DBT_DEMO.stg_payments\n where payment_id is not null\n group by payment_id\n having count(*) > 1\n\n) validation_errors\n\n","column_name":"payment_id"},"test.jaffle_shop.not_null_stg_payments_payment_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"payment_id","model":"{{ ref('stg_payments') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_stg_payments_payment_id"],"unique_id":"test.jaffle_shop.not_null_stg_payments_payment_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_stg_payments_payment_id.sql","original_file_path":"models/staging/schema.yml","name":"not_null_stg_payments_payment_id","resource_type":"test","alias":"not_null_stg_payments_payment_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_payments"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.stg_payments"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_payments_payment_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_payments\nwhere payment_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.stg_payments\nwhere payment_id is null\n\n","column_name":"payment_id"},"test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_accepted_values(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"accepted_values","kwargs":{"values":["credit_card","coupon","bank_transfer","gift_card"],"column_name":"payment_method","model":"{{ ref('stg_payments') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"],"unique_id":"test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/accepted_values_stg_payments_944011baab727320a6b119d4d81589ae.sql","original_file_path":"models/staging/schema.yml","name":"accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card","resource_type":"test","alias":"accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["stg_payments"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_accepted_values"],"nodes":["model.jaffle_shop.stg_payments"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/accepted_values_stg_payments_944011baab727320a6b119d4d81589ae.sql","compiled":true,"compiled_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n payment_method as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n payment_method as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.stg_payments\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","column_name":"payment_method"},"test.jaffle_shop.unique_dim_customers_customer_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"unique","kwargs":{"column_name":"customer_id","model":"{{ ref('dim_customers') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","unique_dim_customers_customer_id"],"unique_id":"test.jaffle_shop.unique_dim_customers_customer_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/unique_dim_customers_customer_id.sql","original_file_path":"models/marts/core/schema.yml","name":"unique_dim_customers_customer_id","resource_type":"test","alias":"unique_dim_customers_customer_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["dim_customers"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_unique"],"nodes":["model.jaffle_shop.dim_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/unique_dim_customers_customer_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n customer_id\n\n from LOCAL_MALLEN.DBT_DEMO.dim_customers\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n customer_id\n\n from LOCAL_MALLEN.DBT_DEMO.dim_customers\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n","column_name":"customer_id"},"test.jaffle_shop.not_null_dim_customers_customer_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"customer_id","model":"{{ ref('dim_customers') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_dim_customers_customer_id"],"unique_id":"test.jaffle_shop.not_null_dim_customers_customer_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_dim_customers_customer_id.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_dim_customers_customer_id","resource_type":"test","alias":"not_null_dim_customers_customer_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["dim_customers"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.dim_customers"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_dim_customers_customer_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.dim_customers\nwhere customer_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.dim_customers\nwhere customer_id is null\n\n","column_name":"customer_id"},"test.jaffle_shop.unique_fct_orders_order_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"unique","kwargs":{"column_name":"order_id","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","unique_fct_orders_order_id"],"unique_id":"test.jaffle_shop.unique_fct_orders_order_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/unique_fct_orders_order_id.sql","original_file_path":"models/marts/core/schema.yml","name":"unique_fct_orders_order_id","resource_type":"test","alias":"unique_fct_orders_order_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_unique"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/unique_fct_orders_order_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from LOCAL_MALLEN.DBT_DEMO.fct_orders\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from LOCAL_MALLEN.DBT_DEMO.fct_orders\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n","column_name":"order_id"},"test.jaffle_shop.not_null_fct_orders_order_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"order_id","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_order_id"],"unique_id":"test.jaffle_shop.not_null_fct_orders_order_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_order_id.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_order_id","resource_type":"test","alias":"not_null_fct_orders_order_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_order_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere order_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere order_id is null\n\n","column_name":"order_id"},"test.jaffle_shop.not_null_fct_orders_customer_id":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"customer_id","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_customer_id"],"unique_id":"test.jaffle_shop.not_null_fct_orders_customer_id","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_customer_id.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_customer_id","resource_type":"test","alias":"not_null_fct_orders_customer_id","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_customer_id.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere customer_id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere customer_id is null\n\n","column_name":"customer_id"},"test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_relationships(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"relationships","kwargs":{"to":"ref('dim_customers')","field":"customer_id","column_name":"customer_id","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","relationships_fct_orders_customer_id__customer_id__ref_dim_customers_"],"unique_id":"test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/relationships_fct_orders_535c445ac9111d4713c286f097da3132.sql","original_file_path":"models/marts/core/schema.yml","name":"relationships_fct_orders_customer_id__customer_id__ref_dim_customers_","resource_type":"test","alias":"relationships_fct_orders_customer_id__customer_id__ref_dim_customers_","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["dim_customers"],["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_relationships"],"nodes":["model.jaffle_shop.dim_customers","model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/relationships_fct_orders_535c445ac9111d4713c286f097da3132.sql","compiled":true,"compiled_sql":"\n\n\n\n\nselect count(*) as validation_errors\nfrom (\n select customer_id as id from LOCAL_MALLEN.DBT_DEMO.fct_orders\n) as child\nleft join (\n select customer_id as id from LOCAL_MALLEN.DBT_DEMO.dim_customers\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\n\nselect count(*) as validation_errors\nfrom (\n select customer_id as id from LOCAL_MALLEN.DBT_DEMO.fct_orders\n) as child\nleft join (\n select customer_id as id from LOCAL_MALLEN.DBT_DEMO.dim_customers\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n","column_name":"customer_id"},"test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_accepted_values(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"accepted_values","kwargs":{"values":["placed","shipped","completed","return_pending","returned"],"column_name":"status","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned"],"unique_id":"test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/accepted_values_fct_orders_758238c28b8980ea7fe9d60a8d851ea8.sql","original_file_path":"models/marts/core/schema.yml","name":"accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned","resource_type":"test","alias":"accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_accepted_values"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/accepted_values_fct_orders_758238c28b8980ea7fe9d60a8d851ea8.sql","compiled":true,"compiled_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.fct_orders\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from LOCAL_MALLEN.DBT_DEMO.fct_orders\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n","column_name":"status"},"test.jaffle_shop.not_null_fct_orders_amount":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"amount","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_amount"],"unique_id":"test.jaffle_shop.not_null_fct_orders_amount","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_amount.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_amount","resource_type":"test","alias":"not_null_fct_orders_amount","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_amount.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere amount is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere amount is null\n\n","column_name":"amount"},"test.jaffle_shop.not_null_fct_orders_credit_card_amount":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"credit_card_amount","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_credit_card_amount"],"unique_id":"test.jaffle_shop.not_null_fct_orders_credit_card_amount","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_credit_card_amount.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_credit_card_amount","resource_type":"test","alias":"not_null_fct_orders_credit_card_amount","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_credit_card_amount.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere credit_card_amount is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere credit_card_amount is null\n\n","column_name":"credit_card_amount"},"test.jaffle_shop.not_null_fct_orders_coupon_amount":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"coupon_amount","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_coupon_amount"],"unique_id":"test.jaffle_shop.not_null_fct_orders_coupon_amount","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_coupon_amount.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_coupon_amount","resource_type":"test","alias":"not_null_fct_orders_coupon_amount","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_coupon_amount.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere coupon_amount is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere coupon_amount is null\n\n","column_name":"coupon_amount"},"test.jaffle_shop.not_null_fct_orders_bank_transfer_amount":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"bank_transfer_amount","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_bank_transfer_amount"],"unique_id":"test.jaffle_shop.not_null_fct_orders_bank_transfer_amount","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_bank_transfer_amount.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_bank_transfer_amount","resource_type":"test","alias":"not_null_fct_orders_bank_transfer_amount","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_bank_transfer_amount.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere bank_transfer_amount is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere bank_transfer_amount is null\n\n","column_name":"bank_transfer_amount"},"test.jaffle_shop.not_null_fct_orders_gift_card_amount":{"raw_sql":"{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}","test_metadata":{"namespace":null,"name":"not_null","kwargs":{"column_name":"gift_card_amount","model":"{{ ref('fct_orders') }}"}},"database":"LOCAL_MALLEN","schema":"DBT_DEMO","fqn":["jaffle_shop","schema_test","not_null_fct_orders_gift_card_amount"],"unique_id":"test.jaffle_shop.not_null_fct_orders_gift_card_amount","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"schema_test/not_null_fct_orders_gift_card_amount.sql","original_file_path":"models/marts/core/schema.yml","name":"not_null_fct_orders_gift_card_amount","resource_type":"test","alias":"not_null_fct_orders_gift_card_amount","config":{"enabled":true,"materialized":"table","persist_docs":{},"post-hook":[],"pre-hook":[],"vars":{},"quoting":{},"column_types":{},"tags":[],"full_refresh":null,"severity":"ERROR"},"tags":["schema"],"refs":[["fct_orders"]],"sources":[],"depends_on":{"macros":["macro.dbt.test_not_null"],"nodes":["model.jaffle_shop.fct_orders"]},"description":"","columns":{},"meta":{},"docs":{"show":true},"patch_path":null,"build_path":"target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_gift_card_amount.sql","compiled":true,"compiled_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere gift_card_amount is null\n\n","extra_ctes_injected":true,"extra_ctes":[],"injected_sql":"\n\n\n\nselect count(*) as validation_errors\nfrom LOCAL_MALLEN.DBT_DEMO.fct_orders\nwhere gift_card_amount is null\n\n","column_name":"gift_card_amount"}},"sources":{"source.jaffle_shop.seeds.raw_customers":{"fqn":["jaffle_shop","staging","seeds","raw_customers"],"database":"LOCAL_MALLEN","schema":"DBT_DEMO","unique_id":"source.jaffle_shop.seeds.raw_customers","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"models/staging/sources.yml","original_file_path":"models/staging/sources.yml","name":"raw_customers","source_name":"seeds","source_description":"","loader":"","identifier":"raw_customers","resource_type":"source","quoting":{"database":null,"schema":null,"identifier":null,"column":null},"loaded_at_field":null,"freshness":{"warn_after":null,"error_after":null,"filter":null},"external":null,"description":"","columns":{},"meta":{},"source_meta":{},"tags":[],"config":{"enabled":true},"patch_path":null},"source.jaffle_shop.seeds.raw_orders":{"fqn":["jaffle_shop","staging","seeds","raw_orders"],"database":"LOCAL_MALLEN","schema":"DBT_DEMO","unique_id":"source.jaffle_shop.seeds.raw_orders","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"models/staging/sources.yml","original_file_path":"models/staging/sources.yml","name":"raw_orders","source_name":"seeds","source_description":"","loader":"","identifier":"raw_orders","resource_type":"source","quoting":{"database":null,"schema":null,"identifier":null,"column":null},"loaded_at_field":null,"freshness":{"warn_after":null,"error_after":null,"filter":null},"external":null,"description":"","columns":{},"meta":{},"source_meta":{},"tags":[],"config":{"enabled":true},"patch_path":null},"source.jaffle_shop.seeds.raw_payments":{"fqn":["jaffle_shop","staging","seeds","raw_payments"],"database":"LOCAL_MALLEN","schema":"DBT_DEMO","unique_id":"source.jaffle_shop.seeds.raw_payments","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"models/staging/sources.yml","original_file_path":"models/staging/sources.yml","name":"raw_payments","source_name":"seeds","source_description":"","loader":"","identifier":"raw_payments","resource_type":"source","quoting":{"database":null,"schema":null,"identifier":null,"column":null},"loaded_at_field":null,"freshness":{"warn_after":null,"error_after":null,"filter":null},"external":null,"description":"","columns":{},"meta":{},"source_meta":{},"tags":[],"config":{"enabled":true},"patch_path":null}},"macros":{"macro.dbt.statement":{"unique_id":"macro.dbt.statement","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/core.sql","original_file_path":"macros/core.sql","name":"statement","macro_sql":"{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set status, res = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.noop_statement":{"unique_id":"macro.dbt.noop_statement","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/core.sql","original_file_path":"macros/core.sql","name":"noop_statement","macro_sql":"{% macro noop_statement(name=None, status=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_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.run_hooks":{"unique_id":"macro.dbt.run_hooks","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.column_list":{"unique_id":"macro.dbt.column_list","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"column_list","macro_sql":"{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.column_list_for_create_table":{"unique_id":"macro.dbt.column_list_for_create_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"column_list_for_create_table","macro_sql":"{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.make_hook_config":{"unique_id":"macro.dbt.make_hook_config","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"make_hook_config","macro_sql":"{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.before_begin":{"unique_id":"macro.dbt.before_begin","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"before_begin","macro_sql":"{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.in_transaction":{"unique_id":"macro.dbt.in_transaction","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"in_transaction","macro_sql":"{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.after_commit":{"unique_id":"macro.dbt.after_commit","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"after_commit","macro_sql":"{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.drop_relation_if_exists":{"unique_id":"macro.dbt.drop_relation_if_exists","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.load_relation":{"unique_id":"macro.dbt.load_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"load_relation","macro_sql":"{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.should_full_refresh":{"unique_id":"macro.dbt.should_full_refresh","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/helpers.sql","original_file_path":"macros/materializations/helpers.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_merge_sql":{"unique_id":"macro.dbt.snapshot_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot_merge.sql","original_file_path":"macros/materializations/snapshot/snapshot_merge.sql","name":"snapshot_merge_sql","macro_sql":"{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter_macro('snapshot_merge_sql', target, source, insert_cols) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__snapshot_merge_sql":{"unique_id":"macro.dbt.default__snapshot_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot_merge.sql","original_file_path":"macros/materializations/snapshot/snapshot_merge.sql","name":"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 = 'update'\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.strategy_dispatch":{"unique_id":"macro.dbt.strategy_dispatch","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_hash_arguments":{"unique_id":"macro.dbt.snapshot_hash_arguments","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"snapshot_hash_arguments","macro_sql":"{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__snapshot_hash_arguments":{"unique_id":"macro.dbt.default__snapshot_hash_arguments","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_get_time":{"unique_id":"macro.dbt.snapshot_get_time","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"snapshot_get_time","macro_sql":"{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__snapshot_get_time":{"unique_id":"macro.dbt.default__snapshot_get_time","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"default__snapshot_get_time","macro_sql":"{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_timestamp_strategy":{"unique_id":"macro.dbt.snapshot_timestamp_strategy","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"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\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/fishtown-analytics/dbt/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 }) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_string_as_time":{"unique_id":"macro.dbt.snapshot_string_as_time","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"snapshot_string_as_time","macro_sql":"{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__snapshot_string_as_time":{"unique_id":"macro.dbt.default__snapshot_string_as_time","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_check_all_get_existing_columns":{"unique_id":"macro.dbt.snapshot_check_all_get_existing_columns","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"snapshot_check_all_get_existing_columns","macro_sql":"{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_check_strategy":{"unique_id":"macro.dbt.snapshot_check_strategy","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/strategies.sql","original_file_path":"macros/materializations/snapshot/strategies.sql","name":"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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_columns":{"unique_id":"macro.dbt.create_columns","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"create_columns","macro_sql":"{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__create_columns":{"unique_id":"macro.dbt.default__create_columns","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.post_snapshot":{"unique_id":"macro.dbt.post_snapshot","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"post_snapshot","macro_sql":"{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__post_snapshot":{"unique_id":"macro.dbt.default__post_snapshot","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"default__post_snapshot","macro_sql":"{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.snapshot_staging_table":{"unique_id":"macro.dbt.snapshot_staging_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"snapshot_staging_table","macro_sql":"{% macro 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\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 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 snapshotted_data.dbt_valid_to is 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n select * from insertions\n union all\n select * from updates\n\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.build_snapshot_table":{"unique_id":"macro.dbt.build_snapshot_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"build_snapshot_table","macro_sql":"{% macro 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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_or_create_relation":{"unique_id":"macro.dbt.get_or_create_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"get_or_create_relation","macro_sql":"{% macro 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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.build_snapshot_staging_table":{"unique_id":"macro.dbt.build_snapshot_staging_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"build_snapshot_staging_table","macro_sql":"{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_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, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.materialization_snapshot_default":{"unique_id":"macro.dbt.materialization_snapshot_default","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/snapshot/snapshot.sql","original_file_path":"macros/materializations/snapshot/snapshot.sql","name":"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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\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 {% do persist_docs(target_relation, model) %}\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_csv_table":{"unique_id":"macro.dbt.create_csv_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"create_csv_table","macro_sql":"{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.reset_csv_table":{"unique_id":"macro.dbt.reset_csv_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"reset_csv_table","macro_sql":"{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.load_csv_rows":{"unique_id":"macro.dbt.load_csv_rows","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"load_csv_rows","macro_sql":"{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__create_csv_table":{"unique_id":"macro.dbt.default__create_csv_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__reset_csv_table":{"unique_id":"macro.dbt.default__reset_csv_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_seed_column_quoted_csv":{"unique_id":"macro.dbt.get_seed_column_quoted_csv","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.basic_load_csv_rows":{"unique_id":"macro.dbt.basic_load_csv_rows","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"basic_load_csv_rows","macro_sql":"{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__load_csv_rows":{"unique_id":"macro.dbt.default__load_csv_rows","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"default__load_csv_rows","macro_sql":"{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.materialization_seed_default":{"unique_id":"macro.dbt.materialization_seed_default","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/seed/seed.sql","original_file_path":"macros/materializations/seed/seed.sql","name":"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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.incremental_upsert":{"unique_id":"macro.dbt.incremental_upsert","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/incremental/helpers.sql","original_file_path":"macros/materializations/incremental/helpers.sql","name":"incremental_upsert","macro_sql":"{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.materialization_incremental_default":{"unique_id":"macro.dbt.materialization_incremental_default","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/incremental/incremental.sql","original_file_path":"macros/materializations/incremental/incremental.sql","name":"materialization_incremental_default","macro_sql":"{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(this) %}\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 {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or should_full_refresh() %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set backup_identifier = existing_relation.identifier ~ \"__dbt_backup\" %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% do persist_docs(target_relation, model) %}\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_merge_sql":{"unique_id":"macro.dbt.get_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"get_merge_sql","macro_sql":"{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_delete_insert_merge_sql":{"unique_id":"macro.dbt.get_delete_insert_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"get_delete_insert_merge_sql","macro_sql":"{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_insert_overwrite_merge_sql":{"unique_id":"macro.dbt.get_insert_overwrite_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"get_insert_overwrite_merge_sql","macro_sql":"{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter_macro('get_insert_overwrite_merge_sql', target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_merge_sql":{"unique_id":"macro.dbt.default__get_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"default__get_merge_sql","macro_sql":"{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\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 {% if unique_key %}\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 {% 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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_quoted_csv":{"unique_id":"macro.dbt.get_quoted_csv","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"get_quoted_csv","macro_sql":"{% macro get_quoted_csv(column_names) %}\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{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.common_get_delete_insert_merge_sql":{"unique_id":"macro.dbt.common_get_delete_insert_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"common_get_delete_insert_merge_sql","macro_sql":"{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_delete_insert_merge_sql":{"unique_id":"macro.dbt.default__get_delete_insert_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"default__get_delete_insert_merge_sql","macro_sql":"{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_insert_overwrite_merge_sql":{"unique_id":"macro.dbt.default__get_insert_overwrite_merge_sql","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/common/merge.sql","original_file_path":"macros/materializations/common/merge.sql","name":"default__get_insert_overwrite_merge_sql","macro_sql":"{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.materialization_table_default":{"unique_id":"macro.dbt.materialization_table_default","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/table/table.sql","original_file_path":"macros/materializations/table/table.sql","name":"materialization_table_default","macro_sql":"{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\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\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(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 {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_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 {% 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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.materialization_view_default":{"unique_id":"macro.dbt.materialization_view_default","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/view/view.sql","original_file_path":"macros/materializations/view/view.sql","name":"materialization_view_default","macro_sql":"{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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 -%}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.handle_existing_table":{"unique_id":"macro.dbt.handle_existing_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/view/create_or_replace_view.sql","original_file_path":"macros/materializations/view/create_or_replace_view.sql","name":"handle_existing_table","macro_sql":"{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter_macro(\"dbt.handle_existing_table\", full_refresh, old_relation) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__handle_existing_table":{"unique_id":"macro.dbt.default__handle_existing_table","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/view/create_or_replace_view.sql","original_file_path":"macros/materializations/view/create_or_replace_view.sql","name":"default__handle_existing_table","macro_sql":"{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_or_replace_view":{"unique_id":"macro.dbt.create_or_replace_view","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/materializations/view/create_or_replace_view.sql","original_file_path":"macros/materializations/view/create_or_replace_view.sql","name":"create_or_replace_view","macro_sql":"{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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 {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.generate_alias_name":{"unique_id":"macro.dbt.generate_alias_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/get_custom_alias.sql","original_file_path":"macros/etc/get_custom_alias.sql","name":"generate_alias_name","macro_sql":"{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.run_query":{"unique_id":"macro.dbt.run_query","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/query.sql","original_file_path":"macros/etc/query.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.is_incremental":{"unique_id":"macro.dbt.is_incremental","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/is_incremental.sql","original_file_path":"macros/etc/is_incremental.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.convert_datetime":{"unique_id":"macro.dbt.convert_datetime","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/datetime.sql","original_file_path":"macros/etc/datetime.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.dates_in_range":{"unique_id":"macro.dbt.dates_in_range","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/datetime.sql","original_file_path":"macros/etc/datetime.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.partition_range":{"unique_id":"macro.dbt.partition_range","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/datetime.sql","original_file_path":"macros/etc/datetime.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.py_current_timestring":{"unique_id":"macro.dbt.py_current_timestring","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/datetime.sql","original_file_path":"macros/etc/datetime.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.generate_schema_name":{"unique_id":"macro.dbt.generate_schema_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/get_custom_schema.sql","original_file_path":"macros/etc/get_custom_schema.sql","name":"generate_schema_name","macro_sql":"{% macro 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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.generate_schema_name_for_env":{"unique_id":"macro.dbt.generate_schema_name_for_env","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/get_custom_schema.sql","original_file_path":"macros/etc/get_custom_schema.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.generate_database_name":{"unique_id":"macro.dbt.generate_database_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/get_custom_database.sql","original_file_path":"macros/etc/get_custom_database.sql","name":"generate_database_name","macro_sql":"{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter_macro('generate_database_name', custom_database_name, node)) %}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":["macro.dbt.adapter_macro"]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__generate_database_name":{"unique_id":"macro.dbt.default__generate_database_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/etc/get_custom_database.sql","original_file_path":"macros/etc/get_custom_database.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.adapter_macro":{"unique_id":"macro.dbt.adapter_macro","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"adapter_macro","macro_sql":"{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_columns_in_query":{"unique_id":"macro.dbt.get_columns_in_query","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"get_columns_in_query","macro_sql":"{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_columns_in_query":{"unique_id":"macro.dbt.default__get_columns_in_query","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_schema":{"unique_id":"macro.dbt.create_schema","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"create_schema","macro_sql":"{% macro create_schema(relation) -%}\n {{ adapter_macro('create_schema', relation) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__create_schema":{"unique_id":"macro.dbt.default__create_schema","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.drop_schema":{"unique_id":"macro.dbt.drop_schema","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"drop_schema","macro_sql":"{% macro drop_schema(relation) -%}\n {{ adapter_macro('drop_schema', relation) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__drop_schema":{"unique_id":"macro.dbt.default__drop_schema","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_table_as":{"unique_id":"macro.dbt.create_table_as","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"create_table_as","macro_sql":"{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__create_table_as":{"unique_id":"macro.dbt.default__create_table_as","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 as (\n {{ sql }}\n );\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.create_view_as":{"unique_id":"macro.dbt.create_view_as","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"create_view_as","macro_sql":"{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__create_view_as":{"unique_id":"macro.dbt.default__create_view_as","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 }} as (\n {{ sql }}\n );\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_catalog":{"unique_id":"macro.dbt.get_catalog","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"get_catalog","macro_sql":"{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":["macro.dbt.adapter_macro"]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_catalog":{"unique_id":"macro.dbt.default__get_catalog","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.get_columns_in_relation":{"unique_id":"macro.dbt.get_columns_in_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"get_columns_in_relation","macro_sql":"{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.sql_convert_columns_in_relation":{"unique_id":"macro.dbt.sql_convert_columns_in_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__get_columns_in_relation":{"unique_id":"macro.dbt.default__get_columns_in_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.alter_column_type":{"unique_id":"macro.dbt.alter_column_type","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"alter_column_type","macro_sql":"{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.alter_column_comment":{"unique_id":"macro.dbt.alter_column_comment","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"alter_column_comment","macro_sql":"{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter_macro('alter_column_comment', relation, column_dict)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__alter_column_comment":{"unique_id":"macro.dbt.default__alter_column_comment","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.alter_relation_comment":{"unique_id":"macro.dbt.alter_relation_comment","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"alter_relation_comment","macro_sql":"{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter_macro('alter_relation_comment', relation, relation_comment)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__alter_relation_comment":{"unique_id":"macro.dbt.default__alter_relation_comment","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.persist_docs":{"unique_id":"macro.dbt.persist_docs","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"persist_docs","macro_sql":"{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter_macro('persist_docs', relation, model, for_relation, for_columns)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__persist_docs":{"unique_id":"macro.dbt.default__persist_docs","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__alter_column_type":{"unique_id":"macro.dbt.default__alter_column_type","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.drop_relation":{"unique_id":"macro.dbt.drop_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"drop_relation","macro_sql":"{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__drop_relation":{"unique_id":"macro.dbt.default__drop_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"default__drop_relation","macro_sql":"{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.truncate_relation":{"unique_id":"macro.dbt.truncate_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"truncate_relation","macro_sql":"{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__truncate_relation":{"unique_id":"macro.dbt.default__truncate_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"default__truncate_relation","macro_sql":"{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.rename_relation":{"unique_id":"macro.dbt.rename_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"rename_relation","macro_sql":"{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__rename_relation":{"unique_id":"macro.dbt.default__rename_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.information_schema_name":{"unique_id":"macro.dbt.information_schema_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"information_schema_name","macro_sql":"{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__information_schema_name":{"unique_id":"macro.dbt.default__information_schema_name","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.list_schemas":{"unique_id":"macro.dbt.list_schemas","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"list_schemas","macro_sql":"{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":["macro.dbt.adapter_macro"]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__list_schemas":{"unique_id":"macro.dbt.default__list_schemas","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.check_schema_exists":{"unique_id":"macro.dbt.check_schema_exists","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"check_schema_exists","macro_sql":"{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__check_schema_exists":{"unique_id":"macro.dbt.default__check_schema_exists","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.list_relations_without_caching":{"unique_id":"macro.dbt.list_relations_without_caching","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"list_relations_without_caching","macro_sql":"{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter_macro('list_relations_without_caching', schema_relation)) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":["macro.dbt.adapter_macro"]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__list_relations_without_caching":{"unique_id":"macro.dbt.default__list_relations_without_caching","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.current_timestamp":{"unique_id":"macro.dbt.current_timestamp","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"current_timestamp","macro_sql":"{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__current_timestamp":{"unique_id":"macro.dbt.default__current_timestamp","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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 %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.collect_freshness":{"unique_id":"macro.dbt.collect_freshness","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"collect_freshness","macro_sql":"{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__collect_freshness":{"unique_id":"macro.dbt.default__collect_freshness","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"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').table) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.make_temp_relation":{"unique_id":"macro.dbt.make_temp_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"make_temp_relation","macro_sql":"{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.default__make_temp_relation":{"unique_id":"macro.dbt.default__make_temp_relation","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"default__make_temp_relation","macro_sql":"{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.set_sql_header":{"unique_id":"macro.dbt.set_sql_header","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/adapters/common.sql","original_file_path":"macros/adapters/common.sql","name":"set_sql_header","macro_sql":"{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.test_relationships":{"unique_id":"macro.dbt.test_relationships","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/schema_tests/relationships.sql","original_file_path":"macros/schema_tests/relationships.sql","name":"test_relationships","macro_sql":"{% macro test_relationships(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nselect count(*) as validation_errors\nfrom (\n select {{ column_name }} as id from {{ model }}\n) as child\nleft join (\n select {{ field }} as id from {{ to }}\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.test_not_null":{"unique_id":"macro.dbt.test_not_null","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/schema_tests/not_null.sql","original_file_path":"macros/schema_tests/not_null.sql","name":"test_not_null","macro_sql":"{% macro test_not_null(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*) as validation_errors\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.test_unique":{"unique_id":"macro.dbt.test_unique","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/schema_tests/unique.sql","original_file_path":"macros/schema_tests/unique.sql","name":"test_unique","macro_sql":"{% macro test_unique(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*) as validation_errors\nfrom (\n\n select\n {{ column_name }}\n\n from {{ model }}\n where {{ column_name }} is not null\n group by {{ column_name }}\n having count(*) > 1\n\n) validation_errors\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt.test_accepted_values":{"unique_id":"macro.dbt.test_accepted_values","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"macros/schema_tests/accepted_values.sql","original_file_path":"macros/schema_tests/accepted_values.sql","name":"test_accepted_values","macro_sql":"{% macro test_accepted_values(model, values) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n{% set quote_values = kwargs.get('quote', True) %}\n\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 not in (\n {% for value in values -%}\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__get_catalog":{"unique_id":"macro.dbt_snowflake.snowflake__get_catalog","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/catalog.sql","original_file_path":"macros/catalog.sql","name":"snowflake__get_catalog","macro_sql":"{% macro snowflake__get_catalog(information_schema, schemas) -%}\n {% set query %}\n with tables as (\n\n select\n table_catalog as \"table_database\",\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n table_type as \"table_type\",\n\n -- note: this is the _role_ that owns the table\n table_owner as \"table_owner\",\n\n 'Clustering Key' as \"stats:clustering_key:label\",\n clustering_key as \"stats:clustering_key:value\",\n 'The key used to cluster this table' as \"stats:clustering_key:description\",\n (clustering_key is not null) as \"stats:clustering_key:include\",\n\n 'Row Count' as \"stats:row_count:label\",\n row_count as \"stats:row_count:value\",\n 'An approximate count of rows in this table' as \"stats:row_count:description\",\n (row_count is not null) as \"stats:row_count:include\",\n\n 'Approximate Size' as \"stats:bytes:label\",\n bytes as \"stats:bytes:value\",\n 'Approximate size of the table as reported by Snowflake' as \"stats:bytes:description\",\n (bytes is not null) as \"stats:bytes:include\"\n\n from {{ information_schema }}.tables\n\n ),\n\n columns as (\n\n select\n table_catalog as \"table_database\",\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n null as \"table_comment\",\n\n column_name as \"column_name\",\n ordinal_position as \"column_index\",\n data_type as \"column_type\",\n null as \"column_comment\"\n\n from {{ information_schema }}.columns\n )\n\n select *\n from tables\n join columns using (\"table_database\", \"table_schema\", \"table_name\")\n where (\n {%- for schema in schemas -%}\n upper(\"table_schema\") = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n order by \"column_index\"\n {%- endset -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__create_table_as":{"unique_id":"macro.dbt_snowflake.snowflake__create_table_as","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__create_table_as","macro_sql":"{% macro snowflake__create_table_as(temporary, relation, sql) -%}\n {%- set transient = config.get('transient', default=true) -%}\n {%- set cluster_by_keys = config.get('cluster_by', default=none) -%}\n {%- set enable_automatic_clustering = config.get('automatic_clustering', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n\n {%- if cluster_by_keys is not none and cluster_by_keys is string -%}\n {%- set cluster_by_keys = [cluster_by_keys] -%}\n {%- endif -%}\n {%- if cluster_by_keys is not none -%}\n {%- set cluster_by_string = cluster_by_keys|join(\", \")-%}\n {% else %}\n {%- set cluster_by_string = none -%}\n {%- endif -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace {% if temporary -%}\n temporary\n {%- elif transient -%}\n transient\n {%- endif %} table {{ relation }} {% if copy_grants and not temporary -%} copy grants {%- endif %} as\n (\n {%- if cluster_by_string is not none -%}\n select * from(\n {{ sql }}\n ) order by ({{ cluster_by_string }})\n {%- else -%}\n {{ sql }}\n {%- endif %}\n );\n {% if cluster_by_string is not none and not temporary -%}\n alter table {{relation}} cluster by ({{cluster_by_string}});\n {%- endif -%}\n {% if enable_automatic_clustering and cluster_by_string is not none and not temporary -%}\n alter table {{relation}} resume recluster;\n {%- endif -%}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__create_view_as":{"unique_id":"macro.dbt_snowflake.snowflake__create_view_as","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__create_view_as","macro_sql":"{% macro snowflake__create_view_as(relation, sql) -%}\n {%- set secure = config.get('secure', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create or replace {% if secure -%}\n secure\n {%- endif %} view {{ relation }} {% if copy_grants -%} copy grants {%- endif %} as (\n {{ sql }}\n );\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__get_columns_in_relation":{"unique_id":"macro.dbt_snowflake.snowflake__get_columns_in_relation","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__get_columns_in_relation","macro_sql":"{% macro snowflake__get_columns_in_relation(relation) -%}\n {%- set sql -%}\n describe table {{ relation }}\n {%- endset -%}\n {%- set result = run_query(sql) -%}\n\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many columns in relation {{ relation }}! dbt can only get\n information about relations with fewer than {{ maximum }} columns.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n\n {% set columns = [] %}\n {% for row in result %}\n {% do columns.append(api.Column.from_description(row['name'], row['type'])) %}\n {% endfor %}\n {% do return(columns) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__list_schemas":{"unique_id":"macro.dbt_snowflake.snowflake__list_schemas","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__list_schemas","macro_sql":"{% macro snowflake__list_schemas(database) -%}\n {# 10k limit from here: https://docs.snowflake.net/manuals/sql-reference/sql/show-schemas.html#usage-notes #}\n {% set maximum = 10000 %}\n {% set sql -%}\n show terse schemas in database {{ database }}\n limit {{ maximum }}\n {%- endset %}\n {% set result = run_query(sql) %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many schemas in database {{ database }}! dbt can only get\n information about databases with fewer than {{ maximum }} schemas.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {{ return(result) }}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__list_relations_without_caching":{"unique_id":"macro.dbt_snowflake.snowflake__list_relations_without_caching","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__list_relations_without_caching","macro_sql":"{% macro snowflake__list_relations_without_caching(schema_relation) %}\n {%- set sql -%}\n show terse objects in {{ schema_relation }}\n {%- endset -%}\n\n {%- set result = run_query(sql) -%}\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many schemas in schema {{ schema_relation }}! dbt can only get\n information about schemas with fewer than {{ maximum }} objects.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {%- do return(result) -%}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__check_schema_exists":{"unique_id":"macro.dbt_snowflake.snowflake__check_schema_exists","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__check_schema_exists","macro_sql":"{% macro snowflake__check_schema_exists(information_schema, schema) -%}\n {% call statement('check_schema_exists', fetch_result=True) -%}\n select count(*)\n from {{ information_schema }}.schemata\n where upper(schema_name) = upper('{{ schema }}')\n and upper(catalog_name) = upper('{{ information_schema.database }}')\n {%- endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__current_timestamp":{"unique_id":"macro.dbt_snowflake.snowflake__current_timestamp","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__current_timestamp","macro_sql":"{% macro snowflake__current_timestamp() -%}\n convert_timezone('UTC', current_timestamp())\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__snapshot_string_as_time":{"unique_id":"macro.dbt_snowflake.snowflake__snapshot_string_as_time","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__snapshot_string_as_time","macro_sql":"{% macro snowflake__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"to_timestamp_ntz('\" ~ timestamp ~ \"')\" -%}\n {{ return(result) }}\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__snapshot_get_time":{"unique_id":"macro.dbt_snowflake.snowflake__snapshot_get_time","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__snapshot_get_time","macro_sql":"{% macro snowflake__snapshot_get_time() -%}\n to_timestamp_ntz({{ current_timestamp() }})\n{%- endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__rename_relation":{"unique_id":"macro.dbt_snowflake.snowflake__rename_relation","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__rename_relation","macro_sql":"{% macro snowflake__rename_relation(from_relation, to_relation) -%}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ to_relation }}\n {%- endcall %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__alter_column_type":{"unique_id":"macro.dbt_snowflake.snowflake__alter_column_type","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__alter_column_type","macro_sql":"{% macro snowflake__alter_column_type(relation, column_name, new_column_type) -%}\n {% call statement('alter_column_type') %}\n alter table {{ relation }} alter {{ adapter.quote(column_name) }} set data type {{ new_column_type }};\n {% endcall %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__alter_relation_comment":{"unique_id":"macro.dbt_snowflake.snowflake__alter_relation_comment","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__alter_relation_comment","macro_sql":"{% macro snowflake__alter_relation_comment(relation, relation_comment) -%}\n comment on {{ relation.type }} {{ relation }} IS $${{ relation_comment | replace('$', '[$]') }}$$;\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__alter_column_comment":{"unique_id":"macro.dbt_snowflake.snowflake__alter_column_comment","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/adapters.sql","original_file_path":"macros/adapters.sql","name":"snowflake__alter_column_comment","macro_sql":"{% macro snowflake__alter_column_comment(relation, column_dict) -%}\n alter {{ relation.type }} {{ relation }} alter\n {% for column_name in column_dict %}\n {{ column_name }} COMMENT $${{ column_dict[column_name]['description'] | replace('$', '[$]') }}$$ {{ ',' if not loop.last else ';' }}\n {% endfor %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.snowflake__get_merge_sql":{"unique_id":"macro.dbt_snowflake.snowflake__get_merge_sql","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/merge.sql","original_file_path":"macros/materializations/merge.sql","name":"snowflake__get_merge_sql","macro_sql":"{% macro snowflake__get_merge_sql(target, source_sql, unique_key, dest_columns, predicates) -%}\n\n {#\n Workaround for Snowflake not being happy with a merge on a constant-false predicate.\n When no unique_key is provided, this macro will do a regular insert. If a unique_key\n is provided, then this macro will do a proper merge instead.\n #}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute='name')) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- if unique_key is none -%}\n\n {{ sql_header if sql_header is not none }}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source_sql }}\n );\n\n {%- else -%}\n\n {{ default__get_merge_sql(target, source_sql, unique_key, dest_columns, predicates) }}\n\n {%- endif -%}\n\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.materialization_view_snowflake":{"unique_id":"macro.dbt_snowflake.materialization_view_snowflake","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/view.sql","original_file_path":"macros/materializations/view.sql","name":"materialization_view_snowflake","macro_sql":"{% materialization view, adapter='snowflake' -%}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model, for_columns=false) %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.materialization_table_snowflake":{"unique_id":"macro.dbt_snowflake.materialization_table_snowflake","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/table.sql","original_file_path":"macros/materializations/table.sql","name":"materialization_table_snowflake","macro_sql":"{% materialization table, adapter='snowflake' %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database, type='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 {#-- Drop the relation if it was a view to \"convert\" it in a table. This may lead to\n -- downtime, but it should be a relatively infrequent occurrence #}\n {% if old_relation is not none and not old_relation.is_table %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ drop_relation_if_exists(old_relation) }}\n {% endif %}\n\n --build model\n {% call statement('main') -%}\n {{ create_table_as(false, target_relation, sql) }}\n {%- endcall %}\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 {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.dbt_snowflake_validate_get_incremental_strategy":{"unique_id":"macro.dbt_snowflake.dbt_snowflake_validate_get_incremental_strategy","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/incremental.sql","original_file_path":"macros/materializations/incremental.sql","name":"dbt_snowflake_validate_get_incremental_strategy","macro_sql":"{% macro dbt_snowflake_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'delete+insert'\n {%- endset %}\n {% if strategy not in ['merge', 'delete+insert'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.dbt_snowflake_get_incremental_sql":{"unique_id":"macro.dbt_snowflake.dbt_snowflake_get_incremental_sql","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/incremental.sql","original_file_path":"macros/materializations/incremental.sql","name":"dbt_snowflake_get_incremental_sql","macro_sql":"{% macro dbt_snowflake_get_incremental_sql(strategy, tmp_relation, target_relation, unique_key, dest_columns) %}\n {% if strategy == 'merge' %}\n {% do return(get_merge_sql(target_relation, tmp_relation, unique_key, dest_columns)) %}\n {% elif strategy == 'delete+insert' %}\n {% do return(get_delete_insert_merge_sql(target_relation, tmp_relation, unique_key, dest_columns)) %}\n {% else %}\n {% do exceptions.raise_compiler_error('invalid strategy: ' ~ strategy) %}\n {% endif %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.dbt_snowflake.materialization_incremental_snowflake":{"unique_id":"macro.dbt_snowflake.materialization_incremental_snowflake","package_name":"dbt_snowflake","root_path":"/Users/matthewallen/code/dbt-core/plugins/snowflake/dbt/include/snowflake","path":"macros/materializations/incremental.sql","original_file_path":"macros/materializations/incremental.sql","name":"materialization_incremental_snowflake","macro_sql":"{% materialization incremental, adapter='snowflake' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set target_relation = this %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_snowflake_validate_get_incremental_strategy(config) -%}\n\n -- setup\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view %}\n {#-- Can't overwrite a view with a table - we must drop --#}\n {{ log(\"Dropping relation \" ~ target_relation ~ \" because it is a view and this model is a table.\") }}\n {% do adapter.drop_relation(existing_relation) %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% else %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set dest_columns = adapter.get_columns_in_relation(target_relation) %}\n {% set build_sql = dbt_snowflake_get_incremental_sql(strategy, tmp_relation, target_relation, unique_key, dest_columns) %}\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {%- endcall -%}\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 {% set target_relation = target_relation.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.jaffle_shop.payment_methods":{"unique_id":"macro.jaffle_shop.payment_methods","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"macros/payment_methods.sql","original_file_path":"macros/payment_methods.sql","name":"payment_methods","macro_sql":"{% macro payment_methods() %}\n {% do return([jaffle_shop.lowerstr('Credit_Card'), 'coupon', 'bank_transfer', 'gift_card']) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":["macro.jaffle_shop.lowerstr"]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]},"macro.jaffle_shop.lowerstr":{"unique_id":"macro.jaffle_shop.lowerstr","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"macros/lowerstr.sql","original_file_path":"macros/lowerstr.sql","name":"lowerstr","macro_sql":"{% macro lowerstr(string) %}\n {% do return(string | lower) %}\n{% endmacro %}","resource_type":"macro","tags":[],"depends_on":{"macros":[]},"description":"","meta":{},"docs":{"show":true},"patch_path":null,"arguments":[]}},"docs":{"jaffle_shop.__overview__":{"unique_id":"jaffle_shop.__overview__","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"overview.md","original_file_path":"models/overview.md","name":"__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 demonstrations and tutorials.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop).\n\ntest"},"jaffle_shop.orders_status":{"unique_id":"jaffle_shop.orders_status","package_name":"jaffle_shop","root_path":"/Users/matthewallen/code/jaffle_shop","path":"marts/core/docs.md","original_file_path":"models/marts/core/docs.md","name":"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 |"},"dbt.__overview__":{"unique_id":"dbt.__overview__","package_name":"dbt","root_path":"/Users/matthewallen/code/dbt-core/core/dbt/include/global_project","path":"overview.md","original_file_path":"docs/overview.md","name":"__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 `--models` 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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://community.getdbt.com/) on Slack for live questions and support."}},"disabled":[],"generated_at":"2020-06-22T20:06:55.224210Z","parent_map":{"model.jaffle_shop.stg_customers":["snapshot.jaffle_shop.customer_snapshot"],"model.jaffle_shop.stg_payments":["source.jaffle_shop.seeds.raw_payments"],"model.jaffle_shop.stg_orders":["source.jaffle_shop.seeds.raw_orders"],"model.jaffle_shop.dim_customers":["model.jaffle_shop.customer_orders","model.jaffle_shop.customer_payments","model.jaffle_shop.stg_customers"],"model.jaffle_shop.fct_orders":["model.jaffle_shop.order_payments","model.jaffle_shop.stg_orders"],"model.jaffle_shop.order_payments":["model.jaffle_shop.stg_payments"],"model.jaffle_shop.customer_payments":["model.jaffle_shop.stg_orders","model.jaffle_shop.stg_payments"],"model.jaffle_shop.customer_orders":["model.jaffle_shop.stg_orders"],"snapshot.jaffle_shop.customer_snapshot":["source.jaffle_shop.seeds.raw_customers"],"analysis.jaffle_shop.orders_with_customers":["model.jaffle_shop.dim_customers","model.jaffle_shop.fct_orders"],"seed.jaffle_shop.raw_customers":[],"seed.jaffle_shop.raw_orders":[],"seed.jaffle_shop.raw_payments":[],"test.jaffle_shop.unique_stg_customers_customer_id":["model.jaffle_shop.stg_customers"],"test.jaffle_shop.not_null_stg_customers_customer_id":["model.jaffle_shop.stg_customers"],"test.jaffle_shop.unique_stg_orders_order_id":["model.jaffle_shop.stg_orders"],"test.jaffle_shop.not_null_stg_orders_order_id":["model.jaffle_shop.stg_orders"],"test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned":["model.jaffle_shop.stg_orders"],"test.jaffle_shop.unique_stg_payments_payment_id":["model.jaffle_shop.stg_payments"],"test.jaffle_shop.not_null_stg_payments_payment_id":["model.jaffle_shop.stg_payments"],"test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card":["model.jaffle_shop.stg_payments"],"test.jaffle_shop.unique_dim_customers_customer_id":["model.jaffle_shop.dim_customers"],"test.jaffle_shop.not_null_dim_customers_customer_id":["model.jaffle_shop.dim_customers"],"test.jaffle_shop.unique_fct_orders_order_id":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_order_id":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_customer_id":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_":["model.jaffle_shop.dim_customers","model.jaffle_shop.fct_orders"],"test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_amount":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_credit_card_amount":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_coupon_amount":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_bank_transfer_amount":["model.jaffle_shop.fct_orders"],"test.jaffle_shop.not_null_fct_orders_gift_card_amount":["model.jaffle_shop.fct_orders"],"source.jaffle_shop.seeds.raw_customers":[],"source.jaffle_shop.seeds.raw_orders":[],"source.jaffle_shop.seeds.raw_payments":[]},"child_map":{"model.jaffle_shop.stg_customers":["model.jaffle_shop.dim_customers","test.jaffle_shop.not_null_stg_customers_customer_id","test.jaffle_shop.unique_stg_customers_customer_id"],"model.jaffle_shop.stg_payments":["model.jaffle_shop.customer_payments","model.jaffle_shop.order_payments","test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card","test.jaffle_shop.not_null_stg_payments_payment_id","test.jaffle_shop.unique_stg_payments_payment_id"],"model.jaffle_shop.stg_orders":["model.jaffle_shop.customer_orders","model.jaffle_shop.customer_payments","model.jaffle_shop.fct_orders","test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned","test.jaffle_shop.not_null_stg_orders_order_id","test.jaffle_shop.unique_stg_orders_order_id"],"model.jaffle_shop.dim_customers":["analysis.jaffle_shop.orders_with_customers","test.jaffle_shop.not_null_dim_customers_customer_id","test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_","test.jaffle_shop.unique_dim_customers_customer_id"],"model.jaffle_shop.fct_orders":["analysis.jaffle_shop.orders_with_customers","test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned","test.jaffle_shop.not_null_fct_orders_amount","test.jaffle_shop.not_null_fct_orders_bank_transfer_amount","test.jaffle_shop.not_null_fct_orders_coupon_amount","test.jaffle_shop.not_null_fct_orders_credit_card_amount","test.jaffle_shop.not_null_fct_orders_customer_id","test.jaffle_shop.not_null_fct_orders_gift_card_amount","test.jaffle_shop.not_null_fct_orders_order_id","test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_","test.jaffle_shop.unique_fct_orders_order_id"],"model.jaffle_shop.order_payments":["model.jaffle_shop.fct_orders"],"model.jaffle_shop.customer_payments":["model.jaffle_shop.dim_customers"],"model.jaffle_shop.customer_orders":["model.jaffle_shop.dim_customers"],"snapshot.jaffle_shop.customer_snapshot":["model.jaffle_shop.stg_customers"],"analysis.jaffle_shop.orders_with_customers":[],"seed.jaffle_shop.raw_customers":[],"seed.jaffle_shop.raw_orders":[],"seed.jaffle_shop.raw_payments":[],"test.jaffle_shop.unique_stg_customers_customer_id":[],"test.jaffle_shop.not_null_stg_customers_customer_id":[],"test.jaffle_shop.unique_stg_orders_order_id":[],"test.jaffle_shop.not_null_stg_orders_order_id":[],"test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned":[],"test.jaffle_shop.unique_stg_payments_payment_id":[],"test.jaffle_shop.not_null_stg_payments_payment_id":[],"test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card":[],"test.jaffle_shop.unique_dim_customers_customer_id":[],"test.jaffle_shop.not_null_dim_customers_customer_id":[],"test.jaffle_shop.unique_fct_orders_order_id":[],"test.jaffle_shop.not_null_fct_orders_order_id":[],"test.jaffle_shop.not_null_fct_orders_customer_id":[],"test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_":[],"test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned":[],"test.jaffle_shop.not_null_fct_orders_amount":[],"test.jaffle_shop.not_null_fct_orders_credit_card_amount":[],"test.jaffle_shop.not_null_fct_orders_coupon_amount":[],"test.jaffle_shop.not_null_fct_orders_bank_transfer_amount":[],"test.jaffle_shop.not_null_fct_orders_gift_card_amount":[],"source.jaffle_shop.seeds.raw_customers":["snapshot.jaffle_shop.customer_snapshot"],"source.jaffle_shop.seeds.raw_orders":["model.jaffle_shop.stg_orders"],"source.jaffle_shop.seeds.raw_payments":["model.jaffle_shop.stg_payments"]},"metadata":{"project_id":"06e5b98c2db46f8a72cc4f66410e9b3b","user_id":null,"send_anonymous_usage_stats":false,"adapter_type":"snowflake"}} From 4698f1a9ca1bb9cbd4d00dcf2868308f19e8be37 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Tue, 23 Jun 2020 14:45:05 -0500 Subject: [PATCH 04/13] Adjusted scope of certain variables in docs --- src/app/docs/analysis.js | 2 +- src/app/docs/macro.js | 8 ++++---- src/app/docs/model.js | 2 +- src/app/docs/seed.js | 2 +- src/app/docs/snapshot.js | 2 +- src/app/docs/test.js | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/docs/analysis.js b/src/app/docs/analysis.js index 84ae22ef9..bc4b19174 100644 --- a/src/app/docs/analysis.js +++ b/src/app/docs/analysis.js @@ -22,7 +22,7 @@ angular $scope.model = {}; projectService.ready(function(project) { - var mod = project.nodes[$scope.model_uid]; + let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = utils.getReferences(project, mod); $scope.parents = utils.getParents(project, mod); diff --git a/src/app/docs/macro.js b/src/app/docs/macro.js index 62204a13b..60896f5e4 100644 --- a/src/app/docs/macro.js +++ b/src/app/docs/macro.js @@ -16,7 +16,7 @@ angular $scope.codeService = codeService; function getReferences(project, self) { - var references = _.filter(project.nodes, function(node) { + let references = _.filter(project.nodes, function(node) { if (node.depends_on && node.depends_on.macros && node.depends_on.macros.length) { if (_.contains(node.depends_on.macros, self.unique_id)) { return true; @@ -25,7 +25,7 @@ angular return false; }); - var macroReferences = _.filter(project.macros, function(macro) { + let macroReferences = _.filter(project.macros, function(macro) { if (macro.depends_on && macro.depends_on.macros && macro.depends_on.macros.length) { if (_.contains(macro.depends_on.macros, self.unique_id)) { return true; @@ -39,7 +39,7 @@ angular } function getMacroParents (project, self) { - var macroParents = _.filter(project.macros, function(macro) { + let macroParents = _.filter(project.macros, function(macro) { if (self.depends_on && self.depends_on.macros && self.depends_on.macros.length) { if (_.contains(self.depends_on.macros, macro.unique_id)) { return true; @@ -53,7 +53,7 @@ angular $scope.macro = {}; projectService.ready(function(project) { - var macro = project.macros[$scope.model_uid]; + let macro = project.macros[$scope.model_uid]; $scope.macro = macro; $scope.references = getReferences(project, macro); $scope.parents = getMacroParents(project, macro); diff --git a/src/app/docs/model.js b/src/app/docs/model.js index d263442d7..428e1074a 100644 --- a/src/app/docs/model.js +++ b/src/app/docs/model.js @@ -29,7 +29,7 @@ angular $scope.model = {}; projectService.ready(function(project) { - var mod = project.nodes[$scope.model_uid]; + let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = utils.getReferences(project, mod); $scope.parents = utils.getParents(project, mod); diff --git a/src/app/docs/seed.js b/src/app/docs/seed.js index 473f0b2f3..9a7e79b24 100644 --- a/src/app/docs/seed.js +++ b/src/app/docs/seed.js @@ -19,7 +19,7 @@ angular $scope.model = {}; projectService.ready(function(project) { - var mod = project.nodes[$scope.model_uid]; + let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = utils.getReferences(project, mod); $scope.parents = utils.getParents(project, mod); diff --git a/src/app/docs/snapshot.js b/src/app/docs/snapshot.js index 8403f710a..6b7dfd662 100644 --- a/src/app/docs/snapshot.js +++ b/src/app/docs/snapshot.js @@ -19,7 +19,7 @@ angular $scope.model = {}; projectService.ready(function(project) { - var mod = project.nodes[$scope.model_uid]; + let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = utils.getReferences(project, mod); $scope.parents = utils.getParents(project, mod); diff --git a/src/app/docs/test.js b/src/app/docs/test.js index 1ab4403d2..921c3e58c 100644 --- a/src/app/docs/test.js +++ b/src/app/docs/test.js @@ -19,7 +19,7 @@ angular $scope.model = {}; projectService.ready(function(project) { - var mod = project.nodes[$scope.model_uid]; + let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = utils.getReferences(project, mod); $scope.parents = utils.getParents(project, mod); From c1e6aff77f0dae334afc6ba70d7c11ec393b5fd2 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Tue, 23 Jun 2020 15:27:06 -0500 Subject: [PATCH 05/13] Changed scope of variables in utils.js --- src/app/docs/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/docs/utils.js b/src/app/docs/utils.js index 348be4122..59c3d0704 100644 --- a/src/app/docs/utils.js +++ b/src/app/docs/utils.js @@ -1,6 +1,6 @@ const _ = require('underscore'); export function getReferences(project, model) { - var references = _.filter(project.nodes, function(node) { + let references = _.filter(project.nodes, function(node) { if (node.depends_on && node.depends_on.nodes && node.depends_on.nodes.length) { if (_.contains(node.depends_on.nodes, model.unique_id)) { return true; @@ -14,7 +14,7 @@ export function getReferences(project, model) { } export function getParents (project, model) { - var parents = _.filter(project.nodes, function(node) { + let parents = _.filter(project.nodes, function(node) { if (model.depends_on && model.depends_on.nodes && model.depends_on.nodes.length) { if (_.contains(model.depends_on.nodes, node.unique_id)) { return true; @@ -23,7 +23,7 @@ export function getParents (project, model) { return false; }); - var macroParents = _.filter(project.macros, function(macro) { + let macroParents = _.filter(project.macros, function(macro) { if (model.depends_on && model.depends_on.macros && model.depends_on.macros.length) { if (_.contains(model.depends_on.macros, macro.unique_id)) { return true; From 76dc447097701c9fb3fbf2855fef5261bc8ad977 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Tue, 23 Jun 2020 16:10:01 -0500 Subject: [PATCH 06/13] Added back data/manifest.json, changed "require" for some docs, deleted fixed comments and modified overview.html --- data/manifest.json | 1 + src/app/docs/analysis.js | 1 - src/app/docs/macro.js | 1 - src/app/docs/model.js | 1 - src/app/docs/seed.js | 1 - src/app/docs/snapshot.js | 1 - src/app/docs/test.js | 1 - src/app/docs/utils.js | 1 - src/app/overview/overview.html | 1 - 9 files changed, 1 insertion(+), 8 deletions(-) create mode 100644 data/manifest.json diff --git a/data/manifest.json b/data/manifest.json new file mode 100644 index 000000000..ec96a411d --- /dev/null +++ b/data/manifest.json @@ -0,0 +1 @@ +{"nodes": {"model.jaffle_shop.stg_customers": {"raw_sql": "with 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_customers') }}\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "staging", "stg_customers"], "unique_id": "model.jaffle_shop.stg_customers", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "staging/stg_customers.sql", "original_file_path": "models/staging/stg_customers.sql", "name": "stg_customers", "resource_type": "model", "alias": "stg_customers", "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": ["staging", "hourly"]}, "tags": ["staging", "hourly"], "refs": [["raw_customers"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_customers"]}, "description": "", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/staging/schema.yml", "build_path": "target/compiled/jaffle_shop/staging/stg_customers.sql", "compiled": true, "compiled_sql": "with source as (\n select * from \"analytics\".\"test_schema\".\"raw_customers\"\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "with source as (\n select * from \"analytics\".\"test_schema\".\"raw_customers\"\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed", "wrapped_sql": null}, "model.jaffle_shop.stg_payments": {"raw_sql": "with 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\nrenamed 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 * from renamed", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "staging", "stg_payments"], "unique_id": "model.jaffle_shop.stg_payments", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "staging/stg_payments.sql", "original_file_path": "models/staging/stg_payments.sql", "name": "stg_payments", "resource_type": "model", "alias": "stg_payments", "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": ["staging", "hourly"]}, "tags": ["staging", "hourly"], "refs": [["raw_payments"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_payments"]}, "description": "", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "tags": ["billing"]}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "tags": []}}, "meta": {"owner": "@drew", "contains_pii": true, "SLA": "1 hour"}, "docs": {"show": true}, "patch_path": "models/staging/schema.yml", "build_path": "target/compiled/jaffle_shop/staging/stg_payments.sql", "compiled": true, "compiled_sql": "with source as (\n select * from \"analytics\".\"test_schema\".\"raw_payments\"\n\n),\n\nrenamed 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 * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "with source as (\n select * from \"analytics\".\"test_schema\".\"raw_payments\"\n\n),\n\nrenamed 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 * from renamed", "wrapped_sql": null}, "model.jaffle_shop.stg_orders": {"raw_sql": "/*\nhack for example macro references:\n {{ example_macro(\"abc\", \"123\") }}\n*/\n\nwith 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\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "staging", "stg_orders"], "unique_id": "model.jaffle_shop.stg_orders", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "staging/stg_orders.sql", "original_file_path": "models/staging/stg_orders.sql", "name": "stg_orders", "resource_type": "model", "alias": "stg_orders", "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": ["staging", "hourly"]}, "tags": ["staging", "hourly"], "refs": [["raw_orders"]], "sources": [], "depends_on": {"macros": ["macro.jaffle_shop.example_macro"], "nodes": ["seed.jaffle_shop.raw_orders"]}, "description": "", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/staging/schema.yml", "build_path": "target/compiled/jaffle_shop/staging/stg_orders.sql", "compiled": true, "compiled_sql": "/*\nhack for example macro references:\n \n\n The provided args are abc and 123\n\n\n*/\n\nwith source as (\n select * from \"analytics\".\"test_schema\".\"raw_orders\"\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "/*\nhack for example macro references:\n \n\n The provided args are abc and 123\n\n\n*/\n\nwith source as (\n select * from \"analytics\".\"test_schema\".\"raw_orders\"\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", "wrapped_sql": null}, "model.jaffle_shop.hidden_model": {"raw_sql": "-- hack for DAG viz\n-- {{ source('payments', 'orders') }}\n\nselect * from {{ ref('stg_orders') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "staging", "hidden_model"], "unique_id": "model.jaffle_shop.hidden_model", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "staging/hidden_model.sql", "original_file_path": "models/staging/hidden_model.sql", "name": "hidden_model", "resource_type": "model", "alias": "hidden_model", "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": ["staging", "hourly"]}, "tags": ["staging", "hourly"], "refs": [["stg_orders"]], "sources": [["payments", "orders"]], "depends_on": {"macros": [], "nodes": ["source.jaffle_shop.payments.orders", "model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": false}, "patch_path": "models/staging/schema.yml", "build_path": "target/compiled/jaffle_shop/staging/hidden_model.sql", "compiled": true, "compiled_sql": "-- hack for DAG viz\n-- \"analytics\".\"test_schema\".\"raw_orders\"\n\nselect * from \"analytics\".\"test_schema\".\"stg_orders\"", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "-- hack for DAG viz\n-- \"analytics\".\"test_schema\".\"raw_orders\"\n\nselect * from \"analytics\".\"test_schema\".\"stg_orders\"", "wrapped_sql": null}, "model.jaffle_shop.dim_customers": {"raw_sql": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\ncustomer_orders as (\n\n select * from {{ ref('customer_orders') }}\n\n),\n\ncustomer_payments as (\n\n select * from {{ ref('customer_payments') }}\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "marts", "core", "dim_customers"], "unique_id": "model.jaffle_shop.dim_customers", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/dim_customers.sql", "original_file_path": "models/marts/core/dim_customers.sql", "name": "dim_customers", "resource_type": "model", "alias": "dim_customers", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_customers"], ["customer_orders"], ["customer_payments"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_customers", "model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments"]}, "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": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": null, "tags": []}, "email": {"name": "email", "description": "Customer's email address. PII.", "meta": {}, "data_type": null, "tags": []}, "first_order": {"name": "first_order", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": null, "tags": []}, "most_recent_order": {"name": "most_recent_order", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": null, "tags": []}, "total_order_amount": {"name": "total_order_amount", "description": "Total value (AUD) of a customer's orders", "meta": {}, "data_type": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/marts/core/schema.yml", "build_path": "target/compiled/jaffle_shop/marts/core/dim_customers.sql", "compiled": true, "compiled_sql": "with customers as (\n\n select * from \"analytics\".\"test_schema\".\"stg_customers\"\n\n),\n\ncustomer_orders as (\n\n select * from \"analytics\".\"test_schema\".\"customer_orders\"\n\n),\n\ncustomer_payments as (\n\n select * from \"analytics\".\"test_schema\".\"customer_payments\"\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "with customers as (\n\n select * from \"analytics\".\"test_schema\".\"stg_customers\"\n\n),\n\ncustomer_orders as (\n\n select * from \"analytics\".\"test_schema\".\"customer_orders\"\n\n),\n\ncustomer_payments as (\n\n select * from \"analytics\".\"test_schema\".\"customer_payments\"\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "wrapped_sql": null}, "model.jaffle_shop.fct_orders": {"raw_sql": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\norder_payments as (\n\n select * from {{ ref('order_payments') }}\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "marts", "core", "fct_orders"], "unique_id": "model.jaffle_shop.fct_orders", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/fct_orders.sql", "original_file_path": "models/marts/core/fct_orders.sql", "name": "fct_orders", "resource_type": "model", "alias": "fct_orders", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_orders"], ["order_payments"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.order_payments"]}, "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": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": 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": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/marts/core/schema.yml", "build_path": "target/compiled/jaffle_shop/marts/core/fct_orders.sql", "compiled": true, "compiled_sql": "\n\nwith orders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\norder_payments as (\n\n select * from \"analytics\".\"test_schema\".\"order_payments\"\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\nwith orders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\norder_payments as (\n\n select * from \"analytics\".\"test_schema\".\"order_payments\"\n\n),\n\nfinal 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 using (order_id)\n\n)\n\nselect * from final", "wrapped_sql": null}, "model.jaffle_shop.order_payments": {"raw_sql": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\nfinal as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(case when payment_method = '{{payment_method}}' then amount else 0 end) as {{payment_method}}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "order_payments"], "unique_id": "model.jaffle_shop.order_payments", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/intermediate/order_payments.sql", "original_file_path": "models/marts/core/intermediate/order_payments.sql", "name": "order_payments", "resource_type": "model", "alias": "order_payments", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_payments"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_payments"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/marts/core/intermediate/order_payments.sql", "compiled": true, "compiled_sql": "\n\nwith payments as (\n\n select * from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\nfinal as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\nwith payments as (\n\n select * from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\nfinal as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final", "wrapped_sql": null}, "model.jaffle_shop.customer_payments": {"raw_sql": "with payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "customer_payments"], "unique_id": "model.jaffle_shop.customer_payments", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/intermediate/customer_payments.sql", "original_file_path": "models/marts/core/intermediate/customer_payments.sql", "name": "customer_payments", "resource_type": "model", "alias": "customer_payments", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_payments"], ["stg_orders"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_payments", "model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/marts/core/intermediate/customer_payments.sql", "compiled": true, "compiled_sql": "with payments as (\n\n select * from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\norders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "with payments as (\n\n select * from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\norders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "wrapped_sql": null}, "model.jaffle_shop.customer_orders": {"raw_sql": "with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "customer_orders"], "unique_id": "model.jaffle_shop.customer_orders", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/intermediate/customer_orders.sql", "original_file_path": "models/marts/core/intermediate/customer_orders.sql", "name": "customer_orders", "resource_type": "model", "alias": "customer_orders", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/marts/core/intermediate/customer_orders.sql", "compiled": true, "compiled_sql": "with orders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "with orders as (\n\n select * from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nfinal as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by 1\n\n)\n\nselect * from final", "wrapped_sql": null}, "analysis.jaffle_shop.my_analysis": {"raw_sql": "select count(*) from {{ ref('stg_orders') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "analysis", "my_analysis"], "unique_id": "analysis.jaffle_shop.my_analysis", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "analysis/my_analysis.sql", "original_file_path": "analysis/my_analysis.sql", "name": "my_analysis", "resource_type": "analysis", "alias": "my_analysis", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "Here are the docs for my really cool analysis", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "analysis/analysis.yml", "build_path": "target/compiled/jaffle_shop/analysis/my_analysis.sql", "compiled": true, "compiled_sql": "select count(*) from \"analytics\".\"test_schema\".\"stg_orders\"", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "select count(*) from \"analytics\".\"test_schema\".\"stg_orders\"", "wrapped_sql": null}, "test.jaffle_shop.example_data_test": {"raw_sql": "select * from {{ ref('stg_orders') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "data_test", "example_data_test"], "unique_id": "test.jaffle_shop.example_data_test", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "data_test/example_data_test.sql", "original_file_path": "tests/example_data_test.sql", "name": "example_data_test", "resource_type": "test", "alias": "example_data_test", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["data"], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/data_test/example_data_test.sql", "compiled": true, "compiled_sql": "select * from \"analytics\".\"test_schema\".\"stg_orders\"", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "select * from \"analytics\".\"test_schema\".\"stg_orders\"", "wrapped_sql": "select count(*) as errors from (\nselect * from \"analytics\".\"test_schema\".\"stg_orders\"\n) sbq", "column_name": null, "test_metadata": null}, "seed.jaffle_shop.raw_customers": {"raw_sql": "", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "raw_customers"], "unique_id": "seed.jaffle_shop.raw_customers", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "raw_customers.csv", "original_file_path": "data/raw_customers.csv", "name": "raw_customers", "resource_type": "seed", "alias": "raw_customers", "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "compiled": true, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "", "wrapped_sql": null, "seed_file_path": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_customers.csv"}, "seed.jaffle_shop.raw_orders": {"raw_sql": "", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "raw_orders"], "unique_id": "seed.jaffle_shop.raw_orders", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "raw_orders.csv", "original_file_path": "data/raw_orders.csv", "name": "raw_orders", "resource_type": "seed", "alias": "raw_orders", "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "compiled": true, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "", "wrapped_sql": null, "seed_file_path": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_orders.csv"}, "seed.jaffle_shop.raw_payments": {"raw_sql": "", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "raw_payments"], "unique_id": "seed.jaffle_shop.raw_payments", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "raw_payments.csv", "original_file_path": "data/raw_payments.csv", "name": "raw_payments", "resource_type": "seed", "alias": "raw_payments", "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": []}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "compiled": true, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "", "wrapped_sql": null, "seed_file_path": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_payments.csv"}, "test.jaffle_shop.unique_stg_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(model=ref('stg_customers'), column_name='customer_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "unique_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_stg_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_customers_customer_id", "resource_type": "test", "alias": "unique_stg_customers_customer_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_customers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_customers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/unique_stg_customers_customer_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"stg_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"stg_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"stg_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "customer_id"}}}, "test.jaffle_shop.not_null_stg_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('stg_customers'), column_name='customer_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_stg_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_customers_customer_id", "resource_type": "test", "alias": "not_null_stg_customers_customer_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_customers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_customers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_stg_customers_customer_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_customers\"\nwhere customer_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_customers\"\nwhere customer_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_customers\"\nwhere customer_id is null\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "customer_id"}}}, "test.jaffle_shop.unique_stg_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(model=ref('stg_orders'), column_name='order_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "unique_stg_orders_order_id"], "unique_id": "test.jaffle_shop.unique_stg_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/unique_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_orders_order_id", "resource_type": "test", "alias": "unique_stg_orders_order_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/unique_stg_orders_order_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "column_name": "order_id", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "order_id"}}}, "test.jaffle_shop.not_null_stg_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('stg_orders'), column_name='order_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_stg_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_orders_order_id", "resource_type": "test", "alias": "not_null_stg_orders_order_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_stg_orders_order_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_orders\"\nwhere order_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_orders\"\nwhere order_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_orders\"\nwhere order_id is null\n\n", "column_name": "order_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "order_id"}}}, "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_accepted_values(model=ref('stg_orders'), column_name='status', values=['placed', 'shipped', 'completed', 'return_pending', 'returned']) }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/accepted_values_stg_orders_758238c28b8980ea7fe9d60a8d851ea8.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "alias": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values"], "nodes": ["model.jaffle_shop.stg_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/accepted_values_stg_orders_758238c28b8980ea7fe9d60a8d851ea8.sql", "compiled": true, "compiled_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "wrapped_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"stg_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "column_name": "status", "test_metadata": {"namespace": null, "name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status"}}}, "test.jaffle_shop.unique_stg_payments_payment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(model=ref('stg_payments'), column_name='payment_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "unique_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.unique_stg_payments_payment_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_payments_payment_id", "resource_type": "test", "alias": "unique_stg_payments_payment_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["billing", "schema"], "refs": [["stg_payments"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_payments"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/unique_stg_payments_payment_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n payment_id\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n where payment_id is not null\n group by payment_id\n having count(*) > 1\n\n) validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n payment_id\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n where payment_id is not null\n group by payment_id\n having count(*) > 1\n\n) validation_errors\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n payment_id\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n where payment_id is not null\n group by payment_id\n having count(*) > 1\n\n) validation_errors\n\n", "column_name": "payment_id", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "payment_id"}}}, "test.jaffle_shop.not_null_stg_payments_payment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('stg_payments'), column_name='payment_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.not_null_stg_payments_payment_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_payments_payment_id", "resource_type": "test", "alias": "not_null_stg_payments_payment_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["billing", "schema"], "refs": [["stg_payments"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_payments"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_stg_payments_payment_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_payments\"\nwhere payment_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_payments\"\nwhere payment_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"stg_payments\"\nwhere payment_id is null\n\n", "column_name": "payment_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "payment_id"}}}, "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_accepted_values(model=ref('stg_payments'), column_name='payment_method', values=['credit_card', 'coupon', 'bank_transfer', 'gift_card']) }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "unique_id": "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/accepted_values_stg_payments_944011baab727320a6b119d4d81589ae.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "alias": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values"], "nodes": ["model.jaffle_shop.stg_payments"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/accepted_values_stg_payments_944011baab727320a6b119d4d81589ae.sql", "compiled": true, "compiled_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n payment_method as value_field\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n payment_method as value_field\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "wrapped_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n payment_method as value_field\n\n from \"analytics\".\"test_schema\".\"stg_payments\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "column_name": "payment_method", "test_metadata": {"namespace": null, "name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method"}}}, "test.jaffle_shop.unique_dim_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(model=ref('dim_customers'), column_name='customer_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "unique_dim_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_dim_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/unique_dim_customers_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "unique_dim_customers_customer_id", "resource_type": "test", "alias": "unique_dim_customers_customer_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["dim_customers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.dim_customers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/unique_dim_customers_customer_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"dim_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"dim_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n customer_id\n\n from \"analytics\".\"test_schema\".\"dim_customers\"\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "customer_id"}}}, "test.jaffle_shop.not_null_dim_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('dim_customers'), column_name='customer_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_dim_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_dim_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_dim_customers_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_dim_customers_customer_id", "resource_type": "test", "alias": "not_null_dim_customers_customer_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["dim_customers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.dim_customers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_dim_customers_customer_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"dim_customers\"\nwhere customer_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"dim_customers\"\nwhere customer_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"dim_customers\"\nwhere customer_id is null\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "customer_id"}}}, "test.jaffle_shop.unique_fct_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(model=ref('fct_orders'), column_name='order_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "unique_fct_orders_order_id"], "unique_id": "test.jaffle_shop.unique_fct_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/unique_fct_orders_order_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "unique_fct_orders_order_id", "resource_type": "test", "alias": "unique_fct_orders_order_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/unique_fct_orders_order_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom (\n\n select\n order_id\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n", "column_name": "order_id", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "order_id"}}}, "test.jaffle_shop.not_null_fct_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='order_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_fct_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_order_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_order_id", "resource_type": "test", "alias": "not_null_fct_orders_order_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_order_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere order_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere order_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere order_id is null\n\n", "column_name": "order_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "order_id"}}}, "test.jaffle_shop.not_null_fct_orders_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='customer_id') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_customer_id"], "unique_id": "test.jaffle_shop.not_null_fct_orders_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_customer_id", "resource_type": "test", "alias": "not_null_fct_orders_customer_id", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_customer_id.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere customer_id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere customer_id is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere customer_id is null\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "customer_id"}}}, "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_relationships(model=ref('fct_orders'), column_name='customer_id', field='customer_id', to=ref('dim_customers')) }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_"], "unique_id": "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/relationships_fct_orders_535c445ac9111d4713c286f097da3132.sql", "original_file_path": "models/marts/core/schema.yml", "name": "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "resource_type": "test", "alias": "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"], ["dim_customers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_relationships"], "nodes": ["model.jaffle_shop.fct_orders", "model.jaffle_shop.dim_customers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/relationships_fct_orders_535c445ac9111d4713c286f097da3132.sql", "compiled": true, "compiled_sql": "\n\n\n\n\nselect count(*)\nfrom (\n select customer_id as id from \"analytics\".\"test_schema\".\"fct_orders\"\n) as child\nleft join (\n select customer_id as id from \"analytics\".\"test_schema\".\"dim_customers\"\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\n\nselect count(*)\nfrom (\n select customer_id as id from \"analytics\".\"test_schema\".\"fct_orders\"\n) as child\nleft join (\n select customer_id as id from \"analytics\".\"test_schema\".\"dim_customers\"\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n", "wrapped_sql": "\n\n\n\n\nselect count(*)\nfrom (\n select customer_id as id from \"analytics\".\"test_schema\".\"fct_orders\"\n) as child\nleft join (\n select customer_id as id from \"analytics\".\"test_schema\".\"dim_customers\"\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n", "column_name": "customer_id", "test_metadata": {"namespace": null, "name": "relationships", "kwargs": {"to": "ref('dim_customers')", "field": "customer_id", "column_name": "customer_id"}}}, "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_accepted_values(model=ref('fct_orders'), column_name='status', values=['placed', 'shipped', 'completed', 'return_pending', 'returned']) }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/accepted_values_fct_orders_758238c28b8980ea7fe9d60a8d851ea8.sql", "original_file_path": "models/marts/core/schema.yml", "name": "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "alias": "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/accepted_values_fct_orders_758238c28b8980ea7fe9d60a8d851ea8.sql", "compiled": true, "compiled_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "wrapped_sql": "\n\n\n\n\nwith all_values as (\n\n select distinct\n status as value_field\n\n from \"analytics\".\"test_schema\".\"fct_orders\"\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n", "column_name": "status", "test_metadata": {"namespace": null, "name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status"}}}, "test.jaffle_shop.not_null_fct_orders_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='amount') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_amount", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_amount", "resource_type": "test", "alias": "not_null_fct_orders_amount", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_amount.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere amount is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere amount is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere amount is null\n\n", "column_name": "amount", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "amount"}}}, "test.jaffle_shop.not_null_fct_orders_credit_card_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='credit_card_amount') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_credit_card_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_credit_card_amount", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_credit_card_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_credit_card_amount", "resource_type": "test", "alias": "not_null_fct_orders_credit_card_amount", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_credit_card_amount.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere credit_card_amount is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere credit_card_amount is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere credit_card_amount is null\n\n", "column_name": "credit_card_amount", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "credit_card_amount"}}}, "test.jaffle_shop.not_null_fct_orders_coupon_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='coupon_amount') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_coupon_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_coupon_amount", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_coupon_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_coupon_amount", "resource_type": "test", "alias": "not_null_fct_orders_coupon_amount", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_coupon_amount.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere coupon_amount is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere coupon_amount is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere coupon_amount is null\n\n", "column_name": "coupon_amount", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "coupon_amount"}}}, "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='bank_transfer_amount') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_bank_transfer_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_bank_transfer_amount", "resource_type": "test", "alias": "not_null_fct_orders_bank_transfer_amount", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_bank_transfer_amount.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere bank_transfer_amount is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere bank_transfer_amount is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere bank_transfer_amount is null\n\n", "column_name": "bank_transfer_amount", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "bank_transfer_amount"}}}, "test.jaffle_shop.not_null_fct_orders_gift_card_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(model=ref('fct_orders'), column_name='gift_card_amount') }}", "database": "analytics", "schema": "test_schema", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_gift_card_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_gift_card_amount", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "schema_test/not_null_fct_orders_gift_card_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_gift_card_amount", "resource_type": "test", "alias": "not_null_fct_orders_gift_card_amount", "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "tags": [], "severity": "ERROR"}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/jaffle_shop/schema_test/not_null_fct_orders_gift_card_amount.sql", "compiled": true, "compiled_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere gift_card_amount is null\n\n", "extra_ctes_injected": true, "extra_ctes": [], "injected_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere gift_card_amount is null\n\n", "wrapped_sql": "\n\n\n\nselect count(*)\nfrom \"analytics\".\"test_schema\".\"fct_orders\"\nwhere gift_card_amount is null\n\n", "column_name": "gift_card_amount", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "gift_card_amount"}}}, "source.jaffle_shop.payments.orders": {"fqn": ["jaffle_shop", "payments", "orders"], "database": "analytics", "schema": "test_schema", "unique_id": "source.jaffle_shop.payments.orders", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "models/staging/schema.yml", "original_file_path": "models/staging/schema.yml", "name": "orders", "source_name": "payments", "source_description": "", "loader": "", "identifier": "raw_orders", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": {"location": null, "file_format": null, "row_format": null, "tbl_properties": null, "partitions": null}, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": []}}, "macros": {"macro.dbt.statement": {"raw_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set status, res = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}\n\n{% macro noop_statement(name=None, status=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_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "resource_type": "macro", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set status, res = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.noop_statement": {"raw_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set status, res = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}\n\n{% macro noop_statement(name=None, status=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_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "resource_type": "macro", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, status=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_result(name, status=status, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.run_hooks": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.column_list": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.column_list", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "column_list", "macro_sql": "{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.column_list_for_create_table": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.column_list_for_create_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "column_list_for_create_table", "macro_sql": "{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.make_hook_config": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.before_begin": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.in_transaction": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.after_commit": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.drop_relation_if_exists": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.load_relation": {"raw_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 %}\n\n\n{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}\n\n\n{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}\n\n\n{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}\n\n\n{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}\n\n\n{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}\n\n\n{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "resource_type": "macro", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_merge_sql": {"raw_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter_macro('snapshot_merge_sql', target, source, insert_cols) }}\n{%- endmacro %}\n\n\n{% 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 = 'update'\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 %}", "unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "resource_type": "macro", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter_macro('snapshot_merge_sql', target, source, insert_cols) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_merge_sql": {"raw_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter_macro('snapshot_merge_sql', target, source, insert_cols) }}\n{%- endmacro %}\n\n\n{% 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 = 'update'\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 %}", "unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "resource_type": "macro", "name": "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 = 'update'\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.strategy_dispatch": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_hash_arguments": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_hash_arguments": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_get_time": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_get_time": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_timestamp_strategy": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_string_as_time": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_string_as_time": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_check_all_get_existing_columns": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_check_strategy": {"raw_sql": "{#\n Dispatch strategies by name, optionally qualified to a package\n#}\n{% 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 %}\n\n\n{#\n Create SCD Hash SQL fields cross-db\n#}\n{% macro snapshot_hash_arguments(args) -%}\n {{ adapter_macro('snapshot_hash_arguments', args) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{#\n Get the current time cross-db\n#}\n{% macro snapshot_get_time() -%}\n {{ adapter_macro('snapshot_get_time') }}\n{%- endmacro %}\n\n{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}\n\n\n{#\n Core strategy definitions\n#}\n{% 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\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ updated_at }} < {{ 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 }) %}\n{% endmacro %}\n\n\n{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter_macro('snapshot_string_as_time', timestamp) }}\n{%- endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['injected_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}\n\n\n{% 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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "resource_type": "macro", "name": "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 select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {# don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)\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 }) %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_columns": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_columns": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.post_snapshot": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__post_snapshot": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_staging_table_inserts": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.snapshot_staging_table_inserts", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "snapshot_staging_table_inserts", "macro_sql": "{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_staging_table_updates": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.snapshot_staging_table_updates", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "snapshot_staging_table_updates", "macro_sql": "{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.build_snapshot_table": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "build_snapshot_table", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_or_create_relation": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "get_or_create_relation", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.build_snapshot_staging_table": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_snapshot_default": {"raw_sql": "{#\n Add new columns to the table if applicable\n#}\n{% macro create_columns(relation, columns) %}\n {{ adapter_macro('create_columns', relation, columns) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro post_snapshot(staging_relation) %}\n {{ adapter_macro('post_snapshot', staging_relation) }}\n{% endmacro %}\n\n{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}\n\n\n{% macro snapshot_staging_table_inserts(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\n ),\n\n source_data as (\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from 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 snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n )\n\n select * from insertions\n\n{%- endmacro %}\n\n\n{% macro snapshot_staging_table_updates(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\n ),\n\n source_data as (\n\n select\n *,\n {{ strategy.scd_id }} as dbt_scd_id,\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\n from snapshot_query\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n snapshotted_data.dbt_scd_id,\n source_data.dbt_valid_from as dbt_valid_to\n\n from source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_valid_to is null\n and (\n {{ strategy.row_changed }}\n )\n\n )\n\n select * from updates\n\n{%- endmacro %}\n\n\n{% macro 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 %}\n\n\n{% macro 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 %}\n\n{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set inserts_select = snapshot_staging_table_inserts(strategy, sql, target_relation) %}\n {% set updates_select = snapshot_staging_table_updates(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation_inserts') %}\n {{ create_table_as(True, tmp_relation, inserts_select) }}\n {% endcall %}\n\n {% call statement('build_snapshot_staging_relation_updates') %}\n insert into {{ tmp_relation }} (dbt_change_type, dbt_scd_id, dbt_valid_to)\n select dbt_change_type, dbt_scd_id, dbt_valid_to from (\n {{ updates_select }}\n ) dbt_sbq\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n\n{% 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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "resource_type": "macro", "name": "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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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['injected_sql']) %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, build_sql) }}\n {% endcall %}\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 {% call statement('main') %}\n {{ snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n }}\n {% endcall %}\n\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_csv_table": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.reset_csv_table": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.load_csv_rows": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_csv_table": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__reset_csv_table": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_seed_column_quoted_csv": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.basic_load_csv_rows": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.basic_load_csv_rows", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "basic_load_csv_rows", "macro_sql": "{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__load_csv_rows": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_seed_default": {"raw_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter_macro('create_csv_table', model, agate_table) }}\n{%- endmacro %}\n\n{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter_macro('reset_csv_table', model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}\n\n{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter_macro('load_csv_rows', model, agate_table) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% 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 %}\n\n\n{% macro basic_load_csv_rows(model, batch_size, 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 %s\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 %}\n\n\n{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}\n\n\n{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "resource_type": "macro", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\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 agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', status='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 status = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set num_rows = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', status ~ ' ' ~ num_rows) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\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 {% set target_relation = this.incorporate(type='table') %}\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.incremental_upsert": {"raw_sql": "{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}", "unique_id": "macro.dbt.incremental_upsert", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/incremental/helpers.sql", "original_file_path": "macros/materializations/incremental/helpers.sql", "resource_type": "macro", "name": "incremental_upsert", "macro_sql": "{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_incremental_default": {"raw_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n {% set full_refresh_mode = flags.FULL_REFRESH %}\n\n {% set target_relation = this %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(this) %}\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 {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or full_refresh_mode %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set backup_identifier = existing_relation.identifier ~ \"__dbt_backup\" %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\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 %}", "unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/incremental/incremental.sql", "original_file_path": "macros/materializations/incremental/incremental.sql", "resource_type": "macro", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n {% set full_refresh_mode = flags.FULL_REFRESH %}\n\n {% set target_relation = this %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(this) %}\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 {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or full_refresh_mode %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set backup_identifier = existing_relation.identifier ~ \"__dbt_backup\" %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_merge_sql": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_delete_insert_merge_sql": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_merge_sql": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_quoted_csv": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\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{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.common_get_delete_insert_merge_sql": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.common_get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "common_get_delete_insert_merge_sql", "macro_sql": "{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_delete_insert_merge_sql": {"raw_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter_macro('get_merge_sql', target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}\n\n\n{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter_macro('get_delete_insert_merge_sql', target, source, unique_key, dest_columns) }}\n{%- endmacro %}\n\n\n{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\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 {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}\n\n\n{% macro get_quoted_csv(column_names) %}\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{% endmacro %}\n\n\n{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}\n\n{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "resource_type": "macro", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_table_default": {"raw_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\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\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(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 {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_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 -- `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 %}", "unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/table/table.sql", "original_file_path": "macros/materializations/table/table.sql", "resource_type": "macro", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\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\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(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 {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_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 -- `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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_view_default": {"raw_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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 -%}", "unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/view/view.sql", "original_file_path": "macros/materializations/view/view.sql", "resource_type": "macro", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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 -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.handle_existing_table": {"raw_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter_macro(\"dbt.handle_existing_table\", full_refresh, old_relation) }}\n{% endmacro %}\n\n{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}\n\n{# /*\n Core materialization implementation. BigQuery and Snowflake are similar\n because both can use `create or replace view` where the resulting view schema\n is not necessarily the same as the existing view. On Redshift, this would\n result in: ERROR: cannot change number of columns in view\n\n This implementation is superior to the create_temp, swap_with_existing, drop_old\n paradigm because transactions don't run DDL queries atomically on Snowflake. By using\n `create or replace view`, the materialization becomes atomic in nature.\n */\n#}\n\n{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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(flags.FULL_REFRESH, old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "resource_type": "macro", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter_macro(\"dbt.handle_existing_table\", full_refresh, old_relation) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__handle_existing_table": {"raw_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter_macro(\"dbt.handle_existing_table\", full_refresh, old_relation) }}\n{% endmacro %}\n\n{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}\n\n{# /*\n Core materialization implementation. BigQuery and Snowflake are similar\n because both can use `create or replace view` where the resulting view schema\n is not necessarily the same as the existing view. On Redshift, this would\n result in: ERROR: cannot change number of columns in view\n\n This implementation is superior to the create_temp, swap_with_existing, drop_old\n paradigm because transactions don't run DDL queries atomically on Snowflake. By using\n `create or replace view`, the materialization becomes atomic in nature.\n */\n#}\n\n{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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(flags.FULL_REFRESH, old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "resource_type": "macro", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_or_replace_view": {"raw_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter_macro(\"dbt.handle_existing_table\", full_refresh, old_relation) }}\n{% endmacro %}\n\n{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}\n\n{# /*\n Core materialization implementation. BigQuery and Snowflake are similar\n because both can use `create or replace view` where the resulting view schema\n is not necessarily the same as the existing view. On Redshift, this would\n result in: ERROR: cannot change number of columns in view\n\n This implementation is superior to the create_temp, swap_with_existing, drop_old\n paradigm because transactions don't run DDL queries atomically on Snowflake. By using\n `create or replace view`, the materialization becomes atomic in nature.\n */\n#}\n\n{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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(flags.FULL_REFRESH, old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "resource_type": "macro", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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(flags.FULL_REFRESH, old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.generate_alias_name": {"raw_sql": "{#\n Renders a alias name given a custom alias name. If the custom\n alias name is none, then the resulting alias is just the filename of the\n model. If an alias override is specified, then that is used.\n\n This macro can be overriden in projects to define different semantics\n for rendering a alias name.\n\n Arguments:\n custom_alias_name: The custom alias name specified for a model, or none\n node: The available node that an alias is being generated for, or none\n\n#}\n{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_custom_alias.sql", "original_file_path": "macros/etc/get_custom_alias.sql", "resource_type": "macro", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.run_query": {"raw_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 %}", "unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/query.sql", "original_file_path": "macros/etc/query.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.is_incremental": {"raw_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 flags.FULL_REFRESH) }}\n {% endif %}\n{% endmacro %}", "unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/is_incremental.sql", "original_file_path": "macros/etc/is_incremental.sql", "resource_type": "macro", "name": "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 flags.FULL_REFRESH) }}\n {% endif %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.table_options": {"raw_sql": "{% macro table_options() %}\n {%- set raw_persist_docs = config.get('persist_docs', {}) -%}\n\n{%- endmacro -%}\n\n{% macro get_relation_comment(persist_docs, model) %}\n\n {%- if persist_docs is not mapping -%}\n {{ exceptions.raise_compiler_error(\"Invalid value provided for 'persist_docs'. Expected dict but got value: \" ~ raw_persist_docs) }}\n {% endif %}\n\n {% if persist_docs.get('relation', false) %}\n {{ return((model.description | tojson)[1:-1]) }}\n {%- else -%}\n {{ return(none) }}\n {% endif %}\n\n{% endmacro %}", "unique_id": "macro.dbt.table_options", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_relation_comment.sql", "original_file_path": "macros/etc/get_relation_comment.sql", "resource_type": "macro", "name": "table_options", "macro_sql": "{% macro table_options() %}\n {%- set raw_persist_docs = config.get('persist_docs', {}) -%}\n\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_relation_comment": {"raw_sql": "{% macro table_options() %}\n {%- set raw_persist_docs = config.get('persist_docs', {}) -%}\n\n{%- endmacro -%}\n\n{% macro get_relation_comment(persist_docs, model) %}\n\n {%- if persist_docs is not mapping -%}\n {{ exceptions.raise_compiler_error(\"Invalid value provided for 'persist_docs'. Expected dict but got value: \" ~ raw_persist_docs) }}\n {% endif %}\n\n {% if persist_docs.get('relation', false) %}\n {{ return((model.description | tojson)[1:-1]) }}\n {%- else -%}\n {{ return(none) }}\n {% endif %}\n\n{% endmacro %}", "unique_id": "macro.dbt.get_relation_comment", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_relation_comment.sql", "original_file_path": "macros/etc/get_relation_comment.sql", "resource_type": "macro", "name": "get_relation_comment", "macro_sql": "{% macro get_relation_comment(persist_docs, model) %}\n\n {%- if persist_docs is not mapping -%}\n {{ exceptions.raise_compiler_error(\"Invalid value provided for 'persist_docs'. Expected dict but got value: \" ~ raw_persist_docs) }}\n {% endif %}\n\n {% if persist_docs.get('relation', false) %}\n {{ return((model.description | tojson)[1:-1]) }}\n {%- else -%}\n {{ return(none) }}\n {% endif %}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.convert_datetime": {"raw_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 %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% 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 %}", "unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.dates_in_range": {"raw_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 %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% 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 %}", "unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.partition_range": {"raw_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 %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% 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 %}", "unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.py_current_timestring": {"raw_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 %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% 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 %}", "unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.generate_schema_name": {"raw_sql": "{#\n Renders a schema name given a custom schema name. If the custom\n schema name is none, then the resulting schema is just the \"schema\"\n value in the specified target. If a schema override is specified, then\n the resulting schema is the default schema concatenated with the\n custom schema.\n\n This macro can be overriden in projects to define different semantics\n for rendering a schema name.\n\n Arguments:\n custom_schema_name: The custom schema name specified for a model, or none\n node: The node the schema is being generated for\n\n#}\n{% macro 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 %}\n\n\n{#\n Renders a schema name given a custom schema name. In production, this macro\n will render out the overriden schema name for a model. Otherwise, the default\n schema specified in the active target is used.\n\n Arguments:\n custom_schema_name: The custom schema name specified for a model, or none\n node: The node the schema is being generated for\n\n#}\n{% 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 %}", "unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "resource_type": "macro", "name": "generate_schema_name", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.generate_schema_name_for_env": {"raw_sql": "{#\n Renders a schema name given a custom schema name. If the custom\n schema name is none, then the resulting schema is just the \"schema\"\n value in the specified target. If a schema override is specified, then\n the resulting schema is the default schema concatenated with the\n custom schema.\n\n This macro can be overriden in projects to define different semantics\n for rendering a schema name.\n\n Arguments:\n custom_schema_name: The custom schema name specified for a model, or none\n node: The node the schema is being generated for\n\n#}\n{% macro 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 %}\n\n\n{#\n Renders a schema name given a custom schema name. In production, this macro\n will render out the overriden schema name for a model. Otherwise, the default\n schema specified in the active target is used.\n\n Arguments:\n custom_schema_name: The custom schema name specified for a model, or none\n node: The node the schema is being generated for\n\n#}\n{% 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 %}", "unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.generate_database_name": {"raw_sql": "{#\n Renders a database name given a custom database name. If the custom\n database name is none, then the resulting database is just the \"database\"\n value in the specified target. If a database override is specified, then\n the resulting database is the default database concatenated with the\n custom database.\n\n This macro can be overriden in projects to define different semantics\n for rendering a database name.\n\n Arguments:\n custom_database_name: The custom database name specified for a model, or none\n node: The node the database is being generated for\n\n#}\n{% macro 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 %}", "unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "resource_type": "macro", "name": "generate_database_name", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.adapter_macro": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.adapter_macro", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "adapter_macro", "macro_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_columns_in_query": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_columns_in_query": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_schema": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "create_schema", "macro_sql": "{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_schema": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.drop_schema": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "drop_schema", "macro_sql": "{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__drop_schema": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_table_as": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_table_as": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 as (\n {{ sql }}\n );\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.create_view_as": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_view_as": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 }} as (\n {{ sql }}\n );\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_catalog": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": ["macro.dbt.adapter_macro"]}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_catalog": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.get_columns_in_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.sql_convert_columns_in_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_columns_in_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.alter_column_type": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__alter_column_type": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.drop_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__drop_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.truncate_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__truncate_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.rename_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__rename_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.information_schema_name": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__information_schema_name": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.list_schemas": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__list_schemas": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.check_schema_exists": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__check_schema_exists": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.list_relations_without_caching": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__list_relations_without_caching": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.current_timestamp": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__current_timestamp": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.collect_freshness": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__collect_freshness": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "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').table) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.make_temp_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.default__make_temp_relation": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.set_sql_header": {"raw_sql": "{% macro adapter_macro(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 In adapter_macro: 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 separator = '__' -%}\n {%- set search_name = adapter.type() + separator + name -%}\n {%- set default_name = 'default' + separator + name -%}\n\n {%- if package_context.get(search_name) is not none -%}\n {{ return(package_context[search_name](*varargs, **kwargs)) }}\n {%- else -%}\n {{ return(package_context[default_name](*varargs, **kwargs)) }}\n {%- endif -%}\n{%- endmacro %}\n\n{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter_macro('get_columns_in_query', select_sql)) }}\n{% endmacro %}\n\n{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}\n\n{% macro create_schema(database_name, schema_name) -%}\n {{ adapter_macro('create_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__create_schema(database_name, schema_name) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{database_name}}.{{schema_name}}\n {% endcall %}\n{% endmacro %}\n\n{% macro drop_schema(database_name, schema_name) -%}\n {{ adapter_macro('drop_schema', database_name, schema_name) }}\n{% endmacro %}\n\n{% macro default__drop_schema(database_name, schema_name) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{database_name}}.{{schema_name}} cascade\n {% endcall %}\n{% endmacro %}\n\n{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter_macro('create_table_as', temporary, relation, sql) }}\n{%- endmacro %}\n\n{% 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 as (\n {{ sql }}\n );\n{% endmacro %}\n\n{% macro create_view_as(relation, sql) -%}\n {{ adapter_macro('create_view_as', relation, sql) }}\n{%- endmacro %}\n\n{% 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 }} as (\n {{ sql }}\n );\n{% endmacro %}\n\n\n{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter_macro('get_catalog', information_schema, schemas)) }}\n{%- endmacro %}\n\n{% 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 %}\n\n\n{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter_macro('get_columns_in_relation', relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n{% 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 %}\n\n{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter_macro('alter_column_type', relation, column_name, new_column_type)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro drop_relation(relation) -%}\n {{ return(adapter_macro('drop_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}\n\n{% macro truncate_relation(relation) -%}\n {{ return(adapter_macro('truncate_relation', relation)) }}\n{% endmacro %}\n\n\n{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}\n\n{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter_macro('rename_relation', from_relation, to_relation)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro information_schema_name(database) %}\n {{ return(adapter_macro('information_schema_name', database)) }}\n{% endmacro %}\n\n{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ adapter.quote_as_configured(database, 'database') }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}\n\n\n{% macro list_schemas(database) -%}\n {{ return(adapter_macro('list_schemas', database)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter_macro('check_schema_exists', information_schema, schema)) }}\n{% endmacro %}\n\n{% 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 %}\n\n\n{% macro list_relations_without_caching(information_schema, schema) %}\n {{ return(adapter_macro('list_relations_without_caching', information_schema, schema)) }}\n{% endmacro %}\n\n\n{% macro default__list_relations_without_caching(information_schema, schema) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}\n\n\n{% macro current_timestamp() -%}\n {{ adapter_macro('current_timestamp') }}\n{%- endmacro %}\n\n\n{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}\n\n\n{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter_macro('collect_freshness', source, loaded_at_field, filter))}}\n{% endmacro %}\n\n\n{% 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').table) }}\n{% endmacro %}\n\n{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter_macro('make_temp_relation', base_relation, suffix))}}\n{% endmacro %}\n\n{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}\n\n{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "resource_type": "macro", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.test_relationships": {"raw_sql": "{% macro test_relationships(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nselect count(*)\nfrom (\n select {{ column_name }} as id from {{ model }}\n) as child\nleft join (\n select {{ field }} as id from {{ to }}\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n{% endmacro %}", "unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "resource_type": "macro", "name": "test_relationships", "macro_sql": "{% macro test_relationships(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nselect count(*)\nfrom (\n select {{ column_name }} as id from {{ model }}\n) as child\nleft join (\n select {{ field }} as id from {{ to }}\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.test_not_null": {"raw_sql": "{% macro test_not_null(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "resource_type": "macro", "name": "test_not_null", "macro_sql": "{% macro test_not_null(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.test_unique": {"raw_sql": "{% macro test_unique(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom (\n\n select\n {{ column_name }}\n\n from {{ model }}\n where {{ column_name }} is not null\n group by {{ column_name }}\n having count(*) > 1\n\n) validation_errors\n\n{% endmacro %}", "unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "resource_type": "macro", "name": "test_unique", "macro_sql": "{% macro test_unique(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom (\n\n select\n {{ column_name }}\n\n from {{ model }}\n where {{ column_name }} is not null\n group by {{ column_name }}\n having count(*) > 1\n\n) validation_errors\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt.test_accepted_values": {"raw_sql": "{% macro test_accepted_values(model, values) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n{% set quote_values = kwargs.get('quote', True) %}\n\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 not in (\n {% for value in values -%}\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "resource_type": "macro", "name": "test_accepted_values", "macro_sql": "{% macro test_accepted_values(model, values) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n{% set quote_values = kwargs.get('quote', True) %}\n\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 not in (\n {% for value in values -%}\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__get_catalog": {"raw_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n\n {%- call statement('catalog', fetch_result=True) -%}\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n else 'BASE TABLE'\n end as table_type,\n null::text as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n null::text as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n\n where (\n {%- for schema in schemas -%}\n upper(sch.nspname) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence = 'p' -- [p]ermanent table. Other values are [u]nlogged table, [t]emporary table\n and tbl.relkind in ('r', 'v', 'f', 'p') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table, [m]aterialized view\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n\n{%- endmacro %}", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "resource_type": "macro", "name": "postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n\n {%- call statement('catalog', fetch_result=True) -%}\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n else 'BASE TABLE'\n end as table_type,\n null::text as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n null::text as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n\n where (\n {%- for schema in schemas -%}\n upper(sch.nspname) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence = 'p' -- [p]ermanent table. Other values are [u]nlogged table, [t]emporary table\n and tbl.relkind in ('r', 'v', 'f', 'p') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table, [m]aterialized view\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres_get_relations": {"raw_sql": "{% macro postgres_get_relations () -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "unique_id": "macro.dbt_postgres.postgres_get_relations", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "resource_type": "macro", "name": "postgres_get_relations", "macro_sql": "{% macro postgres_get_relations () -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__create_table_as": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__create_schema": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__create_schema", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__drop_schema": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__information_schema_name": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__list_schemas": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__check_schema_exists": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__current_timestamp": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__snapshot_get_time": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__make_temp_relation": {"raw_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}\n\n{% macro postgres__create_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ schema_name }}\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__drop_schema(database_name, schema_name) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ schema_name }} cascade\n {%- endcall -%}\n{% endmacro %}\n\n{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}\n\n\n{% macro postgres__list_relations_without_caching(information_schema, schema) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ information_schema.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema }}'\n union all\n select\n '{{ information_schema.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}\n\n{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}\n\n{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}\n\n{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}\n\n\n{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}\n\n{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}\n\n\n{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}\n\n{% macro postgres__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 %}", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "resource_type": "macro", "name": "postgres__make_temp_relation", "macro_sql": "{% macro postgres__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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"raw_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ 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 = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text = 'update'::text\n and {{ 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{% endmacro %}", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "package_name": "dbt_postgres", "root_path": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "resource_type": "macro", "name": "postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ 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 = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text = 'update'::text\n and {{ 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{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.jaffle_shop.example_macro": {"raw_sql": "{% macro example_macro(arg_1, arg_2) %}\n\n The provided args are {{ arg_1 }} and {{ arg_2 }}\n\n{% endmacro %}", "unique_id": "macro.jaffle_shop.example_macro", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "macros/example_macro.sql", "original_file_path": "macros/example_macro.sql", "resource_type": "macro", "name": "example_macro", "macro_sql": "{% macro example_macro(arg_1, arg_2) %}\n\n The provided args are {{ arg_1 }} and {{ arg_2 }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "A macro that does a thing", "meta": {}, "patch_path": "macros/macros.yml", "arguments": [{"name": "arg_1", "type": "str", "description": "The first argument"}, {"name": "arg_2", "type": "int", "description": "The second argument"}]}, "macro.dbt_utils.except": {"raw_sql": "{% macro except() %}\n {{ adapter_macro('dbt_utils.except') }}\n{% endmacro %}\n\n\n{% macro default__except() %}\n\n except\n\n{% endmacro %}\n \n{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "resource_type": "macro", "name": "except", "macro_sql": "{% macro except() %}\n {{ adapter_macro('dbt_utils.except') }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__except": {"raw_sql": "{% macro except() %}\n {{ adapter_macro('dbt_utils.except') }}\n{% endmacro %}\n\n\n{% macro default__except() %}\n\n except\n\n{% endmacro %}\n \n{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "resource_type": "macro", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__except": {"raw_sql": "{% macro except() %}\n {{ adapter_macro('dbt_utils.except') }}\n{% endmacro %}\n\n\n{% macro default__except() %}\n\n except\n\n{% endmacro %}\n \n{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "resource_type": "macro", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.replace": {"raw_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ adapter_macro('dbt_utils.replace', field, old_chars, new_chars) }}\n{% endmacro %}\n\n\n{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "resource_type": "macro", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ adapter_macro('dbt_utils.replace', field, old_chars, new_chars) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__replace": {"raw_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ adapter_macro('dbt_utils.replace', field, old_chars, new_chars) }}\n{% endmacro %}\n\n\n{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.concat": {"raw_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}\n\n\n{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}\n\n\n{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}\n\n\n{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}\n\n\n{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "resource_type": "macro", "name": "concat", "macro_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__concat": {"raw_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}\n\n\n{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}\n\n\n{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}\n\n\n{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}\n\n\n{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "resource_type": "macro", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.alternative_concat": {"raw_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}\n\n\n{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}\n\n\n{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}\n\n\n{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}\n\n\n{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.alternative_concat", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "resource_type": "macro", "name": "alternative_concat", "macro_sql": "{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__concat": {"raw_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}\n\n\n{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}\n\n\n{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}\n\n\n{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}\n\n\n{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.redshift__concat", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "resource_type": "macro", "name": "redshift__concat", "macro_sql": "{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__concat": {"raw_sql": "{% macro concat(fields) %}\n {{ adapter_macro('dbt_utils.concat', fields) }}\n{% endmacro %}\n\n\n{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}\n\n\n{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}\n\n\n{% macro redshift__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}\n\n\n{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__concat", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "resource_type": "macro", "name": "snowflake__concat", "macro_sql": "{% macro snowflake__concat(fields) %}\n {{dbt_utils.alternative_concat(fields)}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.identifier": {"raw_sql": "{% macro identifier(value) %}\n {{ adapter_macro('dbt_utils.identifier', value) }}\n{% endmacro %}\n\n{% macro default__identifier(value) -%}\n \"{{ value }}\"\n{%- endmacro %}\n\n{% macro bigquery__identifier(value) -%}\n `{{ value }}`\n{%- endmacro %}", "unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifer.sql", "original_file_path": "macros/cross_db_utils/identifer.sql", "resource_type": "macro", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\n {{ adapter_macro('dbt_utils.identifier', value) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__identifier": {"raw_sql": "{% macro identifier(value) %}\n {{ adapter_macro('dbt_utils.identifier', value) }}\n{% endmacro %}\n\n{% macro default__identifier(value) -%}\n \"{{ value }}\"\n{%- endmacro %}\n\n{% macro bigquery__identifier(value) -%}\n `{{ value }}`\n{%- endmacro %}", "unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifer.sql", "original_file_path": "macros/cross_db_utils/identifer.sql", "resource_type": "macro", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\n \"{{ value }}\"\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__identifier": {"raw_sql": "{% macro identifier(value) %}\n {{ adapter_macro('dbt_utils.identifier', value) }}\n{% endmacro %}\n\n{% macro default__identifier(value) -%}\n \"{{ value }}\"\n{%- endmacro %}\n\n{% macro bigquery__identifier(value) -%}\n `{{ value }}`\n{%- endmacro %}", "unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifer.sql", "original_file_path": "macros/cross_db_utils/identifer.sql", "resource_type": "macro", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\n `{{ value }}`\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_string": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_string": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__type_string": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__type_string": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__type_string": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_timestamp": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_timestamp": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__type_timestamp": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_float": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_float": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_float": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_numeric": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_numeric": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_numeric": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_bigint": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_bigint": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_bigint": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_int": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_int": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_int": {"raw_sql": "{# string ------------------------------------------------- #}\n\n{%- macro type_string() -%}\n {{ adapter_macro('dbt_utils.type_string') }}\n{%- endmacro -%}\n\n{% macro default__type_string() %}\n string\n{% endmacro %}\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n{% macro postgres__type_string() %}\n varchar\n{% endmacro %}\n\n{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}\n\n\n\n{# timestamp ------------------------------------------------- #}\n\n{%- macro type_timestamp() -%}\n {{ adapter_macro('dbt_utils.type_timestamp') }}\n{%- endmacro -%}\n\n{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}\n\n{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}\n\n\n{# float ------------------------------------------------- #}\n\n{%- macro type_float() -%}\n {{ adapter_macro('dbt_utils.type_float') }}\n{%- endmacro -%}\n\n{% macro default__type_float() %}\n float\n{% endmacro %}\n\n{% macro bigquery__type_float() %}\n float64\n{% endmacro %}\n\n{# numeric ------------------------------------------------ #}\n\n{%- macro type_numeric() -%}\n {{ adapter_macro('dbt_utils.type_numeric') }}\n{%- endmacro -%}\n\n{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}\n\n{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}\n\n\n{# bigint ------------------------------------------------- #}\n\n{%- macro type_bigint() -%}\n {{ adapter_macro('dbt_utils.type_bigint') }}\n{%- endmacro -%}\n\n{% macro default__type_bigint() %}\n bigint\n{% endmacro %}\n\n{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}\n\n{# int ------------------------------------------------- #}\n\n{%- macro type_int() -%}\n {{ adapter_macro('dbt_utils.type_int') }}\n{%- endmacro -%}\n\n{% macro default__type_int() %}\n int\n{% endmacro %}\n\n{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "resource_type": "macro", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils._is_relation": {"raw_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 %}", "unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "resource_type": "macro", "name": "_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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.length": {"raw_sql": "{% macro length(expression) -%}\n {{ adapter_macro('dbt_utils.length', expression) }}\n{% endmacro %}\n\n\n{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "resource_type": "macro", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ adapter_macro('dbt_utils.length', expression) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__length": {"raw_sql": "{% macro length(expression) -%}\n {{ adapter_macro('dbt_utils.length', expression) }}\n{% endmacro %}\n\n\n{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "resource_type": "macro", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__length": {"raw_sql": "{% macro length(expression) -%}\n {{ adapter_macro('dbt_utils.length', expression) }}\n{% endmacro %}\n\n\n{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "resource_type": "macro", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.dateadd": {"raw_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ adapter_macro('dbt_utils.dateadd', datepart, interval, from_date_or_timestamp) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "resource_type": "macro", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ adapter_macro('dbt_utils.dateadd', datepart, interval, from_date_or_timestamp) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__dateadd": {"raw_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ adapter_macro('dbt_utils.dateadd', datepart, interval, from_date_or_timestamp) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__dateadd": {"raw_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ adapter_macro('dbt_utils.dateadd', datepart, interval, from_date_or_timestamp) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "resource_type": "macro", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__dateadd": {"raw_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ adapter_macro('dbt_utils.dateadd', datepart, interval, from_date_or_timestamp) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "resource_type": "macro", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.intersect": {"raw_sql": "{% macro intersect() %}\n {{ adapter_macro('dbt_utils.intersect') }}\n{% endmacro %}\n\n\n{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}\n\n{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "resource_type": "macro", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ adapter_macro('dbt_utils.intersect') }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__intersect": {"raw_sql": "{% macro intersect() %}\n {{ adapter_macro('dbt_utils.intersect') }}\n{% endmacro %}\n\n\n{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}\n\n{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "resource_type": "macro", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__intersect": {"raw_sql": "{% macro intersect() %}\n {{ adapter_macro('dbt_utils.intersect') }}\n{% endmacro %}\n\n\n{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}\n\n{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "resource_type": "macro", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.right": {"raw_sql": "{% macro right(string_text, length_expression) -%}\n {{ adapter_macro('dbt_utils.right', string_text, length_expression) }}\n{% endmacro %}\n\n{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "resource_type": "macro", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ adapter_macro('dbt_utils.right', string_text, length_expression) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__right": {"raw_sql": "{% macro right(string_text, length_expression) -%}\n {{ adapter_macro('dbt_utils.right', string_text, length_expression) }}\n{% endmacro %}\n\n{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "resource_type": "macro", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__right": {"raw_sql": "{% macro right(string_text, length_expression) -%}\n {{ adapter_macro('dbt_utils.right', string_text, length_expression) }}\n{% endmacro %}\n\n{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "resource_type": "macro", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__right": {"raw_sql": "{% macro right(string_text, length_expression) -%}\n {{ adapter_macro('dbt_utils.right', string_text, length_expression) }}\n{% endmacro %}\n\n{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "resource_type": "macro", "name": "snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.datediff": {"raw_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ adapter_macro('dbt_utils.datediff', first_date, second_date, datepart) }}\n{% endmacro %}\n\n\n{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}\n\n\n{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__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 ({{ dbt_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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 %}", "unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "resource_type": "macro", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ adapter_macro('dbt_utils.datediff', first_date, second_date, datepart) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__datediff": {"raw_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ adapter_macro('dbt_utils.datediff', first_date, second_date, datepart) }}\n{% endmacro %}\n\n\n{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}\n\n\n{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__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 ({{ dbt_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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 %}", "unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__datediff": {"raw_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ adapter_macro('dbt_utils.datediff', first_date, second_date, datepart) }}\n{% endmacro %}\n\n\n{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}\n\n\n{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__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 ({{ dbt_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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 %}", "unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "resource_type": "macro", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__datediff": {"raw_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ adapter_macro('dbt_utils.datediff', first_date, second_date, datepart) }}\n{% endmacro %}\n\n\n{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}\n\n\n{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}\n\n\n{% macro postgres__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 ({{ dbt_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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 %}", "unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "resource_type": "macro", "name": "postgres__datediff", "macro_sql": "{% macro postgres__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 ({{ dbt_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.safe_cast": {"raw_sql": "{% macro safe_cast(field, type) %}\n {{ adapter_macro('dbt_utils.safe_cast', field, type) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}\n\n\n{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "resource_type": "macro", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ adapter_macro('dbt_utils.safe_cast', field, type) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__safe_cast": {"raw_sql": "{% macro safe_cast(field, type) %}\n {{ adapter_macro('dbt_utils.safe_cast', field, type) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}\n\n\n{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__safe_cast": {"raw_sql": "{% macro safe_cast(field, type) %}\n {{ adapter_macro('dbt_utils.safe_cast', field, type) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}\n\n\n{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "resource_type": "macro", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__safe_cast": {"raw_sql": "{% macro safe_cast(field, type) %}\n {{ adapter_macro('dbt_utils.safe_cast', field, type) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}\n\n\n{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "resource_type": "macro", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.hash": {"raw_sql": "{% macro hash(field) -%}\n {{ adapter_macro('dbt_utils.hash', field) }}\n{%- endmacro %}\n\n\n{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}\n\n\n{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "resource_type": "macro", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ adapter_macro('dbt_utils.hash', field) }}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__hash": {"raw_sql": "{% macro hash(field) -%}\n {{ adapter_macro('dbt_utils.hash', field) }}\n{%- endmacro %}\n\n\n{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}\n\n\n{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "resource_type": "macro", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__hash": {"raw_sql": "{% macro hash(field) -%}\n {{ adapter_macro('dbt_utils.hash', field) }}\n{%- endmacro %}\n\n\n{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}\n\n\n{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "resource_type": "macro", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.position": {"raw_sql": "{% macro position(substring_text, string_text) -%}\n {{ adapter_macro('dbt_utils.position', substring_text, string_text) }}\n{% endmacro %}\n\n\n{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "resource_type": "macro", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ adapter_macro('dbt_utils.position', substring_text, string_text) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__position": {"raw_sql": "{% macro position(substring_text, string_text) -%}\n {{ adapter_macro('dbt_utils.position', substring_text, string_text) }}\n{% endmacro %}\n\n\n{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "resource_type": "macro", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__position": {"raw_sql": "{% macro position(substring_text, string_text) -%}\n {{ adapter_macro('dbt_utils.position', substring_text, string_text) }}\n{% endmacro %}\n\n\n{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "resource_type": "macro", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.string_literal": {"raw_sql": "{%- macro string_literal(value) -%}\n {{ adapter_macro('dbt_utils.string_literal', value) }}\n{%- endmacro -%}\n\n{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "resource_type": "macro", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ adapter_macro('dbt_utils.string_literal', value) }}\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__string_literal": {"raw_sql": "{%- macro string_literal(value) -%}\n {{ adapter_macro('dbt_utils.string_literal', value) }}\n{%- endmacro -%}\n\n{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "resource_type": "macro", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.current_timestamp": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__current_timestamp": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__current_timestamp": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__current_timestamp": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.current_timestamp_in_utc": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__current_timestamp_in_utc": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__current_timestamp_in_utc": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "snowflake__current_timestamp_in_utc", "macro_sql": "{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__current_timestamp_in_utc": {"raw_sql": "{% macro current_timestamp() %}\n {{ adapter_macro('dbt_utils.current_timestamp') }}\n{% endmacro %}\n\n{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}\n\n{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}\n\n\n\n{% macro current_timestamp_in_utc() %}\n {{ adapter_macro('dbt_utils.current_timestamp_in_utc') }}\n{% endmacro %}\n\n{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}\n\n{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}\n\n{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "unique_id": "macro.dbt_utils.postgres__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "resource_type": "macro", "name": "postgres__current_timestamp_in_utc", "macro_sql": "{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.width_bucket": {"raw_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ adapter_macro('dbt_utils.width_bucket', expr, min_value, max_value, num_buckets) }}\n{% endmacro %}\n\n\n{% 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_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro redshift__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 exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "resource_type": "macro", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ adapter_macro('dbt_utils.width_bucket', expr, min_value, max_value, num_buckets) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__width_bucket": {"raw_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ adapter_macro('dbt_utils.width_bucket', expr, min_value, max_value, num_buckets) }}\n{% endmacro %}\n\n\n{% 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_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro redshift__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 exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "resource_type": "macro", "name": "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_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__width_bucket": {"raw_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ adapter_macro('dbt_utils.width_bucket', expr, min_value, max_value, num_buckets) }}\n{% endmacro %}\n\n\n{% 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_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro redshift__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 exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "resource_type": "macro", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__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 exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__width_bucket": {"raw_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ adapter_macro('dbt_utils.width_bucket', expr, min_value, max_value, num_buckets) }}\n{% endmacro %}\n\n\n{% 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_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro redshift__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 exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.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 %}\n\n{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.last_day": {"raw_sql": "/*\nThis function has been tested with dateparts of month and quarters. Further\ntesting is required to validate that it will work on other dateparts.\n*/\n\n{% macro last_day(date, datepart) %}\n {{ adapter_macro('dbt_utils.last_day', date, datepart) }}\n{% endmacro %}\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}\n\n\n{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "resource_type": "macro", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ adapter_macro('dbt_utils.last_day', date, datepart) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default_last_day": {"raw_sql": "/*\nThis function has been tested with dateparts of month and quarters. Further\ntesting is required to validate that it will work on other dateparts.\n*/\n\n{% macro last_day(date, datepart) %}\n {{ adapter_macro('dbt_utils.last_day', date, datepart) }}\n{% endmacro %}\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}\n\n\n{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "resource_type": "macro", "name": "default_last_day", "macro_sql": "\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__last_day": {"raw_sql": "/*\nThis function has been tested with dateparts of month and quarters. Further\ntesting is required to validate that it will work on other dateparts.\n*/\n\n{% macro last_day(date, datepart) %}\n {{ adapter_macro('dbt_utils.last_day', date, datepart) }}\n{% endmacro %}\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}\n\n\n{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "resource_type": "macro", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__last_day": {"raw_sql": "/*\nThis function has been tested with dateparts of month and quarters. Further\ntesting is required to validate that it will work on other dateparts.\n*/\n\n{% macro last_day(date, datepart) %}\n {{ adapter_macro('dbt_utils.last_day', date, datepart) }}\n{% endmacro %}\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}\n\n\n{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "resource_type": "macro", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.split_part": {"raw_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ adapter_macro('dbt_utils.split_part', string_text, delimiter_text, part_number) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "resource_type": "macro", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ adapter_macro('dbt_utils.split_part', string_text, delimiter_text, part_number) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__split_part": {"raw_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ adapter_macro('dbt_utils.split_part', string_text, delimiter_text, part_number) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "resource_type": "macro", "name": "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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__split_part": {"raw_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ adapter_macro('dbt_utils.split_part', string_text, delimiter_text, part_number) }}\n{% endmacro %}\n\n\n{% 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 %}\n\n\n{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "resource_type": "macro", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.date_trunc": {"raw_sql": "{% macro date_trunc(datepart, date) %}\n {{ adapter_macro('dbt_utils.date_trunc', datepart, date) }}\n{% endmacro %}\n\n{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}\n\n{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp), \n {{datepart}}\n )\n \n\n{% endmacro %}", "unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "resource_type": "macro", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) %}\n {{ adapter_macro('dbt_utils.date_trunc', datepart, date) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__date_trunc": {"raw_sql": "{% macro date_trunc(datepart, date) %}\n {{ adapter_macro('dbt_utils.date_trunc', datepart, date) }}\n{% endmacro %}\n\n{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}\n\n{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp), \n {{datepart}}\n )\n \n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "resource_type": "macro", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__date_trunc": {"raw_sql": "{% macro date_trunc(datepart, date) %}\n {{ adapter_macro('dbt_utils.date_trunc', datepart, date) }}\n{% endmacro %}\n\n{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}\n\n{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp), \n {{datepart}}\n )\n \n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "resource_type": "macro", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp), \n {{datepart}}\n )\n \n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_period_boundaries": {"raw_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}\n\n{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}\n\n{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}};\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {%- set rows_inserted = (load_result('main-' ~ i)['status'].split(\" \"))[2] | int -%}\n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement(name='main', status=status_string) -%}\n -- no-op\n {%- endcall %}\n\n{%- endmaterialization %}", "unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "resource_type": "macro", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_period_sql": {"raw_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}\n\n{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}\n\n{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}};\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {%- set rows_inserted = (load_result('main-' ~ i)['status'].split(\" \"))[2] | int -%}\n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement(name='main', status=status_string) -%}\n -- no-op\n {%- endcall %}\n\n{%- endmaterialization %}", "unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "resource_type": "macro", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.materialization_insert_by_period_default": {"raw_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}\n\n{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}\n\n{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}};\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {%- set rows_inserted = (load_result('main-' ~ i)['status'].split(\" \"))[2] | int -%}\n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement(name='main', status=status_string) -%}\n -- no-op\n {%- endcall %}\n\n{%- endmaterialization %}", "unique_id": "macro.dbt_utils.materialization_insert_by_period_default", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "resource_type": "macro", "name": "materialization_insert_by_period_default", "macro_sql": "{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}};\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {%- set rows_inserted = (load_result('main-' ~ i)['status'].split(\" \"))[2] | int -%}\n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement(name='main', status=status_string) -%}\n -- no-op\n {%- endcall %}\n\n{%- endmaterialization %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.pretty_log_format": {"raw_sql": "{% macro pretty_log_format(message) %}\n\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/logger/pretty_log_format.sql", "original_file_path": "macros/logger/pretty_log_format.sql", "resource_type": "macro", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.pretty_time": {"raw_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/logger/pretty_time.sql", "original_file_path": "macros/logger/pretty_time.sql", "resource_type": "macro", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.log_info": {"raw_sql": "{% macro log_info(message) %}\n\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/logger/log_info.sql", "original_file_path": "macros/logger/log_info.sql", "resource_type": "macro", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_intervals_between": {"raw_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.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 %}\n\n\n\n\n{% macro date_spine(datepart, start_date, end_date) %}\n\n/*\ncall as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n)\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_utils.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 %}", "unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/date_spine.sql", "resource_type": "macro", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.date_spine": {"raw_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.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 %}\n\n\n\n\n{% macro date_spine(datepart, start_date, end_date) %}\n\n/*\ncall as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n)\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_utils.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 %}", "unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/date_spine.sql", "resource_type": "macro", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n\n/*\ncall as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n)\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_utils.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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_url_host": {"raw_sql": "{% macro get_url_host(field) -%}\n\n{%- set parsed = \n dbt_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n \n-%}\n\n \n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n \n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "resource_type": "macro", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n\n{%- set parsed = \n dbt_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n \n-%}\n\n \n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n \n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_url_path": {"raw_sql": "{% macro get_url_path(field) -%}\n\n {%- set stripped_url = \n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{dbt_utils.position(\"'/'\", stripped_url)}}, 0),\n {{dbt_utils.position(\"'?'\", stripped_url)}} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt_utils.split_part(\n dbt_utils.right(\n stripped_url, \n dbt_utils.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ), \n \"'?'\", 1\n )\n -%}\n\n {{ dbt_utils.safe_cast(\n parsed_path,\n dbt_utils.type_string()\n )}}\n \n{%- endmacro %}", "unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "resource_type": "macro", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n\n {%- set stripped_url = \n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{dbt_utils.position(\"'/'\", stripped_url)}}, 0),\n {{dbt_utils.position(\"'?'\", stripped_url)}} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt_utils.split_part(\n dbt_utils.right(\n stripped_url, \n dbt_utils.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ), \n \"'?'\", 1\n )\n -%}\n\n {{ dbt_utils.safe_cast(\n parsed_path,\n dbt_utils.type_string()\n )}}\n \n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_url_parameter": {"raw_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "resource_type": "macro", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.haversine_distance": {"raw_sql": "{#\nThis calculates the distance between two sets of latitude and longitude.\nThe formula is from the following blog post:\nhttp://daynebatten.com/2015/09/latitude-longitude-distance-sql/\n\nThe arguments should be float type. \n#}\n\n{% macro haversine_distance(lat1,lon1,lat2,lon2) -%}\n\n 2 * 3961 * asin(sqrt((sin(radians(({{lat2}} - {{lat1}}) / 2))) ^ 2 +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n (sin(radians(({{lon2}} - {{lon1}}) / 2))) ^ 2))\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/geo/haversine_distance.sql", "original_file_path": "macros/geo/haversine_distance.sql", "resource_type": "macro", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1,lon1,lat2,lon2) -%}\n\n 2 * 3961 * asin(sqrt((sin(radians(({{lat2}} - {{lat1}}) / 2))) ^ 2 +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n (sin(radians(({{lon2}} - {{lon1}}) / 2))) ^ 2))\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_equal_rowcount": {"raw_sql": "{% macro test_equal_rowcount(model) %}\n\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\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\nwith a as (\n\n select count(*) as count_a from {{ model }}\n\n),\nb as (\n\n select count(*) as count_b from {{ compare_model }}\n\n),\nfinal as (\n\n select abs(\n (select count_a from a) -\n (select count_b from b)\n )\n as diff_count\n\n)\n\nselect diff_count from final\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "resource_type": "macro", "name": "test_equal_rowcount", "macro_sql": "{% macro test_equal_rowcount(model) %}\n\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\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\nwith a as (\n\n select count(*) as count_a from {{ model }}\n\n),\nb as (\n\n select count(*) as count_b from {{ compare_model }}\n\n),\nfinal as (\n\n select abs(\n (select count_a from a) -\n (select count_b from b)\n )\n as diff_count\n\n)\n\nselect diff_count from final\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_relationships_where": {"raw_sql": "{% macro test_relationships_where(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n{% set from_condition = kwargs.get('from_condition', \"true\") %}\n{% set to_condition = kwargs.get('to_condition', \"true\") %}\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 count(*) from exceptions\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "resource_type": "macro", "name": "test_relationships_where", "macro_sql": "{% macro test_relationships_where(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n{% set from_condition = kwargs.get('from_condition', \"true\") %}\n{% set to_condition = kwargs.get('to_condition', \"true\") %}\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 count(*) from exceptions\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_recency": {"raw_sql": "{% macro test_recency(model, datepart, interval) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n\nselect\n case when count(*) > 0 then 0\n else 1\n end as error_result\nfrom {{model}}\nwhere {{column_name}} >=\n {{dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp())}}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "resource_type": "macro", "name": "test_recency", "macro_sql": "{% macro test_recency(model, datepart, interval) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n\nselect\n case when count(*) > 0 then 0\n else 1\n end as error_result\nfrom {{model}}\nwhere {{column_name}} >=\n {{dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp())}}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_not_constant": {"raw_sql": "{% macro test_not_constant(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\n\nfrom (\n\n select\n count(distinct {{ column_name }})\n\n from {{ model }}\n\n having count(distinct {{ column_name }}) = 1\n\n ) validation_errors\n\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "resource_type": "macro", "name": "test_not_constant", "macro_sql": "{% macro test_not_constant(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\n\nfrom (\n\n select\n count(distinct {{ column_name }})\n\n from {{ model }}\n\n having count(distinct {{ column_name }}) = 1\n\n ) validation_errors\n\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_at_least_one": {"raw_sql": "{% macro test_at_least_one(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom (\n select\n\n count({{ column_name }})\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "resource_type": "macro", "name": "test_at_least_one", "macro_sql": "{% macro test_at_least_one(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom (\n select\n\n count({{ column_name }})\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_unique_combination_of_columns": {"raw_sql": "{% macro test_unique_combination_of_columns(model) %}\n\n{%- set columns = kwargs.get('combination_of_columns', kwargs.get('arg')) %}\n\n{%- set columns_csv=columns | join(', ') %}\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect count(*)\nfrom validation_errors\n\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "resource_type": "macro", "name": "test_unique_combination_of_columns", "macro_sql": "{% macro test_unique_combination_of_columns(model) %}\n\n{%- set columns = kwargs.get('combination_of_columns', kwargs.get('arg')) %}\n\n{%- set columns_csv=columns | join(', ') %}\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect count(*)\nfrom validation_errors\n\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_cardinality_equality": {"raw_sql": "{% macro test_cardinality_equality(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by 1\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by 1\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_utils.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt_utils.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 count(*)\nfrom unioned\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "resource_type": "macro", "name": "test_cardinality_equality", "macro_sql": "{% macro test_cardinality_equality(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by 1\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by 1\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_utils.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt_utils.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 count(*)\nfrom unioned\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_expression_is_true": {"raw_sql": "{% macro test_expression_is_true(model, condition='true') %}\n\n{% set expression = kwargs.get('expression', kwargs.get('arg')) %}\n\nwith meet_condition as (\n\n select * from {{ model }} where {{ condition }}\n\n),\nvalidation_errors as (\n\n select\n *\n from meet_condition\n where not({{expression}})\n\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "resource_type": "macro", "name": "test_expression_is_true", "macro_sql": "{% macro test_expression_is_true(model, condition='true') %}\n\n{% set expression = kwargs.get('expression', kwargs.get('arg')) %}\n\nwith meet_condition as (\n\n select * from {{ model }} where {{ condition }}\n\n),\nvalidation_errors as (\n\n select\n *\n from meet_condition\n where not({{expression}})\n\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_equality": {"raw_sql": "{% macro test_equality(model) %}\n\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-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\n{% set compare_columns = kwargs.get('compare_columns', adapter.get_columns_in_relation(model) | map(attribute='quoted') ) %}\n{% set compare_cols_csv = compare_columns | join(', ') %}\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_utils.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_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select * from a_minus_b\n union all\n select * from b_minus_a\n\n),\n\nfinal as (\n\n select (select count(*) from unioned) +\n (select abs(\n (select count(*) from a_minus_b) -\n (select count(*) from b_minus_a)\n ))\n as count\n\n)\n\nselect count from final\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "resource_type": "macro", "name": "test_equality", "macro_sql": "{% macro test_equality(model) %}\n\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-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\n{% set compare_columns = kwargs.get('compare_columns', adapter.get_columns_in_relation(model) | map(attribute='quoted') ) %}\n{% set compare_cols_csv = compare_columns | join(', ') %}\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_utils.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_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select * from a_minus_b\n union all\n select * from b_minus_a\n\n),\n\nfinal as (\n\n select (select count(*) from unioned) +\n (select abs(\n (select count(*) from a_minus_b) -\n (select count(*) from b_minus_a)\n ))\n as count\n\n)\n\nselect count from final\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"raw_sql": "{% macro test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed') %}\n\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\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 }},\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 }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_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 nore 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 < upper_bound,\n false\n ) as lower_bound_less_than_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_less_than_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect count(*) from validation_errors\n{% endmacro %}", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "resource_type": "macro", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% macro test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed') %}\n\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\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 }},\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 }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_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 nore 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 < upper_bound,\n false\n ) as lower_bound_less_than_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_less_than_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect count(*) from validation_errors\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.nullcheck_table": {"raw_sql": "{% macro nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(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 %}", "unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "resource_type": "macro", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_powers_of_two": {"raw_sql": "{% macro 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 %}\n\n\n{% macro 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 * pow(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 %}", "unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "resource_type": "macro", "name": "get_powers_of_two", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.generate_series": {"raw_sql": "{% macro 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 %}\n\n\n{% macro 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 * pow(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 %}", "unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "resource_type": "macro", "name": "generate_series", "macro_sql": "{% macro 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 * pow(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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_relations_by_prefix": {"raw_sql": "{% macro 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(database, row.table_schema, row.table_name) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}\n\n{% macro get_tables_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {% if execute %}\n {{ log(\"Warning: the `get_tables_by_prefix` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `get_relations_by_prefix` macro instead\", info=True) }}\n {% endif %}\n\n\n {{ return(dbt_utils.get_relations_by_prefix(schema, prefix, exclude, database)) }}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "resource_type": "macro", "name": "get_relations_by_prefix", "macro_sql": "{% macro 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(database, row.table_schema, row.table_name) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_tables_by_prefix": {"raw_sql": "{% macro 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(database, row.table_schema, row.table_name) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}\n\n{% macro get_tables_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {% if execute %}\n {{ log(\"Warning: the `get_tables_by_prefix` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `get_relations_by_prefix` macro instead\", info=True) }}\n {% endif %}\n\n\n {{ return(dbt_utils.get_relations_by_prefix(schema, prefix, exclude, database)) }}\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.get_tables_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "resource_type": "macro", "name": "get_tables_by_prefix", "macro_sql": "{% macro get_tables_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {% if execute %}\n {{ log(\"Warning: the `get_tables_by_prefix` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `get_relations_by_prefix` macro instead\", info=True) }}\n {% endif %}\n\n\n {{ return(dbt_utils.get_relations_by_prefix(schema, prefix, exclude, database)) }}\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_tables_by_prefix_sql": {"raw_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ adapter_macro('dbt_utils.get_tables_by_prefix_sql', schema, prefix, exclude, database) }}\n{% endmacro %}\n\n{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n select distinct \n table_schema as \"table_schema\", table_name as \"table_name\"\n from {{database}}.information_schema.tables\n where table_schema ilike '{{ schema }}'\n and table_name ilike '{{ prefix }}%'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}\n\n\n{% macro bigquery__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n \n select distinct\n dataset_id as table_schema, table_id as table_name\n\n from {{adapter.quote(database)}}.{{schema}}.__TABLES_SUMMARY__\n where dataset_id = '{{schema}}'\n and lower(table_id) like lower ('{{prefix}}%')\n and lower(table_id) not like lower ('{{exclude}}')\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "resource_type": "macro", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ adapter_macro('dbt_utils.get_tables_by_prefix_sql', schema, prefix, exclude, database) }}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"raw_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ adapter_macro('dbt_utils.get_tables_by_prefix_sql', schema, prefix, exclude, database) }}\n{% endmacro %}\n\n{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n select distinct \n table_schema as \"table_schema\", table_name as \"table_name\"\n from {{database}}.information_schema.tables\n where table_schema ilike '{{ schema }}'\n and table_name ilike '{{ prefix }}%'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}\n\n\n{% macro bigquery__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n \n select distinct\n dataset_id as table_schema, table_id as table_name\n\n from {{adapter.quote(database)}}.{{schema}}.__TABLES_SUMMARY__\n where dataset_id = '{{schema}}'\n and lower(table_id) like lower ('{{prefix}}%')\n and lower(table_id) not like lower ('{{exclude}}')\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "resource_type": "macro", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n select distinct \n table_schema as \"table_schema\", table_name as \"table_name\"\n from {{database}}.information_schema.tables\n where table_schema ilike '{{ schema }}'\n and table_name ilike '{{ prefix }}%'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__get_tables_by_prefix_sql": {"raw_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ adapter_macro('dbt_utils.get_tables_by_prefix_sql', schema, prefix, exclude, database) }}\n{% endmacro %}\n\n{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n select distinct \n table_schema as \"table_schema\", table_name as \"table_name\"\n from {{database}}.information_schema.tables\n where table_schema ilike '{{ schema }}'\n and table_name ilike '{{ prefix }}%'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}\n\n\n{% macro bigquery__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n \n select distinct\n dataset_id as table_schema, table_id as table_name\n\n from {{adapter.quote(database)}}.{{schema}}.__TABLES_SUMMARY__\n where dataset_id = '{{schema}}'\n and lower(table_id) like lower ('{{prefix}}%')\n and lower(table_id) not like lower ('{{exclude}}')\n\n{% endmacro %}", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "resource_type": "macro", "name": "bigquery__get_tables_by_prefix_sql", "macro_sql": "{% macro bigquery__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n \n select distinct\n dataset_id as table_schema, table_id as table_name\n\n from {{adapter.quote(database)}}.{{schema}}.__TABLES_SUMMARY__\n where dataset_id = '{{schema}}'\n and lower(table_id) like lower ('{{prefix}}%')\n and lower(table_id) not like lower ('{{exclude}}')\n\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.star": {"raw_sql": "{% macro star(from, relation_alias=False, except=[]) -%}\n\n {%- do dbt_utils._is_relation(from, 'star') -%}\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 {%- for col in cols -%}\n\n {%- if col.column not in except -%}\n {% do include_cols.append(col.column) %}\n\n {%- endif %}\n {%- endfor %}\n\n {%- for col in include_cols %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ dbt_utils.identifier(col)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "resource_type": "macro", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[]) -%}\n\n {%- do dbt_utils._is_relation(from, 'star') -%}\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 {%- for col in cols -%}\n\n {%- if col.column not in except -%}\n {% do include_cols.append(col.column) %}\n\n {%- endif %}\n {%- endfor %}\n\n {%- for col in include_cols %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ dbt_utils.identifier(col)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.unpivot": {"raw_sql": "{#\nPivot values from columns to rows. Similar to pandas DataFrame melt() function.\n\nExample Usage: {{ unpivot(relation=ref('users'), cast_to='integer', exclude=['id','created_at']) }}\n\nArguments:\n relation: Relation object, required.\n cast_to: The datatype to cast all unpivoted columns to. Default is varchar.\n exclude: A list of columns to keep but exclude from the unpivot operation. Default is none.\n remove: A list of columns to remove from the resulting table. Default is none.\n field_name: Destination table column name for the source table column names.\n value_name: Destination table column name for the pivoted values\n#}\n\n{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if execute and table %}\n {{ log(\"Warning: the `unpivot` macro no longer accepts a `table` parameter. This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead\", info=True) }}\n {% endif %}\n\n {% if relation and table %}\n {{ exceptions.raise_compiler_error(\"Error: both the `relation` and `table` parameters were provided to `unpivot` macro. Choose one only (we recommend `relation`).\") }}\n {% elif not relation and table %}\n {% set relation=table %}\n {% elif not relation and not table %}\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 {%- 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 select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt_utils.type_string() }}) as {{ field_name }},\n cast({{ col.column }} as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "resource_type": "macro", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if execute and table %}\n {{ log(\"Warning: the `unpivot` macro no longer accepts a `table` parameter. This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead\", info=True) }}\n {% endif %}\n\n {% if relation and table %}\n {{ exceptions.raise_compiler_error(\"Error: both the `relation` and `table` parameters were provided to `unpivot` macro. Choose one only (we recommend `relation`).\") }}\n {% elif not relation and table %}\n {% set relation=table %}\n {% elif not relation and not table %}\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 {%- 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 select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt_utils.type_string() }}) as {{ field_name }},\n cast({{ col.column }} as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.union_relations": {"raw_sql": "{%- macro union_relations(relations, 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_utils.string_literal(relation) }} as {{ dbt_utils.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 {{ relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- if execute -%}\n {{ log(\"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\", info=True) }}\n {%- endif -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "resource_type": "macro", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, 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_utils.string_literal(relation) }} as {{ dbt_utils.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 {{ relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.union_tables": {"raw_sql": "{%- macro union_relations(relations, 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_utils.string_literal(relation) }} as {{ dbt_utils.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 {{ relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- if execute -%}\n {{ log(\"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\", info=True) }}\n {%- endif -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.union_tables", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "resource_type": "macro", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- if execute -%}\n {{ log(\"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\", info=True) }}\n {%- endif -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.group_by": {"raw_sql": "{%- macro 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 -%}", "unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "resource_type": "macro", "name": "group_by", "macro_sql": "{%- macro 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 -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.surrogate_key": {"raw_sql": "{%- macro surrogate_key() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% set _ = fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt_utils.type_string() ~ \"), '')\"\n ) %}\n\n {% if not loop.last %}\n {% set _ = fields.append(\"'-'\") %}\n {% endif %}\n\n{%- endfor -%}\n\n{{dbt_utils.hash(dbt_utils.concat(fields))}}\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "resource_type": "macro", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% set _ = fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt_utils.type_string() ~ \"), '')\"\n ) %}\n\n {% if not loop.last %}\n {% set _ = fields.append(\"'-'\") %}\n {% endif %}\n\n{%- endfor -%}\n\n{{dbt_utils.hash(dbt_utils.concat(fields))}}\n\n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.safe_add": {"raw_sql": "{%- macro safe_add() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "resource_type": "macro", "name": "safe_add", "macro_sql": "{%- macro safe_add() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.nullcheck": {"raw_sql": "{% macro 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 %}", "unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "resource_type": "macro", "name": "nullcheck", "macro_sql": "{% macro 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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_column_values": {"raw_sql": "{#\nThis macro fetches the unique values for `column` in the table `table`\n\nArguments:\n table: A model `ref`, or a schema.table string for the table to query (Required)\n column: The column to query for unique values\n max_records: If provided, the maximum number of unique records to return (default: none)\n\nReturns:\n A list of distinct values for the specified columns\n#}\n\n{% macro get_column_values(table, column, max_records=none, default=none) -%}\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 {%- set target_relation = adapter.get_relation(database=table.database,\n schema=table.schema,\n identifier=table.identifier) -%}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not target_relation and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ table ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not target_relation and default is not none -%}\n\n {{ log(\"Relation \" ~ table ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by 1\n order by count(*) desc\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 %}", "unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "resource_type": "macro", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, max_records=none, default=none) -%}\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 {%- set target_relation = adapter.get_relation(database=table.database,\n schema=table.schema,\n identifier=table.identifier) -%}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not target_relation and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ table ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not target_relation and default is not none -%}\n\n {{ log(\"Relation \" ~ table ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by 1\n order by count(*) desc\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.pivot": {"raw_sql": "{#\nPivot values from rows to columns.\n\nExample:\n\n Input: `public.test`\n\n | size | color |\n |------+-------|\n | S | red |\n | S | blue |\n | S | red |\n | M | red |\n\n select\n size,\n {{ dbt_utils.pivot('color', dbt_utils.get_column_values('public.test',\n 'color')) }}\n from public.test\n group by size\n\n Output:\n\n | size | red | blue |\n |------+-----+------|\n | S | 2 | 1 |\n | M | 1 | 0 |\n\nArguments:\n column: Column name, required\n values: List of row values to turn into columns, required\n alias: Whether to create column aliases, default is True\n agg: SQL aggregation function, default is sum\n cmp: SQL value comparison, default is =\n prefix: Column alias prefix, default is blank\n suffix: Column alias postfix, default is blank\n then_value: Value to use if comparison succeeds, default is 1\n else_value: Value to use if comparison fails, default is 0\n quote_identifiers: Whether to surround column aliases with double quotes, default is true\n#}\n\n{% 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 {% for v in values %}\n {{ agg }}(\n case\n when {{ column }} {{ cmp }} '{{ v }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ v ~ suffix) }}\n {% else %}\n as {{prefix ~ v ~ suffix }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "resource_type": "macro", "name": "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 {% for v in values %}\n {{ agg }}(\n case\n when {{ column }} {{ cmp }} '{{ v }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ v ~ suffix) }}\n {% else %}\n as {{prefix ~ v ~ suffix }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_query_results_as_dict": {"raw_sql": "{% macro get_query_results_as_dict(query) %}\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 %}", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "resource_type": "macro", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\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 %}", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "patch_path": null, "arguments": []}}, "docs": {"jaffle_shop.__overview__": {"unique_id": "jaffle_shop.__overview__", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "overview.md", "original_file_path": "models/overview.md", "file_contents": "{% docs __overview__ %}\n\n## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for demonstrations and tutorials.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop).\n\n{% enddocs %}", "name": "__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 demonstrations and tutorials.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "jaffle_shop.orders_status": {"unique_id": "jaffle_shop.orders_status", "package_name": "jaffle_shop", "root_path": "/Users/drew/fishtown/dbt-docs/ci-project", "path": "marts/core/docs.md", "original_file_path": "models/marts/core/docs.md", "file_contents": "{% docs orders_status %}\n\nOrders 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 |\n\n\n{% enddocs %}", "name": "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 |"}, "dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Users/drew/fishtown/dbt/core/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "file_contents": "{% docs __overview__ %}\n\n### 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 `--models` 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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://slack.getdbt.com/) on Slack for live questions and support.\n\n{% enddocs %}", "name": "__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 `--models` 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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://slack.getdbt.com/) on Slack for live questions and support."}}, "disabled": [], "generated_at": "2020-03-04T16:18:40.721355Z", "parent_map": {"model.jaffle_shop.stg_customers": ["seed.jaffle_shop.raw_customers"], "model.jaffle_shop.stg_payments": ["seed.jaffle_shop.raw_payments"], "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], "model.jaffle_shop.hidden_model": ["model.jaffle_shop.stg_orders", "source.jaffle_shop.payments.orders"], "model.jaffle_shop.dim_customers": ["model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments", "model.jaffle_shop.stg_customers"], "model.jaffle_shop.fct_orders": ["model.jaffle_shop.order_payments", "model.jaffle_shop.stg_orders"], "model.jaffle_shop.order_payments": ["model.jaffle_shop.stg_payments"], "model.jaffle_shop.customer_payments": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.stg_payments"], "model.jaffle_shop.customer_orders": ["model.jaffle_shop.stg_orders"], "analysis.jaffle_shop.my_analysis": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.example_data_test": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_customers": [], "seed.jaffle_shop.raw_orders": [], "seed.jaffle_shop.raw_payments": [], "test.jaffle_shop.unique_stg_customers_customer_id": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.not_null_stg_customers_customer_id": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.unique_stg_orders_order_id": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.not_null_stg_orders_order_id": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.unique_stg_payments_payment_id": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.not_null_stg_payments_payment_id": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_dim_customers_customer_id": ["model.jaffle_shop.dim_customers"], "test.jaffle_shop.not_null_dim_customers_customer_id": ["model.jaffle_shop.dim_customers"], "test.jaffle_shop.unique_fct_orders_order_id": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_order_id": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_customer_id": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_": ["model.jaffle_shop.dim_customers", "model.jaffle_shop.fct_orders"], "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_credit_card_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_coupon_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_gift_card_amount": ["model.jaffle_shop.fct_orders"], "source.jaffle_shop.payments.orders": []}, "child_map": {"model.jaffle_shop.stg_customers": ["model.jaffle_shop.dim_customers", "test.jaffle_shop.not_null_stg_customers_customer_id", "test.jaffle_shop.unique_stg_customers_customer_id"], "model.jaffle_shop.stg_payments": ["model.jaffle_shop.customer_payments", "model.jaffle_shop.order_payments", "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "test.jaffle_shop.not_null_stg_payments_payment_id", "test.jaffle_shop.unique_stg_payments_payment_id"], "model.jaffle_shop.stg_orders": ["analysis.jaffle_shop.my_analysis", "model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments", "model.jaffle_shop.fct_orders", "model.jaffle_shop.hidden_model", "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "test.jaffle_shop.example_data_test", "test.jaffle_shop.not_null_stg_orders_order_id", "test.jaffle_shop.unique_stg_orders_order_id"], "model.jaffle_shop.hidden_model": [], "model.jaffle_shop.dim_customers": ["test.jaffle_shop.not_null_dim_customers_customer_id", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "test.jaffle_shop.unique_dim_customers_customer_id"], "model.jaffle_shop.fct_orders": ["test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "test.jaffle_shop.not_null_fct_orders_amount", "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount", "test.jaffle_shop.not_null_fct_orders_coupon_amount", "test.jaffle_shop.not_null_fct_orders_credit_card_amount", "test.jaffle_shop.not_null_fct_orders_customer_id", "test.jaffle_shop.not_null_fct_orders_gift_card_amount", "test.jaffle_shop.not_null_fct_orders_order_id", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "test.jaffle_shop.unique_fct_orders_order_id"], "model.jaffle_shop.order_payments": ["model.jaffle_shop.fct_orders"], "model.jaffle_shop.customer_payments": ["model.jaffle_shop.dim_customers"], "model.jaffle_shop.customer_orders": ["model.jaffle_shop.dim_customers"], "analysis.jaffle_shop.my_analysis": [], "test.jaffle_shop.example_data_test": [], "seed.jaffle_shop.raw_customers": ["model.jaffle_shop.stg_customers"], "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_stg_customers_customer_id": [], "test.jaffle_shop.not_null_stg_customers_customer_id": [], "test.jaffle_shop.unique_stg_orders_order_id": [], "test.jaffle_shop.not_null_stg_orders_order_id": [], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned": [], "test.jaffle_shop.unique_stg_payments_payment_id": [], "test.jaffle_shop.not_null_stg_payments_payment_id": [], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card": [], "test.jaffle_shop.unique_dim_customers_customer_id": [], "test.jaffle_shop.not_null_dim_customers_customer_id": [], "test.jaffle_shop.unique_fct_orders_order_id": [], "test.jaffle_shop.not_null_fct_orders_order_id": [], "test.jaffle_shop.not_null_fct_orders_customer_id": [], "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_": [], "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned": [], "test.jaffle_shop.not_null_fct_orders_amount": [], "test.jaffle_shop.not_null_fct_orders_credit_card_amount": [], "test.jaffle_shop.not_null_fct_orders_coupon_amount": [], "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount": [], "test.jaffle_shop.not_null_fct_orders_gift_card_amount": [], "source.jaffle_shop.payments.orders": ["model.jaffle_shop.hidden_model"]}, "metadata": {"project_id": "06e5b98c2db46f8a72cc4f66410e9b3b", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres"}, "files": {"/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/core.sql": {"path": {"searched_path": "macros", "relative_path": "core.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "9dde6e3cf4b01799f44b1c6d4f23e77f471567a1cbbeab763da5032f0d102821"}, "nodes": [], "docs": [], "macros": ["macro.dbt.statement", "macro.dbt.noop_statement"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/helpers.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/helpers.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "f29316a03082e0c4e9e0b9cc5d73af75206c9db845d01b1e2068d7bb2ab58090"}, "nodes": [], "docs": [], "macros": ["macro.dbt.run_hooks", "macro.dbt.column_list", "macro.dbt.column_list_for_create_table", "macro.dbt.make_hook_config", "macro.dbt.before_begin", "macro.dbt.in_transaction", "macro.dbt.after_commit", "macro.dbt.drop_relation_if_exists", "macro.dbt.load_relation"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/snapshot/snapshot_merge.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/snapshot/snapshot_merge.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "5c6f5982ea4f6a4efe7106b9706c78197d355ef5a50d9ca1c254ba9fe8b5d114"}, "nodes": [], "docs": [], "macros": ["macro.dbt.snapshot_merge_sql", "macro.dbt.default__snapshot_merge_sql"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/snapshot/strategies.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/snapshot/strategies.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "3f88751a98bef086ae59d67a8090e28140aebad8c3c4dbbf7fd462e422d808da"}, "nodes": [], "docs": [], "macros": ["macro.dbt.strategy_dispatch", "macro.dbt.snapshot_hash_arguments", "macro.dbt.default__snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.default__snapshot_get_time", "macro.dbt.snapshot_timestamp_strategy", "macro.dbt.snapshot_string_as_time", "macro.dbt.default__snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_check_strategy"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/snapshot/snapshot.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/snapshot/snapshot.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "3f8c4854169daa7257c62bb2ecf4ee532d0e87b59ed2151382e6c4728b259cce"}, "nodes": [], "docs": [], "macros": ["macro.dbt.create_columns", "macro.dbt.default__create_columns", "macro.dbt.post_snapshot", "macro.dbt.default__post_snapshot", "macro.dbt.snapshot_staging_table_inserts", "macro.dbt.snapshot_staging_table_updates", "macro.dbt.build_snapshot_table", "macro.dbt.get_or_create_relation", "macro.dbt.build_snapshot_staging_table", "macro.dbt.materialization_snapshot_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/seed/seed.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/seed/seed.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "3108894047b1bbf22594ec0e7e1cc9769c58bf3caa4f699b6827aa67dcdbc5dd"}, "nodes": [], "docs": [], "macros": ["macro.dbt.create_csv_table", "macro.dbt.reset_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.default__create_csv_table", "macro.dbt.default__reset_csv_table", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.basic_load_csv_rows", "macro.dbt.default__load_csv_rows", "macro.dbt.materialization_seed_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/incremental/helpers.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/incremental/helpers.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "c37f9127e9c8a575db6ac76470aa8e4bea07d5d8c714511349a74607e32306e1"}, "nodes": [], "docs": [], "macros": ["macro.dbt.incremental_upsert"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/incremental/incremental.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/incremental/incremental.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "f29fd9555f8f24be85b629603b4499e3eac7dde2e52d92343921b6506fad07c7"}, "nodes": [], "docs": [], "macros": ["macro.dbt.materialization_incremental_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/common/merge.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/common/merge.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "11e647c11ca8449c0400eca04bf6486c0e583d108f0bbdb325f2557b0ffe5827"}, "nodes": [], "docs": [], "macros": ["macro.dbt.get_merge_sql", "macro.dbt.get_delete_insert_merge_sql", "macro.dbt.default__get_merge_sql", "macro.dbt.get_quoted_csv", "macro.dbt.common_get_delete_insert_merge_sql", "macro.dbt.default__get_delete_insert_merge_sql"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/table/table.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/table/table.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "7532a98937b3f467b639610ab7d68b121f94f2570576e84ebb285e326c52d93f"}, "nodes": [], "docs": [], "macros": ["macro.dbt.materialization_table_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/view/view.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/view/view.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "495441a9fa472aa6e369a9e87c469e3e82bd2f5cdf90605a3e574b6bfcf9a999"}, "nodes": [], "docs": [], "macros": ["macro.dbt.materialization_view_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/materializations/view/create_or_replace_view.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/view/create_or_replace_view.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "f248f585af455af494d885fb929bcca529e44e080670740feb2c792674599eba"}, "nodes": [], "docs": [], "macros": ["macro.dbt.handle_existing_table", "macro.dbt.default__handle_existing_table", "macro.dbt.create_or_replace_view"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/get_custom_alias.sql": {"path": {"searched_path": "macros", "relative_path": "etc/get_custom_alias.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "a5e6fbf352700a021e2a4726818beb8b164bb8f29d664fbb68aa8fe142ec589e"}, "nodes": [], "docs": [], "macros": ["macro.dbt.generate_alias_name"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/query.sql": {"path": {"searched_path": "macros", "relative_path": "etc/query.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "332f51dd1615c90e372c87aeb65651c2a66a6f8313be34dfae1e91eb7c5e1316"}, "nodes": [], "docs": [], "macros": ["macro.dbt.run_query"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/is_incremental.sql": {"path": {"searched_path": "macros", "relative_path": "etc/is_incremental.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "08a74e7b1a42476e996dedbd89c97ffb47e95c864b9fec6ddad6e9771eeeb7f1"}, "nodes": [], "docs": [], "macros": ["macro.dbt.is_incremental"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/get_relation_comment.sql": {"path": {"searched_path": "macros", "relative_path": "etc/get_relation_comment.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "653267a61c95a535c6d47f8baea9dbbc533fcb3c671e6cd1d8ac5419d218da26"}, "nodes": [], "docs": [], "macros": ["macro.dbt.table_options", "macro.dbt.get_relation_comment"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/datetime.sql": {"path": {"searched_path": "macros", "relative_path": "etc/datetime.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "0ebb8f28f68f1506962974dd513917a68a196f0cabf70ce3a43d9a72159ddc6c"}, "nodes": [], "docs": [], "macros": ["macro.dbt.convert_datetime", "macro.dbt.dates_in_range", "macro.dbt.partition_range", "macro.dbt.py_current_timestring"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/get_custom_schema.sql": {"path": {"searched_path": "macros", "relative_path": "etc/get_custom_schema.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "3a7d4b9d5105010dd92327027f81c9e079b9a5cd68098b02682fedde376fa5de"}, "nodes": [], "docs": [], "macros": ["macro.dbt.generate_schema_name", "macro.dbt.generate_schema_name_for_env"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/etc/get_custom_database.sql": {"path": {"searched_path": "macros", "relative_path": "etc/get_custom_database.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "2b76c8cc7aede4270f5e37d5623788978688e5c382f4dc4e222453a592b0b532"}, "nodes": [], "docs": [], "macros": ["macro.dbt.generate_database_name"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/adapters/common.sql": {"path": {"searched_path": "macros", "relative_path": "adapters/common.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "b20f3411a1cb7997bdbbe6df7867d993d405230b63c8bf14710eb9fefd96ca56"}, "nodes": [], "docs": [], "macros": ["macro.dbt.adapter_macro", "macro.dbt.get_columns_in_query", "macro.dbt.default__get_columns_in_query", "macro.dbt.create_schema", "macro.dbt.default__create_schema", "macro.dbt.drop_schema", "macro.dbt.default__drop_schema", "macro.dbt.create_table_as", "macro.dbt.default__create_table_as", "macro.dbt.create_view_as", "macro.dbt.default__create_view_as", "macro.dbt.get_catalog", "macro.dbt.default__get_catalog", "macro.dbt.get_columns_in_relation", "macro.dbt.sql_convert_columns_in_relation", "macro.dbt.default__get_columns_in_relation", "macro.dbt.alter_column_type", "macro.dbt.default__alter_column_type", "macro.dbt.drop_relation", "macro.dbt.default__drop_relation", "macro.dbt.truncate_relation", "macro.dbt.default__truncate_relation", "macro.dbt.rename_relation", "macro.dbt.default__rename_relation", "macro.dbt.information_schema_name", "macro.dbt.default__information_schema_name", "macro.dbt.list_schemas", "macro.dbt.default__list_schemas", "macro.dbt.check_schema_exists", "macro.dbt.default__check_schema_exists", "macro.dbt.list_relations_without_caching", "macro.dbt.default__list_relations_without_caching", "macro.dbt.current_timestamp", "macro.dbt.default__current_timestamp", "macro.dbt.collect_freshness", "macro.dbt.default__collect_freshness", "macro.dbt.make_temp_relation", "macro.dbt.default__make_temp_relation", "macro.dbt.set_sql_header"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/schema_tests/relationships.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/relationships.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "4f50036d55fcfe56fbe7d283b8d29b6af935ca7e9abffa57043e20e5680609be"}, "nodes": [], "docs": [], "macros": ["macro.dbt.test_relationships"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/schema_tests/not_null.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/not_null.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "a7fd6f2e1f9645059f33cd6a94598a2d72a7bf9c5d568eefc604b1824640efc7"}, "nodes": [], "docs": [], "macros": ["macro.dbt.test_not_null"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/schema_tests/unique.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/unique.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "a4d53f54a4fa7e846d347418471ebf00e364f4e850f2655e3ce8c6fb49e83bf4"}, "nodes": [], "docs": [], "macros": ["macro.dbt.test_unique"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/macros/schema_tests/accepted_values.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/accepted_values.sql", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "b7c3adabeeb96b9e19e19a8fe0e9f56dcc5af20804a613f71f100eba8ae520a9"}, "nodes": [], "docs": [], "macros": ["macro.dbt.test_accepted_values"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres/macros/catalog.sql": {"path": {"searched_path": "macros", "relative_path": "catalog.sql", "project_root": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres"}, "checksum": {"name": "sha256", "checksum": "66026d3423ab9e6ed0f2ab7fb7924d2f474de06cb19453072df22fc13addf3cd"}, "nodes": [], "docs": [], "macros": ["macro.dbt_postgres.postgres__get_catalog"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres/macros/relations.sql": {"path": {"searched_path": "macros", "relative_path": "relations.sql", "project_root": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres"}, "checksum": {"name": "sha256", "checksum": "6b4cb13349d8314702b5eee62d8b6d4d1a14586b1851bcae7dc77ee5d1956ba9"}, "nodes": [], "docs": [], "macros": ["macro.dbt_postgres.postgres_get_relations"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres/macros/adapters.sql": {"path": {"searched_path": "macros", "relative_path": "adapters.sql", "project_root": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres"}, "checksum": {"name": "sha256", "checksum": "e8b9338cc35fd28109ed2b282dd89b18803bd8bfa7e9861dd7432d862896005d"}, "nodes": [], "docs": [], "macros": ["macro.dbt_postgres.postgres__create_table_as", "macro.dbt_postgres.postgres__create_schema", "macro.dbt_postgres.postgres__drop_schema", "macro.dbt_postgres.postgres__get_columns_in_relation", "macro.dbt_postgres.postgres__list_relations_without_caching", "macro.dbt_postgres.postgres__information_schema_name", "macro.dbt_postgres.postgres__list_schemas", "macro.dbt_postgres.postgres__check_schema_exists", "macro.dbt_postgres.postgres__current_timestamp", "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt_postgres.postgres__make_temp_relation"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres/macros/materializations/snapshot_merge.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/snapshot_merge.sql", "project_root": "/Users/drew/fishtown/dbt/plugins/postgres/dbt/include/postgres"}, "checksum": {"name": "sha256", "checksum": "8b3bbe37eddd6ac43d224b116c4c9d4fa7c2729412c4ec69d409e15d2e140aa7"}, "nodes": [], "docs": [], "macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/macros/example_macro.sql": {"path": {"searched_path": "macros", "relative_path": "example_macro.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "78e34dcee0fafb73ccfcbccf6065636c57b9e96a186848a250f7137c62884c8e"}, "nodes": [], "docs": [], "macros": ["macro.jaffle_shop.example_macro"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/except.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/except.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "6695ddb45bb31cebda6ddbd4d41b18552cf74cf5752c8a3c4ecaee4304274fa4"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.except", "macro.dbt_utils.default__except", "macro.dbt_utils.bigquery__except"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/replace.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/replace.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "31b87b44de1b4c36337a04baf357b92aaec9968c4b24361e65f345097c6106b8"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.replace", "macro.dbt_utils.default__replace"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/concat.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/concat.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1e548194e9c92d6cd0a60e53651516fa28582854051d83523cd705e87da38832"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.concat", "macro.dbt_utils.default__concat", "macro.dbt_utils.alternative_concat", "macro.dbt_utils.redshift__concat", "macro.dbt_utils.snowflake__concat"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/identifer.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/identifer.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "bdaaf100faa62e971a7e2b766f21127cb9d9fd0aa11412c2840dc66f1355aaae"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.identifier", "macro.dbt_utils.default__identifier", "macro.dbt_utils.bigquery__identifier"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/datatypes.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/datatypes.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "4845d6c9a9e47dadfc39aa4e1bdd47c0b68152def7e3825cb700a1831015ab11"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.default__type_string", "macro.dbt_utils.redshift__type_string", "macro.dbt_utils.postgres__type_string", "macro.dbt_utils.snowflake__type_string", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.default__type_timestamp", "macro.dbt_utils.snowflake__type_timestamp", "macro.dbt_utils.type_float", "macro.dbt_utils.default__type_float", "macro.dbt_utils.bigquery__type_float", "macro.dbt_utils.type_numeric", "macro.dbt_utils.default__type_numeric", "macro.dbt_utils.bigquery__type_numeric", "macro.dbt_utils.type_bigint", "macro.dbt_utils.default__type_bigint", "macro.dbt_utils.bigquery__type_bigint", "macro.dbt_utils.type_int", "macro.dbt_utils.default__type_int", "macro.dbt_utils.bigquery__type_int"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/_is_relation.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/_is_relation.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "9d37d4547affe42d0f29d215fa3b68bfe00ab075aa8d988de70093b55ad6a68b"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils._is_relation"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/length.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/length.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "85f8613d4e8d7c7dbf5c2a0ff64723e6d756913271277d875683b54cece3b6b0"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.length", "macro.dbt_utils.default__length", "macro.dbt_utils.redshift__length"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/dateadd.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/dateadd.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "4463f081c3275fcf5e9e5e8af182fb2e81fafd9ac3e09d77035ea6473c843b7d"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.default__dateadd", "macro.dbt_utils.bigquery__dateadd", "macro.dbt_utils.postgres__dateadd"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/intersect.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/intersect.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "f5abb85f0b7d9e80b24ed0b3b11dd6a91b6b5b4caf0dbf0c21a070353b5b1d82"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.intersect", "macro.dbt_utils.default__intersect", "macro.dbt_utils.bigquery__intersect"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/right.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/right.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "ce8b346909fc377f131b8de6e40e49dc822da29ccd5d3add77079608a198a375"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.right", "macro.dbt_utils.default__right", "macro.dbt_utils.bigquery__right", "macro.dbt_utils.snowflake__right"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/datediff.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/datediff.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "ce3e4aecff7027028cfb3b91a6da561b63a4ec6c77320572abf20d7c4c086937"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.datediff", "macro.dbt_utils.default__datediff", "macro.dbt_utils.bigquery__datediff", "macro.dbt_utils.postgres__datediff"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/safe_cast.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/safe_cast.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1ad027695168ced61cdba224ddca8f07e861d32aab95efd30008a0bce76241ac"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.default__safe_cast", "macro.dbt_utils.snowflake__safe_cast", "macro.dbt_utils.bigquery__safe_cast"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/hash.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/hash.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "9ac8186a8bfa84a019a05caf6fbb6ecbdd15f9965ea4739dc565115df4c20cb4"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.hash", "macro.dbt_utils.default__hash", "macro.dbt_utils.bigquery__hash"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/position.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/position.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "b5d4dde3fa181616bcd106ae094cb6c75b21d14503e76c0d736d0dc65d92ceeb"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.position", "macro.dbt_utils.default__position", "macro.dbt_utils.bigquery__position"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/literal.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/literal.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "21185e8340fe4f9a3669930768bd3e2aa43c82bb83df847cfe8ed06290337402"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.string_literal", "macro.dbt_utils.default__string_literal"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/current_timestamp.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/current_timestamp.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1e3d0b51c513a0670e0e4851cbc33801890e9813d64376ab2e43dc3c3744f039"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.default__current_timestamp", "macro.dbt_utils.redshift__current_timestamp", "macro.dbt_utils.bigquery__current_timestamp", "macro.dbt_utils.current_timestamp_in_utc", "macro.dbt_utils.default__current_timestamp_in_utc", "macro.dbt_utils.snowflake__current_timestamp_in_utc", "macro.dbt_utils.postgres__current_timestamp_in_utc"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/width_bucket.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/width_bucket.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "287296cc63427c7bd046e85aed1de4aa7fc73ebb3223b7f59e4ba68a20f23de1"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.width_bucket", "macro.dbt_utils.default__width_bucket", "macro.dbt_utils.redshift__width_bucket", "macro.dbt_utils.snowflake__width_bucket"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/last_day.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/last_day.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1e207372f905a7d14f800b518761d85fedec738444b4e9ed7be02b9aeb5bbbfe"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.last_day", "macro.dbt_utils.default_last_day", "macro.dbt_utils.default__last_day", "macro.dbt_utils.postgres__last_day"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/split_part.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/split_part.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "ec1d9db903a2a00b513f90c8345682c076800e99e109228dce881b67c0e00cf7"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.default__split_part", "macro.dbt_utils.bigquery__split_part"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/cross_db_utils/date_trunc.sql": {"path": {"searched_path": "macros", "relative_path": "cross_db_utils/date_trunc.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "2fec19945722b85c7fd737436589122d2959ed9c0bcc2d4778da32687ff992f2"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.date_trunc", "macro.dbt_utils.default__date_trunc", "macro.dbt_utils.bigquery__date_trunc"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/materializations/insert_by_period_materialization.sql": {"path": {"searched_path": "macros", "relative_path": "materializations/insert_by_period_materialization.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "6f4e65d6de0fe33a5f5259507b234831a288c563f56df9eaa70ef3eb5dd3b1b8"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.get_period_sql", "macro.dbt_utils.materialization_insert_by_period_default"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/logger/pretty_log_format.sql": {"path": {"searched_path": "macros", "relative_path": "logger/pretty_log_format.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "788092f1026c7d2fd3398f31870caf4f81d43b686c4af633a57fafd1aeef304a"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.pretty_log_format"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/logger/pretty_time.sql": {"path": {"searched_path": "macros", "relative_path": "logger/pretty_time.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "d5cdb4ceb135e1d855367d2ecb54e63b1fd01d3c9aa074852a553de789f45e5f"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.pretty_time"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/logger/log_info.sql": {"path": {"searched_path": "macros", "relative_path": "logger/log_info.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "6a0420dcc9a03bb7748026162ababb6e877a0e45d7697f77d8b228fd7c6cf717"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.log_info"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/datetime/date_spine.sql": {"path": {"searched_path": "macros", "relative_path": "datetime/date_spine.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "6e164f9e7198e71e4c2f18b0478b69405288b2a5cf8958596271eee490131575"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_intervals_between", "macro.dbt_utils.date_spine"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/web/get_url_host.sql": {"path": {"searched_path": "macros", "relative_path": "web/get_url_host.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "75246509db12e34e95190175211e0331063c8ed017a0bfac1dcbfd5da79c6ce8"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_url_host"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/web/get_url_path.sql": {"path": {"searched_path": "macros", "relative_path": "web/get_url_path.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "b976b094bc2a26a7b553431dc93fdefe28b129abd7155d8846e254046f02a39c"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_url_path"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/web/get_url_parameter.sql": {"path": {"searched_path": "macros", "relative_path": "web/get_url_parameter.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "b10234d9d0b1030a402a6a72a94f78a0d2293661a32cec604b0ef48c50511a56"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_url_parameter"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/geo/haversine_distance.sql": {"path": {"searched_path": "macros", "relative_path": "geo/haversine_distance.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "b5f48844bc062e5ad283aedbd9dd11d68863db6b0f81efbc767b384115079d62"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.haversine_distance"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/equal_rowcount.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/equal_rowcount.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "7163ce75cb298af96172c41a0ba73a184d9116a92d63889573d24a12e551f560"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_equal_rowcount"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/relationships_where.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/relationships_where.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "48c6eb8de34d6925bccf56ce59ee7d3d8dc2c1426f951b15f8ca4560125005b9"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_relationships_where"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/recency.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/recency.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "b2542d28abc4e53309c744b111fb1f2f4be2cfcf4f611b4a31b37aba0fed6bc2"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_recency"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/not_constant.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/not_constant.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "8710079ef29da7534dcb9728407af27814a247fa8d17080f5d1d4c39eee44023"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_not_constant"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/at_least_one.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/at_least_one.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "cc5c686c96681f67f0e97f49cc987b6d65115e8aaf51ea487e39f7865e3d335d"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_at_least_one"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/unique_combination_of_columns.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/unique_combination_of_columns.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "785bbaca0448f809197823afd810753c6a55124ece7bec7d4befe4dbd9eb39dd"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_unique_combination_of_columns"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/cardinality_equality.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/cardinality_equality.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "e037e4539e2f94632db24ca2526fc06a489dd60663bfbb5246e1d24ac4fdcae7"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_cardinality_equality"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/expression_is_true.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/expression_is_true.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "be92c446fea64c14d543c9b9944cf725d28161cf459fa3a17ce9f7be91cb1cac"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_expression_is_true"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/equality.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/equality.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1bdac20b6a7592fe91748dfa489c964dbd433c1e1a9e9839937396b0b297a864"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_equality"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/schema_tests/mutually_exclusive_ranges.sql": {"path": {"searched_path": "macros", "relative_path": "schema_tests/mutually_exclusive_ranges.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "6d92959cd620e418f5faed654e21e126c956f1b370ca932675a5a7a53ace2539"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.test_mutually_exclusive_ranges"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/nullcheck_table.sql": {"path": {"searched_path": "macros", "relative_path": "sql/nullcheck_table.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "9fd89ad3b49bf05c5ea4769e84687510cafcf255f7e3579613d1f8588ceb19cc"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.nullcheck_table"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/generate_series.sql": {"path": {"searched_path": "macros", "relative_path": "sql/generate_series.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "1ca1782077c9ffef4532460d20b9f9f7a94495cff99f1342c48e46f2cd3c070b"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_powers_of_two", "macro.dbt_utils.generate_series"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/get_relations_by_prefix.sql": {"path": {"searched_path": "macros", "relative_path": "sql/get_relations_by_prefix.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "86e15bf943f7a9bddf0ceb2fac257c944cf77143e9b0d16fd3f8c21c04adba64"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_relations_by_prefix", "macro.dbt_utils.get_tables_by_prefix"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/get_tables_by_prefix_sql.sql": {"path": {"searched_path": "macros", "relative_path": "sql/get_tables_by_prefix_sql.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "e4eb8a02c7d6051e583231bd2f516f799611de36febf68599f8a7a74f883f08c"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_tables_by_prefix_sql", "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro.dbt_utils.bigquery__get_tables_by_prefix_sql"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/star.sql": {"path": {"searched_path": "macros", "relative_path": "sql/star.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "8c0fd7e5f0dba7ca12fae6baa5532685c5bbdf3aa1489b54253f95494fc6344b"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.star"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/unpivot.sql": {"path": {"searched_path": "macros", "relative_path": "sql/unpivot.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "071b5b6f49b07cf7de141fb67878f942a7eb5d50d6b20bd44d678b1edd1a774f"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.unpivot"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/union.sql": {"path": {"searched_path": "macros", "relative_path": "sql/union.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "e6de70f04c0769d636993de83b1a7611ca92558277c348e83ad69c4062de3201"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.union_relations", "macro.dbt_utils.union_tables"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/groupby.sql": {"path": {"searched_path": "macros", "relative_path": "sql/groupby.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "ee3fb695561e40aeeed2d05a0dbea10331be8f039b07bd771e6a5741e02adead"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.group_by"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/surrogate_key.sql": {"path": {"searched_path": "macros", "relative_path": "sql/surrogate_key.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "12bd84d1303045d702ad913c23a00913d2bd450e343818123ef39ed12a30387d"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.surrogate_key"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/safe_add.sql": {"path": {"searched_path": "macros", "relative_path": "sql/safe_add.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "7f544c77ed9402d2c130aa1883ab2419215bac58405ab2ec1d2d70229a94737b"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.safe_add"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/nullcheck.sql": {"path": {"searched_path": "macros", "relative_path": "sql/nullcheck.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "d2cd945bca708f6660ea54685dc57ee4abaa1266306dfb3d2e84e04174058c68"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.nullcheck"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/get_column_values.sql": {"path": {"searched_path": "macros", "relative_path": "sql/get_column_values.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "ab0317329a6a695608746064c7a1cccca7d45e908b5f796bcb30cb53fea006fc"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_column_values"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/pivot.sql": {"path": {"searched_path": "macros", "relative_path": "sql/pivot.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "d9ee0399b76d4b7c575a7dad9ba1ad0c2a2c20f9531edec2e2e4233b7d35a9f2"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.pivot"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils/macros/sql/get_query_results_as_dict.sql": {"path": {"searched_path": "macros", "relative_path": "sql/get_query_results_as_dict.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project/dbt_modules/dbt_utils"}, "checksum": {"name": "sha256", "checksum": "9b4b370b1667d3a3a0fd3cf2bdebcd04d2223bbc020f929132a99022589da2d5"}, "nodes": [], "docs": [], "macros": ["macro.dbt_utils.get_query_results_as_dict"], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/staging/stg_customers.sql": {"path": {"searched_path": "models", "relative_path": "staging/stg_customers.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "8aaf3f82d6948a706a8fd6e40493a59446ab84436c800b9bb986d6af6d3dc073"}, "nodes": ["model.jaffle_shop.stg_customers"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/staging/stg_payments.sql": {"path": {"searched_path": "models", "relative_path": "staging/stg_payments.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "113502ed19f04efb2af0629ff139f57f7463347b6d5218f3b80a8d128cc96852"}, "nodes": ["model.jaffle_shop.stg_payments"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/staging/stg_orders.sql": {"path": {"searched_path": "models", "relative_path": "staging/stg_orders.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "5a2807569bc8d9b74f7ffecfbf12d1e3b6dfbc6cbff66dd38ce20306532b6f77"}, "nodes": ["model.jaffle_shop.stg_orders"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/staging/hidden_model.sql": {"path": {"searched_path": "models", "relative_path": "staging/hidden_model.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "ab09cc6daa39542203d5cbba28e07b823193bf0ce81a86f88a7f705b71fffda5"}, "nodes": ["model.jaffle_shop.hidden_model"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/dim_customers.sql": {"path": {"searched_path": "models", "relative_path": "marts/core/dim_customers.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "95d544c0e900d9ac69d0471bad24e03c63a268dbc493559023b58b7618c49b3a"}, "nodes": ["model.jaffle_shop.dim_customers"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/fct_orders.sql": {"path": {"searched_path": "models", "relative_path": "marts/core/fct_orders.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "49634cca4e40171ea98f62a1a3a9999e3487c42aca3ee79ecaaf99900ead1fd8"}, "nodes": ["model.jaffle_shop.fct_orders"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/intermediate/order_payments.sql": {"path": {"searched_path": "models", "relative_path": "marts/core/intermediate/order_payments.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "6af89b1b7d0e9fe6b2b54118cf2addf0bab34ccc49b054eab93f8d7056fb7c52"}, "nodes": ["model.jaffle_shop.order_payments"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/intermediate/customer_payments.sql": {"path": {"searched_path": "models", "relative_path": "marts/core/intermediate/customer_payments.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "feb9a66904fe7968464b947a2289c795d58fbc7f1e14a3c9975dc261d94cb351"}, "nodes": ["model.jaffle_shop.customer_payments"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/intermediate/customer_orders.sql": {"path": {"searched_path": "models", "relative_path": "marts/core/intermediate/customer_orders.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "20c96fcb3cf2235582de807d64cd1cdbdd3a419786bf1ceaae0ef208e7ed3dd7"}, "nodes": ["model.jaffle_shop.customer_orders"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/analysis/my_analysis.sql": {"path": {"searched_path": "analysis", "relative_path": "my_analysis.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "73dbf1cfe9b0cb2d6c44583012e36dd3526a4db58bfd628e0485e10de95dae84"}, "nodes": ["analysis.jaffle_shop.my_analysis"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/tests/example_data_test.sql": {"path": {"searched_path": "tests", "relative_path": "example_data_test.sql", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "b68d2666d3502ec95f54174a518b6d43ee67fac443bf1a66746863f00f053f3b"}, "nodes": ["test.jaffle_shop.example_data_test"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_customers.csv": {"path": {"searched_path": "data", "relative_path": "raw_customers.csv", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "path", "checksum": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_customers.csv"}, "nodes": ["seed.jaffle_shop.raw_customers"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_orders.csv": {"path": {"searched_path": "data", "relative_path": "raw_orders.csv", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "path", "checksum": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_orders.csv"}, "nodes": ["seed.jaffle_shop.raw_orders"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_payments.csv": {"path": {"searched_path": "data", "relative_path": "raw_payments.csv", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "path", "checksum": "/Users/drew/fishtown/dbt-docs/ci-project/data/raw_payments.csv"}, "nodes": ["seed.jaffle_shop.raw_payments"], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/overview.md": {"path": {"searched_path": "models", "relative_path": "overview.md", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "1392d9f53d59e2b7996bee10012f0232607985522434c3af1372e0c886cce5e3"}, "nodes": [], "docs": ["jaffle_shop.__overview__"], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/docs.md": {"path": {"searched_path": "models", "relative_path": "marts/core/docs.md", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "28e3aee589b6731980cfe1a280c171486224a093776ee3ccde474c8a0d87901e"}, "nodes": [], "docs": ["jaffle_shop.orders_status"], "macros": [], "sources": [], "patches": [], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/staging/schema.yml": {"path": {"searched_path": "models", "relative_path": "staging/schema.yml", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "9a1da13d643d196a4dd54e0080002984d695c7dff7bd46c8d906702837f63940"}, "nodes": ["test.jaffle_shop.unique_stg_customers_customer_id", "test.jaffle_shop.not_null_stg_customers_customer_id", "test.jaffle_shop.unique_stg_orders_order_id", "test.jaffle_shop.not_null_stg_orders_order_id", "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "test.jaffle_shop.unique_stg_payments_payment_id", "test.jaffle_shop.not_null_stg_payments_payment_id", "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "docs": [], "macros": [], "sources": ["source.jaffle_shop.payments.orders"], "patches": ["stg_customers", "stg_orders", "stg_payments", "hidden_model"], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/models/marts/core/schema.yml": {"path": {"searched_path": "models", "relative_path": "marts/core/schema.yml", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "0c0fd2ab7c6c9068427f2a26d7bee36731be3d68c8c936b5d5f8a2474fe8dc52"}, "nodes": ["test.jaffle_shop.unique_dim_customers_customer_id", "test.jaffle_shop.not_null_dim_customers_customer_id", "test.jaffle_shop.unique_fct_orders_order_id", "test.jaffle_shop.not_null_fct_orders_order_id", "test.jaffle_shop.not_null_fct_orders_customer_id", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "test.jaffle_shop.not_null_fct_orders_amount", "test.jaffle_shop.not_null_fct_orders_credit_card_amount", "test.jaffle_shop.not_null_fct_orders_coupon_amount", "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount", "test.jaffle_shop.not_null_fct_orders_gift_card_amount"], "docs": [], "macros": [], "sources": [], "patches": ["dim_customers", "fct_orders"], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/analysis/analysis.yml": {"path": {"searched_path": "analysis", "relative_path": "analysis.yml", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "75a01bd4d06cda0ae6e1758fe9d9de6051566449ddb80c424400e401a8ae592e"}, "nodes": [], "docs": [], "macros": [], "sources": [], "patches": ["my_analysis"], "macro_patches": []}, "/Users/drew/fishtown/dbt-docs/ci-project/macros/macros.yml": {"path": {"searched_path": "macros", "relative_path": "macros.yml", "project_root": "/Users/drew/fishtown/dbt-docs/ci-project"}, "checksum": {"name": "sha256", "checksum": "f99e7bd45bb89b897eb929280f7c89961cb671316331fa0ee564dee65fcf9a94"}, "nodes": [], "docs": [], "macros": [], "sources": [], "patches": [], "macro_patches": [["jaffle_shop", "example_macro"]]}, "/Users/drew/fishtown/dbt/core/dbt/include/global_project/docs/overview.md": {"path": {"searched_path": "docs", "relative_path": "overview.md", "project_root": "/Users/drew/fishtown/dbt/core/dbt/include/global_project"}, "checksum": {"name": "sha256", "checksum": "66db3d93aa0f4fa15a61ea3441e71b887d93e11c626bb000d73b6da808231747"}, "nodes": [], "docs": ["dbt.__overview__"], "macros": [], "sources": [], "patches": [], "macro_patches": []}}} \ No newline at end of file diff --git a/src/app/docs/analysis.js b/src/app/docs/analysis.js index bc4b19174..2279e2033 100644 --- a/src/app/docs/analysis.js +++ b/src/app/docs/analysis.js @@ -1,7 +1,6 @@ 'use strict'; const angular = require('angular'); -const _ = require('underscore'); const utils = require('./utils') require("./styles.css"); diff --git a/src/app/docs/macro.js b/src/app/docs/macro.js index 60896f5e4..0df7b638b 100644 --- a/src/app/docs/macro.js +++ b/src/app/docs/macro.js @@ -34,7 +34,6 @@ angular return false; }); - // TODO : include macros? return _.groupBy(references.concat(macroReferences), 'resource_type'); } diff --git a/src/app/docs/model.js b/src/app/docs/model.js index 428e1074a..4e7fd1b5a 100644 --- a/src/app/docs/model.js +++ b/src/app/docs/model.js @@ -1,7 +1,6 @@ 'use strict'; const angular = require('angular'); -const _ = require('underscore'); const utils = require('./utils') require("./styles.css"); diff --git a/src/app/docs/seed.js b/src/app/docs/seed.js index 9a7e79b24..ed7417037 100644 --- a/src/app/docs/seed.js +++ b/src/app/docs/seed.js @@ -1,7 +1,6 @@ 'use strict'; const angular = require('angular'); -const _ = require('underscore'); const utils = require('./utils') require("./styles.css"); diff --git a/src/app/docs/snapshot.js b/src/app/docs/snapshot.js index 6b7dfd662..1452e16d8 100644 --- a/src/app/docs/snapshot.js +++ b/src/app/docs/snapshot.js @@ -1,7 +1,6 @@ 'use strict'; const angular = require('angular'); -const _ = require('underscore'); const utils = require('./utils') require("./styles.css"); diff --git a/src/app/docs/test.js b/src/app/docs/test.js index 921c3e58c..be86aa8f3 100644 --- a/src/app/docs/test.js +++ b/src/app/docs/test.js @@ -1,7 +1,6 @@ 'use strict'; const angular = require('angular'); -const _ = require('underscore'); const utils = require('./utils') require("./styles.css"); diff --git a/src/app/docs/utils.js b/src/app/docs/utils.js index 59c3d0704..5ed4ff39d 100644 --- a/src/app/docs/utils.js +++ b/src/app/docs/utils.js @@ -9,7 +9,6 @@ export function getReferences(project, model) { return false; }); - // TODO : include macros? return _.groupBy(references, 'resource_type'); } diff --git a/src/app/overview/overview.html b/src/app/overview/overview.html index df08d795a..240da6d4a 100644 --- a/src/app/overview/overview.html +++ b/src/app/overview/overview.html @@ -1,5 +1,4 @@
    -

    Welcome to DBT!

    From bf574c845e96271e1a9d0a691e78a2851c9b9ff2 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Fri, 26 Jun 2020 13:18:30 -0500 Subject: [PATCH 07/13] Added "Referenced By" and "Depends On" to files of type source --- src/app/components/search/search.html | 8 ++++---- src/app/components/search/search.js | 2 +- src/app/docs/source.html | 16 ++++++++++++++++ src/app/docs/source.js | 6 +++++- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/app/components/search/search.html b/src/app/components/search/search.html index b08bc2017..96f274c81 100644 --- a/src/app/components/search/search.html +++ b/src/app/components/search/search.html @@ -38,7 +38,7 @@

    -
    Columns
    +
    +
    +
    +
    Referenced By
    + +
    +
    + +
    +
    +
    +
    Depends On
    + +
    +
    +
    diff --git a/src/app/docs/source.js b/src/app/docs/source.js index 6ba8a18b7..74898e89f 100644 --- a/src/app/docs/source.js +++ b/src/app/docs/source.js @@ -1,6 +1,7 @@ 'use strict'; const angular = require('angular'); +const utils = require('./utils') require("./styles.css"); angular @@ -17,7 +18,10 @@ angular $scope.model = {}; projectService.ready(function(project) { - $scope.model = project.nodes[$scope.model_uid]; + let mod = project.nodes[$scope.model_uid]; + $scope.model = mod; + $scope.references = utils.getReferences(project, mod); + $scope.parents = utils.getParents(project, mod); $scope.versions = { 'Sample SQL': codeService.generateSourceSQL($scope.model) From b1c53b0cf7a6a8e56de2f29a53f031f89fc84839 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Fri, 26 Jun 2020 15:25:09 -0500 Subject: [PATCH 08/13] Added hyperlink tabs ("Referenced By" and "Depends On") for source files --- src/app/components/search/search.html | 2 +- src/app/docs/source.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/components/search/search.html b/src/app/components/search/search.html index 96f274c81..cd1778410 100644 --- a/src/app/components/search/search.html +++ b/src/app/components/search/search.html @@ -22,7 +22,7 @@

    - From 39345e59843b8f2ab4f90305172be22b90ccd5f2 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Mon, 3 Aug 2020 15:52:45 -0500 Subject: [PATCH 09/13] Excludes RB and/or DO section if it does not exist --- src/app/docs/analysis.html | 8 ++++---- src/app/docs/macro.html | 8 ++++---- src/app/docs/model.html | 8 ++++---- src/app/docs/seed.html | 8 ++++---- src/app/docs/snapshot.html | 8 ++++---- src/app/docs/source.html | 8 ++++---- src/app/docs/test.html | 8 ++++---- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/app/docs/analysis.html b/src/app/docs/analysis.html index 46b4c71cd..3f5a8a428 100644 --- a/src/app/docs/analysis.html +++ b/src/app/docs/analysis.html @@ -34,8 +34,8 @@

    @@ -56,7 +56,7 @@

    Description

    -
    +
    Referenced By
    @@ -64,7 +64,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/macro.html b/src/app/docs/macro.html index 8b89ce433..67f5e72f8 100644 --- a/src/app/docs/macro.html +++ b/src/app/docs/macro.html @@ -30,8 +30,8 @@

    @@ -59,7 +59,7 @@
    Arguments
    -
    +
    Referenced By
    @@ -67,7 +67,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/model.html b/src/app/docs/model.html index b1b929ded..1c2df2448 100644 --- a/src/app/docs/model.html +++ b/src/app/docs/model.html @@ -36,8 +36,8 @@

  • Details
  • Description
  • Columns
  • -
  • Referenced By
  • -
  • Depends On
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -70,7 +70,7 @@
    Columns
    -
    +
    Referenced By
    @@ -78,7 +78,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/seed.html b/src/app/docs/seed.html index d95822132..d8513fcdc 100644 --- a/src/app/docs/seed.html +++ b/src/app/docs/seed.html @@ -36,8 +36,8 @@

  • Details
  • Description
  • Columns
  • -
  • Referenced By
  • -
  • Depends On
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -69,7 +69,7 @@
    Columns
    -
    +
    Referenced By
    @@ -77,7 +77,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/snapshot.html b/src/app/docs/snapshot.html index f00db159c..89bbbb0ac 100644 --- a/src/app/docs/snapshot.html +++ b/src/app/docs/snapshot.html @@ -36,8 +36,8 @@

  • Details
  • Description
  • Columns
  • -
  • Referenced By
  • -
  • Depends On
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -70,7 +70,7 @@
    Columns
    -
    +
    Referenced By
    @@ -78,7 +78,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/source.html b/src/app/docs/source.html index fd2f48d71..550bf177d 100644 --- a/src/app/docs/source.html +++ b/src/app/docs/source.html @@ -30,8 +30,8 @@

  • Details
  • Description
  • Columns
  • -
  • Referenced By
  • -
  • Depends On
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -63,7 +63,7 @@
    Columns
    -
    +
    Referenced By
    @@ -71,7 +71,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/test.html b/src/app/docs/test.html index ee55bf796..69083d67e 100644 --- a/src/app/docs/test.html +++ b/src/app/docs/test.html @@ -28,8 +28,8 @@

    @@ -49,7 +49,7 @@

    Description
    -
    +
    Referenced By
    @@ -57,7 +57,7 @@
    Referenced By
    -
    +
    Depends On
    From 4f86531ab9694c6ef72ba4aafb8df9abdb75144c Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Mon, 3 Aug 2020 16:29:37 -0500 Subject: [PATCH 10/13] Changed name of utils.js -> dag_utils.js and moved functions from macro.js -> dag_utils.js --- src/app/docs/analysis.js | 2 +- src/app/docs/{utils.js => dag_utils.js} | 36 +++++++++++++++++++++- src/app/docs/macro.js | 41 ++----------------------- src/app/docs/model.js | 2 +- src/app/docs/seed.js | 2 +- src/app/docs/snapshot.js | 2 +- src/app/docs/source.js | 2 +- src/app/docs/test.js | 2 +- 8 files changed, 44 insertions(+), 45 deletions(-) rename src/app/docs/{utils.js => dag_utils.js} (50%) diff --git a/src/app/docs/analysis.js b/src/app/docs/analysis.js index 2279e2033..7b4295a8c 100644 --- a/src/app/docs/analysis.js +++ b/src/app/docs/analysis.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./utils') +const utils = require('./dag_utils') require("./styles.css"); angular diff --git a/src/app/docs/utils.js b/src/app/docs/dag_utils.js similarity index 50% rename from src/app/docs/utils.js rename to src/app/docs/dag_utils.js index 5ed4ff39d..8e7edf329 100644 --- a/src/app/docs/utils.js +++ b/src/app/docs/dag_utils.js @@ -31,6 +31,40 @@ export function getParents (project, model) { return false; }); - return _.groupBy(parents.concat(macroParents), 'resource_type'); +} + +export function getMacroReferences(project, self) { + let references = _.filter(project.nodes, function(node) { + if (node.depends_on && node.depends_on.macros && node.depends_on.macros.length) { + if (_.contains(node.depends_on.macros, self.unique_id)) { + return true; + } + } + return false; + }); + + let macroReferences = _.filter(project.macros, function(macro) { + if (macro.depends_on && macro.depends_on.macros && macro.depends_on.macros.length) { + if (_.contains(macro.depends_on.macros, self.unique_id)) { + return true; + } + } + return false; + }); + + return _.groupBy(references.concat(macroReferences), 'resource_type'); +} + +export function getMacroParents (project, self) { + let macroParents = _.filter(project.macros, function(macro) { + if (self.depends_on && self.depends_on.macros && self.depends_on.macros.length) { + if (_.contains(self.depends_on.macros, macro.unique_id)) { + return true; + } + } + return false; + }); + + return _.groupBy(macroParents, 'resource_type'); } \ No newline at end of file diff --git a/src/app/docs/macro.js b/src/app/docs/macro.js index 0df7b638b..bb63a92db 100644 --- a/src/app/docs/macro.js +++ b/src/app/docs/macro.js @@ -2,6 +2,7 @@ const angular = require('angular'); const _ = require('underscore'); +const utils = require('./dag_utils') require("./styles.css"); @@ -14,48 +15,12 @@ angular $scope.tab = $state.params.tab; $scope.project = projectService; $scope.codeService = codeService; - - function getReferences(project, self) { - let references = _.filter(project.nodes, function(node) { - if (node.depends_on && node.depends_on.macros && node.depends_on.macros.length) { - if (_.contains(node.depends_on.macros, self.unique_id)) { - return true; - } - } - return false; - }); - - let macroReferences = _.filter(project.macros, function(macro) { - if (macro.depends_on && macro.depends_on.macros && macro.depends_on.macros.length) { - if (_.contains(macro.depends_on.macros, self.unique_id)) { - return true; - } - } - return false; - }); - - return _.groupBy(references.concat(macroReferences), 'resource_type'); - } - - function getMacroParents (project, self) { - let macroParents = _.filter(project.macros, function(macro) { - if (self.depends_on && self.depends_on.macros && self.depends_on.macros.length) { - if (_.contains(self.depends_on.macros, macro.unique_id)) { - return true; - } - } - return false; - }); - - return _.groupBy(macroParents, 'resource_type'); - } - $scope.macro = {}; projectService.ready(function(project) { let macro = project.macros[$scope.model_uid]; $scope.macro = macro; - $scope.references = getReferences(project, macro); - $scope.parents = getMacroParents(project, macro); + $scope.references = utils.getMacroReferences(project, macro); + $scope.parents = utils.getMacroParents(project, macro); // adapter macros if ($scope.macro.is_adapter_macro) { diff --git a/src/app/docs/model.js b/src/app/docs/model.js index 4e7fd1b5a..87a74067c 100644 --- a/src/app/docs/model.js +++ b/src/app/docs/model.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./utils') +const utils = require('./dag_utils') require("./styles.css"); angular diff --git a/src/app/docs/seed.js b/src/app/docs/seed.js index ed7417037..e08aeca39 100644 --- a/src/app/docs/seed.js +++ b/src/app/docs/seed.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./utils') +const utils = require('./dag_utils') require("./styles.css"); angular diff --git a/src/app/docs/snapshot.js b/src/app/docs/snapshot.js index 1452e16d8..c4a68128e 100644 --- a/src/app/docs/snapshot.js +++ b/src/app/docs/snapshot.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./utils') +const utils = require('./dag_utils') require("./styles.css"); angular diff --git a/src/app/docs/source.js b/src/app/docs/source.js index 74898e89f..691ca0705 100644 --- a/src/app/docs/source.js +++ b/src/app/docs/source.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./utils') +const utils = require('./dag_utils') require("./styles.css"); angular diff --git a/src/app/docs/test.js b/src/app/docs/test.js index be86aa8f3..67ced4088 100644 --- a/src/app/docs/test.js +++ b/src/app/docs/test.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./utils') +const utils = require('./dag_utils') require("./styles.css"); angular From e7c984b304ddf19dc4bce03c45a07544402704bb Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Mon, 3 Aug 2020 16:38:29 -0500 Subject: [PATCH 11/13] Changes in variable naming convention for dag_utils import --- src/app/docs/analysis.js | 6 +++--- src/app/docs/macro.js | 6 +++--- src/app/docs/model.js | 6 +++--- src/app/docs/seed.js | 6 +++--- src/app/docs/snapshot.js | 6 +++--- src/app/docs/source.js | 6 +++--- src/app/docs/test.js | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/app/docs/analysis.js b/src/app/docs/analysis.js index 7b4295a8c..71320813d 100644 --- a/src/app/docs/analysis.js +++ b/src/app/docs/analysis.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./dag_utils') +const dag_utils = require('./dag_utils') require("./styles.css"); angular @@ -23,8 +23,8 @@ angular projectService.ready(function(project) { let mod = project.nodes[$scope.model_uid]; $scope.model = mod; - $scope.references = utils.getReferences(project, mod); - $scope.parents = utils.getParents(project, mod); + $scope.references = dag_utils.getReferences(project, mod); + $scope.parents = dag_utils.getParents(project, mod); $scope.versions = { 'Source': $scope.model.raw_sql, diff --git a/src/app/docs/macro.js b/src/app/docs/macro.js index bb63a92db..42dcab1e5 100644 --- a/src/app/docs/macro.js +++ b/src/app/docs/macro.js @@ -2,7 +2,7 @@ const angular = require('angular'); const _ = require('underscore'); -const utils = require('./dag_utils') +const dag_utils = require('./dag_utils') require("./styles.css"); @@ -19,8 +19,8 @@ angular projectService.ready(function(project) { let macro = project.macros[$scope.model_uid]; $scope.macro = macro; - $scope.references = utils.getMacroReferences(project, macro); - $scope.parents = utils.getMacroParents(project, macro); + $scope.references = dag_utils.getMacroReferences(project, macro); + $scope.parents = dag_utils.getMacroParents(project, macro); // adapter macros if ($scope.macro.is_adapter_macro) { diff --git a/src/app/docs/model.js b/src/app/docs/model.js index 87a74067c..a4cdacaeb 100644 --- a/src/app/docs/model.js +++ b/src/app/docs/model.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./dag_utils') +const dag_utils = require('./dag_utils') require("./styles.css"); angular @@ -30,8 +30,8 @@ angular projectService.ready(function(project) { let mod = project.nodes[$scope.model_uid]; $scope.model = mod; - $scope.references = utils.getReferences(project, mod); - $scope.parents = utils.getParents(project, mod); + $scope.references = dag_utils.getReferences(project, mod); + $scope.parents = dag_utils.getParents(project, mod); var default_compiled = '\n-- compiled SQL not found for this model\n'; $scope.versions = { diff --git a/src/app/docs/seed.js b/src/app/docs/seed.js index e08aeca39..dc8ec47a8 100644 --- a/src/app/docs/seed.js +++ b/src/app/docs/seed.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./dag_utils') +const dag_utils = require('./dag_utils') require("./styles.css"); angular @@ -20,8 +20,8 @@ angular projectService.ready(function(project) { let mod = project.nodes[$scope.model_uid]; $scope.model = mod; - $scope.references = utils.getReferences(project, mod); - $scope.parents = utils.getParents(project, mod); + $scope.references = dag_utils.getReferences(project, mod); + $scope.parents = dag_utils.getParents(project, mod); $scope.versions = { 'Example SQL': codeService.generateSourceSQL($scope.model) diff --git a/src/app/docs/snapshot.js b/src/app/docs/snapshot.js index c4a68128e..535ea05ee 100644 --- a/src/app/docs/snapshot.js +++ b/src/app/docs/snapshot.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./dag_utils') +const dag_utils = require('./dag_utils') require("./styles.css"); angular @@ -20,8 +20,8 @@ angular projectService.ready(function(project) { let mod = project.nodes[$scope.model_uid]; $scope.model = mod; - $scope.references = utils.getReferences(project, mod); - $scope.parents = utils.getParents(project, mod); + $scope.references = dag_utils.getReferences(project, mod); + $scope.parents = dag_utils.getParents(project, mod); var default_compiled = "Compiled SQL is not available for this snapshot"; $scope.versions = { diff --git a/src/app/docs/source.js b/src/app/docs/source.js index 691ca0705..225cc5308 100644 --- a/src/app/docs/source.js +++ b/src/app/docs/source.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./dag_utils') +const dag_utils = require('./dag_utils') require("./styles.css"); angular @@ -20,8 +20,8 @@ angular projectService.ready(function(project) { let mod = project.nodes[$scope.model_uid]; $scope.model = mod; - $scope.references = utils.getReferences(project, mod); - $scope.parents = utils.getParents(project, mod); + $scope.references = dag_utils.getReferences(project, mod); + $scope.parents = dag_utils.getParents(project, mod); $scope.versions = { 'Sample SQL': codeService.generateSourceSQL($scope.model) diff --git a/src/app/docs/test.js b/src/app/docs/test.js index 67ced4088..cebdfc6df 100644 --- a/src/app/docs/test.js +++ b/src/app/docs/test.js @@ -1,7 +1,7 @@ 'use strict'; const angular = require('angular'); -const utils = require('./dag_utils') +const dag_utils = require('./dag_utils') require("./styles.css"); angular @@ -20,8 +20,8 @@ angular projectService.ready(function(project) { let mod = project.nodes[$scope.model_uid]; $scope.model = mod; - $scope.references = utils.getReferences(project, mod); - $scope.parents = utils.getParents(project, mod); + $scope.references = dag_utils.getReferences(project, mod); + $scope.parents = dag_utils.getParents(project, mod); var default_compiled = '\n-- compiled SQL not found for this model\n'; $scope.versions = { From ca1b14500116668b57bf011e83e240152d33c6e3 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Thu, 6 Aug 2020 16:55:13 -0500 Subject: [PATCH 12/13] Fixed conditional for excluding RB/DO sections if they are empty --- src/app/docs/analysis.html | 8 ++++---- src/app/docs/analysis.js | 2 ++ src/app/docs/macro.html | 8 ++++---- src/app/docs/macro.js | 2 ++ src/app/docs/model.html | 8 ++++---- src/app/docs/model.js | 3 ++- src/app/docs/seed.html | 8 ++++---- src/app/docs/seed.js | 2 ++ src/app/docs/snapshot.html | 8 ++++---- src/app/docs/snapshot.js | 2 ++ src/app/docs/source.html | 8 ++++---- src/app/docs/source.js | 2 ++ src/app/docs/test.html | 8 ++++---- src/app/docs/test.js | 2 ++ 14 files changed, 42 insertions(+), 29 deletions(-) diff --git a/src/app/docs/analysis.html b/src/app/docs/analysis.html index 3f5a8a428..7b93b0a9a 100644 --- a/src/app/docs/analysis.html +++ b/src/app/docs/analysis.html @@ -34,8 +34,8 @@

    @@ -56,7 +56,7 @@

    Description
    -
    +
    Referenced By
    @@ -64,7 +64,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/analysis.js b/src/app/docs/analysis.js index 71320813d..892b43c8e 100644 --- a/src/app/docs/analysis.js +++ b/src/app/docs/analysis.js @@ -24,7 +24,9 @@ angular let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = dag_utils.getReferences(project, mod); + $scope.referencesLength = Object.keys($scope.references).length; $scope.parents = dag_utils.getParents(project, mod); + $scope.parentsLength = Object.keys($scope.parents).length; $scope.versions = { 'Source': $scope.model.raw_sql, diff --git a/src/app/docs/macro.html b/src/app/docs/macro.html index 67f5e72f8..5b4488a08 100644 --- a/src/app/docs/macro.html +++ b/src/app/docs/macro.html @@ -30,8 +30,8 @@

    @@ -59,7 +59,7 @@
    Arguments
    -
    +
    Referenced By
    @@ -67,7 +67,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/macro.js b/src/app/docs/macro.js index 42dcab1e5..bb99d36cf 100644 --- a/src/app/docs/macro.js +++ b/src/app/docs/macro.js @@ -20,7 +20,9 @@ angular let macro = project.macros[$scope.model_uid]; $scope.macro = macro; $scope.references = dag_utils.getMacroReferences(project, macro); + $scope.referencesLength = Object.keys($scope.references).length; $scope.parents = dag_utils.getMacroParents(project, macro); + $scope.parentsLength = Object.keys($scope.parents).length; // adapter macros if ($scope.macro.is_adapter_macro) { diff --git a/src/app/docs/model.html b/src/app/docs/model.html index 1c2df2448..940173ae9 100644 --- a/src/app/docs/model.html +++ b/src/app/docs/model.html @@ -36,8 +36,8 @@

  • Details
  • Description
  • Columns
  • -
  • Referenced By
  • -
  • Depends On
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -70,7 +70,7 @@
    Columns
    -
    +
    Referenced By
    @@ -78,7 +78,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/model.js b/src/app/docs/model.js index a4cdacaeb..b6f73e267 100644 --- a/src/app/docs/model.js +++ b/src/app/docs/model.js @@ -31,8 +31,9 @@ angular let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = dag_utils.getReferences(project, mod); + $scope.referencesLength = Object.keys($scope.references).length; $scope.parents = dag_utils.getParents(project, mod); - + $scope.parentsLength = Object.keys($scope.parents).length; var default_compiled = '\n-- compiled SQL not found for this model\n'; $scope.versions = { 'Source': $scope.model.raw_sql, diff --git a/src/app/docs/seed.html b/src/app/docs/seed.html index d8513fcdc..e0614812f 100644 --- a/src/app/docs/seed.html +++ b/src/app/docs/seed.html @@ -36,8 +36,8 @@

  • Details
  • Description
  • Columns
  • -
  • Referenced By
  • -
  • Depends On
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -69,7 +69,7 @@
    Columns
    -
    +
    Referenced By
    @@ -77,7 +77,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/seed.js b/src/app/docs/seed.js index dc8ec47a8..f7b1dc4ca 100644 --- a/src/app/docs/seed.js +++ b/src/app/docs/seed.js @@ -21,7 +21,9 @@ angular let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = dag_utils.getReferences(project, mod); + $scope.referencesLength = Object.keys($scope.references).length; $scope.parents = dag_utils.getParents(project, mod); + $scope.parentsLength = Object.keys($scope.parents).length; $scope.versions = { 'Example SQL': codeService.generateSourceSQL($scope.model) diff --git a/src/app/docs/snapshot.html b/src/app/docs/snapshot.html index 89bbbb0ac..c14127d87 100644 --- a/src/app/docs/snapshot.html +++ b/src/app/docs/snapshot.html @@ -36,8 +36,8 @@

  • Details
  • Description
  • Columns
  • -
  • Referenced By
  • -
  • Depends On
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -70,7 +70,7 @@
    Columns
    -
    +
    Referenced By
    @@ -78,7 +78,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/snapshot.js b/src/app/docs/snapshot.js index 535ea05ee..5824498be 100644 --- a/src/app/docs/snapshot.js +++ b/src/app/docs/snapshot.js @@ -21,7 +21,9 @@ angular let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = dag_utils.getReferences(project, mod); + $scope.referencesLength = Object.keys($scope.references).length; $scope.parents = dag_utils.getParents(project, mod); + $scope.parentsLength = Object.keys($scope.parents).length; var default_compiled = "Compiled SQL is not available for this snapshot"; $scope.versions = { diff --git a/src/app/docs/source.html b/src/app/docs/source.html index 550bf177d..dd328ce55 100644 --- a/src/app/docs/source.html +++ b/src/app/docs/source.html @@ -30,8 +30,8 @@

  • Details
  • Description
  • Columns
  • -
  • Referenced By
  • -
  • Depends On
  • +
  • Referenced By
  • +
  • Depends On
  • SQL
  • @@ -63,7 +63,7 @@
    Columns
    -
    +
    Referenced By
    @@ -71,7 +71,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/source.js b/src/app/docs/source.js index 225cc5308..0521affd8 100644 --- a/src/app/docs/source.js +++ b/src/app/docs/source.js @@ -21,7 +21,9 @@ angular let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = dag_utils.getReferences(project, mod); + $scope.referencesLength = Object.keys($scope.references).length; $scope.parents = dag_utils.getParents(project, mod); + $scope.parentsLength = Object.keys($scope.parents).length; $scope.versions = { 'Sample SQL': codeService.generateSourceSQL($scope.model) diff --git a/src/app/docs/test.html b/src/app/docs/test.html index 69083d67e..3816aaa1d 100644 --- a/src/app/docs/test.html +++ b/src/app/docs/test.html @@ -28,8 +28,8 @@

    @@ -49,7 +49,7 @@

    Description
    -
    +
    Referenced By
    @@ -57,7 +57,7 @@
    Referenced By
    -
    +
    Depends On
    diff --git a/src/app/docs/test.js b/src/app/docs/test.js index cebdfc6df..4bc9452d7 100644 --- a/src/app/docs/test.js +++ b/src/app/docs/test.js @@ -21,7 +21,9 @@ angular let mod = project.nodes[$scope.model_uid]; $scope.model = mod; $scope.references = dag_utils.getReferences(project, mod); + $scope.referencesLength = Object.keys($scope.references).length; $scope.parents = dag_utils.getParents(project, mod); + $scope.parentsLength = Object.keys($scope.parents).length; var default_compiled = '\n-- compiled SQL not found for this model\n'; $scope.versions = { From d023bb5bcb58e4757b234ab800b5718d72a10770 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Mon, 10 Aug 2020 11:00:56 -0500 Subject: [PATCH 13/13] Additional modifications after recent git pull --- Makefile | 10 +- README.md | 7 +- package-lock.json | 10023 ---------------- package.json | 12 +- src/app/components/code_block/code_block.css | 4 - src/app/components/code_block/code_block.html | 3 +- src/app/components/graph/graph-launcher.html | 2 +- src/app/components/graph/graph-launcher.js | 6 +- src/app/components/search/search.html | 20 +- src/app/components/search/search.js | 53 +- src/app/main/index.js | 60 +- src/app/main/main.html | 4 +- src/app/services/graph.service.js | 13 +- src/app/services/node_selection_service.js | 322 +- src/app/services/project_service.js | 1 + src/app/services/selector_graph.js | 61 + src/app/services/selector_graph.test.js | 143 + src/app/services/selector_integration.test.js | 492 + src/app/services/selector_matcher.js | 272 + src/app/services/selector_matcher.test.js | 441 + src/app/services/selector_methods.js | 221 + src/app/services/selector_methods.test.js | 398 + src/assets/images/logo.svg | 15 +- yarn.lock | 2107 +++- 24 files changed, 4273 insertions(+), 10417 deletions(-) delete mode 100644 package-lock.json create mode 100644 src/app/services/selector_graph.js create mode 100644 src/app/services/selector_graph.test.js create mode 100644 src/app/services/selector_integration.test.js create mode 100644 src/app/services/selector_matcher.js create mode 100644 src/app/services/selector_matcher.test.js create mode 100644 src/app/services/selector_methods.js create mode 100644 src/app/services/selector_methods.test.js diff --git a/Makefile b/Makefile index 8de13f524..09957e1f6 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,22 @@ dev: DBT_DOCS_ENV=development npm start +watch: + npm run-script watch + +test: + npm test + dist: clean DBT_DOCS_ENV=production webpack rm -rf dist/fonts dist/main.js dist/main.js.map -dist-ci: clean +submodule: git submodule init git submodule update jekyll build -s styles/ -d styles/_site + +dist-ci: clean submodule test DBT_DOCS_ENV=production webpack cp data/*.json dist/ diff --git a/README.md b/README.md index 2946d84ae..7352013f9 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,10 @@ Then, install yarn and webpack. npm install -g yarn webpack webpack-cli ``` -You'll also need to install jekyll if you don't already have it: +You'll also need to install bundler if you don't already have it: ```bash -gem install bundler jekyll +gem install bundler +bundle install ``` ### Build / Run @@ -49,7 +50,7 @@ To build the css files required for webpack: ```bash cd styles -jekyll build +bundle exec jekyll build cd - ``` diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index e01b24872..000000000 --- a/package-lock.json +++ /dev/null @@ -1,10023 +0,0 @@ -{ - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, - "@types/node": { - "version": "13.13.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.4.tgz", - "integrity": "sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==", - "dev": true - }, - "@types/q": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", - "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==", - "dev": true - }, - "@uirouter/core": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@uirouter/core/-/core-6.0.4.tgz", - "integrity": "sha512-TQ9XOzZY+jmWKkU4993MAEBIy7Bs3kijDzj+A6RHR8gq/3UoQm3Q/l1igfao5GZyBjid7eRVeipPK14ovCYQ3g==", - "dev": true - }, - "@webassemblyjs/ast": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", - "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", - "dev": true, - "requires": { - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0" - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", - "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", - "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", - "dev": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", - "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", - "dev": true - }, - "@webassemblyjs/helper-code-frame": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", - "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", - "dev": true, - "requires": { - "@webassemblyjs/wast-printer": "1.9.0" - } - }, - "@webassemblyjs/helper-fsm": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", - "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", - "dev": true - }, - "@webassemblyjs/helper-module-context": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", - "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", - "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", - "dev": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", - "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0" - } - }, - "@webassemblyjs/ieee754": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", - "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", - "dev": true, - "requires": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "@webassemblyjs/leb128": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", - "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", - "dev": true, - "requires": { - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/utf8": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", - "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", - "dev": true - }, - "@webassemblyjs/wasm-edit": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", - "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/helper-wasm-section": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-opt": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "@webassemblyjs/wast-printer": "1.9.0" - } - }, - "@webassemblyjs/wasm-gen": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", - "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } - }, - "@webassemblyjs/wasm-opt": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", - "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0" - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", - "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } - }, - "@webassemblyjs/wast-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", - "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/floating-point-hex-parser": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-code-frame": "1.9.0", - "@webassemblyjs/helper-fsm": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", - "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "dev": true, - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, - "acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", - "dev": true - }, - "ajv": { - "version": "6.12.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", - "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true - }, - "ajv-keywords": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", - "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", - "dev": true - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, - "angular": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/angular/-/angular-1.7.9.tgz", - "integrity": "sha512-5se7ZpcOtu0MBFlzGv5dsM1quQDoDeUTwZrWjGtTNA7O88cD8TEk5IEKCTDa3uECV9XnvKREVUr7du1ACiWGFQ==", - "dev": true - }, - "angular-loader": { - "version": "1.5.11", - "resolved": "https://registry.npmjs.org/angular-loader/-/angular-loader-1.5.11.tgz", - "integrity": "sha1-8qWq0CJ8EsqQK3/CO/zsaZkTaKE=", - "dev": true - }, - "angular-marked": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/angular-marked/-/angular-marked-1.2.2.tgz", - "integrity": "sha1-Ax+BAV2tX7Aa341IkixS/rNYjeU=", - "dev": true, - "requires": { - "marked": "^0.3.3" - } - }, - "angular-route": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/angular-route/-/angular-route-1.7.9.tgz", - "integrity": "sha512-vRoj5hzdQtWbODhWJqDzD1iNOEfCKshO6GFBuPVV7RHlPjzIc4R2dHCc7Qiv/8F3LDxJDohc6vSnTDMLHuaqeA==", - "dev": true - }, - "angular-ui-router": { - "version": "1.0.25", - "resolved": "https://registry.npmjs.org/angular-ui-router/-/angular-ui-router-1.0.25.tgz", - "integrity": "sha512-NCjwfGWQiqBx22OyAm6hsAWvlo431uUlY2ccg9kXkvb3zCLQGSJ6pGo1AGLtRAKdZvrEHiIExhawyrVPkYp0VA==", - "dev": true, - "requires": { - "@uirouter/core": "6.0.4" - } - }, - "ansi-colors": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", - "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", - "dev": true - }, - "ansi-html": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", - "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "dev": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, - "array-flatten": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", - "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "ast-types": { - "version": "0.9.6", - "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.9.6.tgz", - "integrity": "sha1-ECyenpAF0+fjgpvwxPok7oYu6bk=", - "dev": true - }, - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true - }, - "async-foreach": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", - "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=", - "dev": true - }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", - "dev": true - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - } - }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" - } - }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", - "dev": true, - "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - } - }, - "babel-helper-builder-react-jsx": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz", - "integrity": "sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "esutils": "^2.0.2" - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-define-map": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", - "dev": true, - "requires": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", - "dev": true, - "requires": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-loader": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.5.tgz", - "integrity": "sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw==", - "dev": true, - "requires": { - "find-cache-dir": "^1.0.0", - "loader-utils": "^1.0.2", - "mkdirp": "^0.5.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-syntax-flow": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", - "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=", - "dev": true - }, - "babel-plugin-syntax-jsx": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", - "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=", - "dev": true - }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", - "dev": true, - "requires": { - "babel-helper-define-map": "^6.24.1", - "babel-helper-function-name": "^6.24.1", - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-helper-replace-supers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", - "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", - "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "dev": true, - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } - }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", - "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", - "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", - "dev": true, - "requires": { - "babel-helper-replace-supers": "^6.24.1", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "dev": true, - "requires": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" - } - }, - "babel-plugin-transform-flow-strip-types": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", - "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", - "dev": true, - "requires": { - "babel-plugin-syntax-flow": "^6.18.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-react-display-name": { - "version": "6.25.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz", - "integrity": "sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-react-jsx": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz", - "integrity": "sha1-hAoCjn30YN/DotKfDA2R9jduZqM=", - "dev": true, - "requires": { - "babel-helper-builder-react-jsx": "^6.24.1", - "babel-plugin-syntax-jsx": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-react-jsx-self": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz", - "integrity": "sha1-322AqdomEqEh5t3XVYvL7PBuY24=", - "dev": true, - "requires": { - "babel-plugin-syntax-jsx": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-react-jsx-source": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz", - "integrity": "sha1-ZqwSFT9c0tF7PBkmj0vwGX9E7NY=", - "dev": true, - "requires": { - "babel-plugin-syntax-jsx": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-regenerator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", - "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", - "dev": true, - "requires": { - "regenerator-transform": "^0.10.0" - } - }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-preset-es2015": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", - "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "^6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoping": "^6.24.1", - "babel-plugin-transform-es2015-classes": "^6.24.1", - "babel-plugin-transform-es2015-computed-properties": "^6.24.1", - "babel-plugin-transform-es2015-destructuring": "^6.22.0", - "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1", - "babel-plugin-transform-es2015-for-of": "^6.22.0", - "babel-plugin-transform-es2015-function-name": "^6.24.1", - "babel-plugin-transform-es2015-literals": "^6.22.0", - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1", - "babel-plugin-transform-es2015-modules-umd": "^6.24.1", - "babel-plugin-transform-es2015-object-super": "^6.24.1", - "babel-plugin-transform-es2015-parameters": "^6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.24.1", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "^6.22.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.24.1", - "babel-plugin-transform-regenerator": "^6.24.1" - } - }, - "babel-preset-flow": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz", - "integrity": "sha1-5xIYiHCFrpoktb5Baa/7WZgWxJ0=", - "dev": true, - "requires": { - "babel-plugin-transform-flow-strip-types": "^6.22.0" - } - }, - "babel-preset-react": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.24.1.tgz", - "integrity": "sha1-umnfrqRfw+xjm2pOzqbhdwLJE4A=", - "dev": true, - "requires": { - "babel-plugin-syntax-jsx": "^6.3.13", - "babel-plugin-transform-react-display-name": "^6.23.0", - "babel-plugin-transform-react-jsx": "^6.24.1", - "babel-plugin-transform-react-jsx-self": "^6.22.0", - "babel-plugin-transform-react-jsx-source": "^6.22.0", - "babel-preset-flow": "^6.23.0" - } - }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", - "dev": true, - "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "dev": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - } - }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "base64-inline-loader": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/base64-inline-loader/-/base64-inline-loader-1.1.1.tgz", - "integrity": "sha512-v/bHvXQ8sW28t9ZwBsFGgyqZw2bpT49/dtPTtlmixoSM/s9wnOngOKFVQLRH8BfMTy6jTl5m5CdvqpZt8y5d6g==", - "dev": true, - "requires": { - "file-loader": "^1.1.11", - "loader-utils": "^1.1.0", - "mime-types": "^2.1.18" - } - }, - "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", - "dev": true - }, - "batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true - }, - "body-parser": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", - "dev": true, - "requires": { - "bytes": "3.1.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" - }, - "dependencies": { - "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", - "dev": true - }, - "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", - "dev": true - } - } - }, - "bonjour": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz", - "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", - "dev": true, - "requires": { - "array-flatten": "^2.1.0", - "deep-equal": "^1.0.1", - "dns-equal": "^1.0.0", - "dns-txt": "^2.0.2", - "multicast-dns": "^6.0.1", - "multicast-dns-service-types": "^1.1.0" - } - }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", - "dev": true - }, - "bootstrap": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.4.1.tgz", - "integrity": "sha512-yN5oZVmRCwe5aKwzRj6736nSmKDX7pLYwsXiCj/EYmo16hODaBiT4En5btW/jhBF/seV+XMx3aYwukYC3A49DA==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, - "buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "buffer-indexof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz", - "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", - "dev": true - }, - "cacache": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", - "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", - "dev": true, - "requires": { - "bluebird": "^3.5.1", - "chownr": "^1.0.1", - "glob": "^7.1.2", - "graceful-fs": "^4.1.11", - "lru-cache": "^4.1.1", - "mississippi": "^2.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.2", - "ssri": "^5.2.4", - "unique-filename": "^1.1.0", - "y18n": "^4.0.0" - }, - "dependencies": { - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "camel-case": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", - "dev": true, - "requires": { - "no-case": "^2.2.0", - "upper-case": "^1.1.1" - } - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "dev": true, - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", - "dev": true - }, - "cheerio": { - "version": "1.0.0-rc.3", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz", - "integrity": "sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==", - "dev": true, - "requires": { - "css-select": "~1.2.0", - "dom-serializer": "~0.1.1", - "entities": "~1.1.1", - "htmlparser2": "^3.9.1", - "lodash": "^4.15.0", - "parse5": "^3.0.1" - }, - "dependencies": { - "parse5": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", - "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", - "dev": true, - "requires": { - "@types/node": "*" - } - } - } - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, - "chrome-trace-event": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", - "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "clean-css": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", - "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", - "dev": true, - "requires": { - "source-map": "~0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "clipboard": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz", - "integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==", - "optional": true, - "requires": { - "good-listener": "^1.2.2", - "select": "^1.1.2", - "tiny-emitter": "^2.0.0" - } - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - } - }, - "coa": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", - "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", - "dev": true, - "requires": { - "@types/q": "^1.5.1", - "chalk": "^2.4.1", - "q": "^1.1.2" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "compressible": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", - "dev": true, - "requires": { - "mime-db": ">= 1.43.0 < 2" - } - }, - "compression": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", - "dev": true, - "requires": { - "accepts": "~1.3.5", - "bytes": "3.0.0", - "compressible": "~2.0.16", - "debug": "2.6.9", - "on-headers": "~1.0.2", - "safe-buffer": "5.1.2", - "vary": "~1.1.2" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "connect-history-api-fallback": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", - "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", - "dev": true - }, - "console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", - "dev": true - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "cookie": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", - "dev": true - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", - "dev": true - }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", - "dev": true - }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-js": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", - "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-spawn": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", - "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "crypt": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", - "dev": true - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "css-loader": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-1.0.1.tgz", - "integrity": "sha512-+ZHAZm/yqvJ2kDtPne3uX0C+Vr3Zn5jFn2N4HywtS5ujwvsVkyg0VArEXpl3BgczDA8anieki1FIzhchX4yrDw==", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "css-selector-tokenizer": "^0.7.0", - "icss-utils": "^2.1.0", - "loader-utils": "^1.0.2", - "lodash": "^4.17.11", - "postcss": "^6.0.23", - "postcss-modules-extract-imports": "^1.2.0", - "postcss-modules-local-by-default": "^1.2.0", - "postcss-modules-scope": "^1.1.0", - "postcss-modules-values": "^1.3.0", - "postcss-value-parser": "^3.3.0", - "source-list-map": "^2.0.0" - } - }, - "css-select": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", - "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", - "dev": true, - "requires": { - "boolbase": "~1.0.0", - "css-what": "2.1", - "domutils": "1.5.1", - "nth-check": "~1.0.1" - } - }, - "css-select-base-adapter": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", - "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", - "dev": true - }, - "css-selector-tokenizer": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.2.tgz", - "integrity": "sha512-yj856NGuAymN6r8bn8/Jl46pR+OC3eEvAhfGYDUe7YPtTPAYrSSw4oAniZ9Y8T5B92hjhwTBLUen0/vKPxf6pw==", - "dev": true, - "requires": { - "cssesc": "^3.0.0", - "fastparse": "^1.1.2", - "regexpu-core": "^4.6.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - }, - "regexpu-core": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz", - "integrity": "sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==", - "dev": true, - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.2.0", - "regjsgen": "^0.5.1", - "regjsparser": "^0.6.4", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.2.0" - } - }, - "regjsgen": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", - "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==", - "dev": true - }, - "regjsparser": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", - "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - } - } - } - }, - "css-tree": { - "version": "1.0.0-alpha.37", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", - "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==", - "dev": true, - "requires": { - "mdn-data": "2.0.4", - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "css-url-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/css-url-regex/-/css-url-regex-1.1.0.tgz", - "integrity": "sha1-g4NCMMyfdMRX3lnuvRVD/uuDt+w=", - "dev": true - }, - "css-what": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", - "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", - "dev": true - }, - "cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "dev": true - }, - "csso": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.0.3.tgz", - "integrity": "sha512-NL3spysxUkcrOgnpsT4Xdl2aiEiBG6bXswAABQVHcMrfjjBisFOKwLDOmf4wf32aPdcJws1zds2B0Rg+jqMyHQ==", - "dev": true, - "requires": { - "css-tree": "1.0.0-alpha.39" - }, - "dependencies": { - "css-tree": { - "version": "1.0.0-alpha.39", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.39.tgz", - "integrity": "sha512-7UvkEYgBAHRG9Nt980lYxjsTrCyHFN53ky3wVsDkiMdVqylqRt+Zc+jm5qw7/qyOvN2dHSYtX0e4MbCCExSvnA==", - "dev": true, - "requires": { - "mdn-data": "2.0.6", - "source-map": "^0.6.1" - } - }, - "mdn-data": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.6.tgz", - "integrity": "sha512-rQvjv71olwNHgiTbfPZFkJtjNMciWgswYeciZhtvWLO8bmX3TnhyA62I6sTWOyZssWHJJjY6/KiWwqQsWWsqOA==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, - "cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, - "cytoscape": { - "version": "git+https://github.com/fishtown-analytics/cytoscape.js.git#fbb329bee47f0035dd7bd7fc6b76e8577dc1bf31", - "from": "git+https://github.com/fishtown-analytics/cytoscape.js.git#feature/cubic-bezier-edges", - "dev": true, - "requires": { - "heap": "^0.2.6", - "lodash.debounce": "^4.0.8" - } - }, - "cytoscape-context-menus": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cytoscape-context-menus/-/cytoscape-context-menus-3.1.0.tgz", - "integrity": "sha512-UE7g+zrx43m6WNmkHgiJFUMqxkTHTiciEjufvgSBgyBZOIY/H2U6sSsRtepXukeILs7/8FeHTAbmJRqQsJlpcg==", - "dev": true - }, - "cytoscape-dagre": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/cytoscape-dagre/-/cytoscape-dagre-2.2.2.tgz", - "integrity": "sha512-zsg36qNwua/L2stJSWkcbSDcvW3E6VZf6KRe6aLnQJxuXuz89tMqI5EVYVKEcNBgzTEzFMFv0PE3T0nD4m6VDw==", - "dev": true, - "requires": { - "dagre": "^0.8.2" - }, - "dependencies": { - "dagre": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/dagre/-/dagre-0.8.5.tgz", - "integrity": "sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==", - "dev": true, - "requires": { - "graphlib": "^2.1.8", - "lodash": "^4.17.15" - } - } - } - }, - "cytoscape-expand-collapse": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/cytoscape-expand-collapse/-/cytoscape-expand-collapse-3.2.1.tgz", - "integrity": "sha512-jJlCW1VJaaU0nhPLqSWYrK+9dltdtpSBZjWk5BxFvA0w2GWp32u3zDv6uvyX0Um7RDN3lqv/7M4eo2LL1V36CQ==", - "dev": true - }, - "dagre": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/dagre/-/dagre-0.7.4.tgz", - "integrity": "sha1-3nLw50pVDOEc5jjwoTb+1xI5gCI=", - "dev": true, - "requires": { - "graphlib": "^1.0.5", - "lodash": "^3.10.0" - }, - "dependencies": { - "graphlib": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-1.0.7.tgz", - "integrity": "sha1-DKst8P/mq+BwsmJb+h7bbslnuLE=", - "dev": true, - "requires": { - "lodash": "^3.10.0" - } - }, - "lodash": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", - "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", - "dev": true - } - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", - "dev": true, - "requires": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" - } - }, - "deepmerge": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz", - "integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==", - "dev": true - }, - "default-gateway": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz", - "integrity": "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "ip-regex": "^2.1.0" - } - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "del": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", - "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "globby": "^6.1.0", - "is-path-cwd": "^2.0.0", - "is-path-in-cwd": "^2.0.0", - "p-map": "^2.0.0", - "pify": "^4.0.1", - "rimraf": "^2.6.3" - }, - "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "delegate": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", - "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==", - "optional": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "detect-node": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", - "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", - "dev": true - }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "dns-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", - "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=", - "dev": true - }, - "dns-packet": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", - "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", - "dev": true, - "requires": { - "ip": "^1.1.0", - "safe-buffer": "^5.0.1" - } - }, - "dns-txt": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz", - "integrity": "sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=", - "dev": true, - "requires": { - "buffer-indexof": "^1.0.0" - } - }, - "dom-converter": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", - "integrity": "sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==", - "dev": true, - "requires": { - "utila": "~0.4" - } - }, - "dom-serializer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", - "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", - "dev": true, - "requires": { - "domelementtype": "^1.3.0", - "entities": "^1.1.1" - } - }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", - "dev": true - }, - "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", - "dev": true, - "requires": { - "domelementtype": "1" - } - }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true - }, - "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "enhanced-resolve": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz", - "integrity": "sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" - }, - "dependencies": { - "memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true - }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "dev": true, - "requires": { - "prr": "~1.0.1" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "es6-templates": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/es6-templates/-/es6-templates-0.2.3.tgz", - "integrity": "sha1-XLmsn7He1usSOTQrgdeSu7QHjuQ=", - "dev": true, - "requires": { - "recast": "~0.11.12", - "through": "~2.3.6" - } - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "requires": { - "estraverse": "^4.1.0" - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "dev": true - }, - "eventemitter3": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz", - "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==", - "dev": true - }, - "events": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", - "integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==", - "dev": true - }, - "eventsource": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.0.7.tgz", - "integrity": "sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ==", - "dev": true, - "requires": { - "original": "^1.0.0" - } - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", - "dev": true, - "requires": { - "accepts": "~1.3.7", - "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", - "content-type": "~1.0.4", - "cookie": "0.4.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", - "dev": true - }, - "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", - "dev": true - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-safe-stringify": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", - "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", - "dev": true - }, - "fastparse": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", - "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", - "dev": true - }, - "faye-websocket": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", - "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", - "dev": true, - "requires": { - "websocket-driver": ">=0.5.1" - } - }, - "figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, - "file-loader": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", - "integrity": "sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==", - "dev": true, - "requires": { - "loader-utils": "^1.0.2", - "schema-utils": "^0.4.5" - } - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - } - }, - "find-cache-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", - "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^2.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "follow-redirects": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.11.0.tgz", - "integrity": "sha512-KZm0V+ll8PfBrKwMzdo5D13b1bur9Iq9Zd/RMmAoQQcl2PxxFml8cxXPaaPYVbV0RjNjq1CU7zIzAOqtUPudmA==", - "dev": true, - "requires": { - "debug": "^3.0.0" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", - "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "formidable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", - "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==", - "dev": true - }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", - "dev": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", - "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", - "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1", - "node-pre-gyp": "*" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "3.2.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.9.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "ms": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.14.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - } - }, - "nopt": { - "version": "4.0.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.7.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.1", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.13", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.1.1", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "gaze": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", - "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", - "dev": true, - "requires": { - "globule": "^1.0.0" - } - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - }, - "dependencies": { - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "dev": true, - "requires": { - "global-prefix": "^3.0.0" - }, - "dependencies": { - "global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, - "requires": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - } - } - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - }, - "globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "globule": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.1.tgz", - "integrity": "sha512-OVyWOHgw29yosRHCHo7NncwR1hW5ew0W/UrvtwvjefVJeQ26q4/8r8FmPsSF1hJ93IgWkyv16pCTz6WblMzm/g==", - "dev": true, - "requires": { - "glob": "~7.1.1", - "lodash": "~4.17.12", - "minimatch": "~3.0.2" - } - }, - "good-listener": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", - "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", - "optional": true, - "requires": { - "delegate": "^3.1.2" - } - }, - "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", - "dev": true - }, - "graphlib": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", - "integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==", - "dev": true, - "requires": { - "lodash": "^4.17.15" - } - }, - "handle-thing": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", - "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", - "dev": true - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "dev": true, - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "heap": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.6.tgz", - "integrity": "sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw=", - "dev": true - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } - }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, - "hpack.js": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", - "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "obuf": "^1.0.0", - "readable-stream": "^2.0.1", - "wbuf": "^1.1.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "html-entities": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.3.1.tgz", - "integrity": "sha512-rhE/4Z3hIhzHAUKbW8jVcCyuT5oJCXXqhN/6mXXVCpzTmvJnoH2HL/bt3EZ6p55jbFJBeAe1ZNpL5BugLujxNA==", - "dev": true - }, - "html-loader": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/html-loader/-/html-loader-0.5.5.tgz", - "integrity": "sha512-7hIW7YinOYUpo//kSYcPB6dCKoceKLmOwjEMmhIobHuWGDVl0Nwe4l68mdG/Ru0wcUxQjVMEoZpkalZ/SE7zog==", - "dev": true, - "requires": { - "es6-templates": "^0.2.3", - "fastparse": "^1.1.1", - "html-minifier": "^3.5.8", - "loader-utils": "^1.1.0", - "object-assign": "^4.1.1" - } - }, - "html-minifier": { - "version": "3.5.21", - "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.21.tgz", - "integrity": "sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA==", - "dev": true, - "requires": { - "camel-case": "3.0.x", - "clean-css": "4.2.x", - "commander": "2.17.x", - "he": "1.2.x", - "param-case": "2.1.x", - "relateurl": "0.2.x", - "uglify-js": "3.4.x" - } - }, - "html-webpack-inline-source-plugin": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/html-webpack-inline-source-plugin/-/html-webpack-inline-source-plugin-0.0.10.tgz", - "integrity": "sha512-0ZNU57u7283vrXSF5a4VDnVOMWiSwypKIp1z/XfXWoVHLA1r3Xmyxx5+Lz+mnthz/UvxL1OAf41w5UIF68Jngw==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5", - "slash": "^1.0.0", - "source-map-url": "^0.4.0" - } - }, - "html-webpack-inline-svg-plugin": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/html-webpack-inline-svg-plugin/-/html-webpack-inline-svg-plugin-1.3.0.tgz", - "integrity": "sha512-ChC1UkLH5xrolADRJK83nBAq/5PnpyNo1zpC8wWoGoFIoaWLQBF3VIjSWtVpCWlNFlUnt4fB7n63Iqb8Ltdmng==", - "dev": true, - "requires": { - "chalk": "^2.3.2", - "cheerio": "^1.0.0-rc.2", - "lodash": "^4.17.4", - "parse5": "^4.0.0", - "svgo": "^1.0.3" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "html-webpack-plugin": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", - "integrity": "sha1-sBq71yOsqqeze2r0SS69oD2d03s=", - "dev": true, - "requires": { - "html-minifier": "^3.2.3", - "loader-utils": "^0.2.16", - "lodash": "^4.17.3", - "pretty-error": "^2.0.2", - "tapable": "^1.0.0", - "toposort": "^1.0.0", - "util.promisify": "1.0.0" - }, - "dependencies": { - "big.js": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", - "dev": true - }, - "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", - "dev": true - }, - "loader-utils": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", - "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", - "dev": true, - "requires": { - "big.js": "^3.1.3", - "emojis-list": "^2.0.0", - "json5": "^0.5.0", - "object-assign": "^4.0.1" - } - }, - "util.promisify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "object.getownpropertydescriptors": "^2.0.3" - } - } - } - }, - "html5-boilerplate": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/html5-boilerplate/-/html5-boilerplate-5.3.0.tgz", - "integrity": "sha1-a52YqpG81Yv8QfCjjF2kJC1kF1A=", - "dev": true - }, - "htmlparser2": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", - "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", - "dev": true, - "requires": { - "domelementtype": "^1.3.1", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.1.1" - } - }, - "http-deceiver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", - "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=", - "dev": true - }, - "http-errors": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } - } - }, - "http-parser-js": { - "version": "0.4.10", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz", - "integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=", - "dev": true - }, - "http-proxy": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz", - "integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==", - "dev": true, - "requires": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - } - }, - "http-proxy-middleware": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", - "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", - "dev": true, - "requires": { - "http-proxy": "^1.17.0", - "is-glob": "^4.0.0", - "lodash": "^4.17.11", - "micromatch": "^3.1.10" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "icss-replace-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", - "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", - "dev": true - }, - "icss-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-2.1.0.tgz", - "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", - "dev": true, - "requires": { - "postcss": "^6.0.1" - } - }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, - "import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", - "dev": true, - "requires": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - } - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "in-publish": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz", - "integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ==", - "dev": true - }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "inline-source": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/inline-source/-/inline-source-6.2.0.tgz", - "integrity": "sha512-utR1WlFbT97zGvkMOXuVxo5COziYB0TQTY6XlC2a+m0CUAqVMd85ONhq2NHi2Tvmf2t6n+Nk5aGQ7UHBOF3NOw==", - "dev": true, - "requires": { - "csso": "~3.5.1", - "htmlparser2": "^3.10.1", - "superagent": "~5.0.5", - "svgo": "~1.2.2", - "terser": "~4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "css-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz", - "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", - "dev": true, - "requires": { - "boolbase": "^1.0.0", - "css-what": "^3.2.1", - "domutils": "^1.7.0", - "nth-check": "^1.0.2" - } - }, - "css-tree": { - "version": "1.0.0-alpha.29", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.29.tgz", - "integrity": "sha512-sRNb1XydwkW9IOci6iB2xmy8IGCj6r/fr+JWitvJ2JxQRPzN3T4AGGVWCMlVmVwM1gtgALJRmGIlWv5ppnGGkg==", - "dev": true, - "requires": { - "mdn-data": "~1.1.0", - "source-map": "^0.5.3" - } - }, - "css-what": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.2.1.tgz", - "integrity": "sha512-WwOrosiQTvyms+Ti5ZC5vGEK0Vod3FTt1ca+payZqvKuGJF+dq7bG63DstxtN0dpm6FxY27a/zS3Wten+gEtGw==", - "dev": true - }, - "csso": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/csso/-/csso-3.5.1.tgz", - "integrity": "sha512-vrqULLffYU1Q2tLdJvaCYbONStnfkfimRxXNaGjxMldI0C7JPBC4rB1RyjhfdZ4m1frm8pM9uRPKH3d2knZ8gg==", - "dev": true, - "requires": { - "css-tree": "1.0.0-alpha.29" - } - }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "mdn-data": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz", - "integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "svgo": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.2.2.tgz", - "integrity": "sha512-rAfulcwp2D9jjdGu+0CuqlrAUin6bBWrpoqXWwKDZZZJfXcUXQSxLJOFJCQCSA0x0pP2U0TxSlJu2ROq5Bq6qA==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "coa": "^2.0.2", - "css-select": "^2.0.0", - "css-select-base-adapter": "^0.1.1", - "css-tree": "1.0.0-alpha.28", - "css-url-regex": "^1.1.0", - "csso": "^3.5.1", - "js-yaml": "^3.13.1", - "mkdirp": "~0.5.1", - "object.values": "^1.1.0", - "sax": "~1.2.4", - "stable": "^0.1.8", - "unquote": "~1.1.1", - "util.promisify": "~1.0.0" - }, - "dependencies": { - "css-tree": { - "version": "1.0.0-alpha.28", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.28.tgz", - "integrity": "sha512-joNNW1gCp3qFFzj4St6zk+Wh/NBv0vM5YbEreZk0SD4S23S+1xBKb6cLDg2uj4P4k/GUMlIm6cKIDqIG+vdt0w==", - "dev": true, - "requires": { - "mdn-data": "~1.1.0", - "source-map": "^0.5.3" - } - } - } - } - } - }, - "internal-ip": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", - "integrity": "sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg==", - "dev": true, - "requires": { - "default-gateway": "^4.2.0", - "ipaddr.js": "^1.9.0" - } - }, - "interpret": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", - "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", - "dev": true - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", - "dev": true - }, - "ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", - "dev": true - }, - "ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "dev": true - }, - "is-absolute-url": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz", - "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==", - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arguments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", - "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", - "dev": true - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-finite": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", - "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "dev": true - }, - "is-path-in-cwd": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", - "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", - "dev": true, - "requires": { - "is-path-inside": "^2.1.0" - } - }, - "is-path-inside": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", - "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", - "dev": true, - "requires": { - "path-is-inside": "^1.0.2" - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "dev": true, - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "jquery": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", - "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==", - "dev": true - }, - "js-base64": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz", - "integrity": "sha512-Vg8czh0Q7sFBSUMWWArX/miJeBWYBPpdU/3M/DKSaekLMqrqVPaedp+5mZhie/r0lgrcaYBfwXatEew6gwgiQQ==", - "dev": true - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - } - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "json3": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.3.tgz", - "integrity": "sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA==", - "dev": true - }, - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "killable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", - "integrity": "sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==", - "dev": true - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", - "dev": true - }, - "loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - }, - "dependencies": { - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - } - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, - "loglevel": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.8.tgz", - "integrity": "sha512-bsU7+gc9AJ2SqpzxwU3+1fedl8zAntbtC5XYlt3s2j1hJcn2PsXSmgN8TaLG/J1/2mod4+cE/3vNL70/c1RNCA==", - "dev": true - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dev": true, - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, - "lower-case": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", - "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=", - "dev": true - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "marked": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", - "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", - "dev": true - }, - "md5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", - "integrity": "sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=", - "dev": true, - "requires": { - "charenc": "~0.0.1", - "crypt": "~0.0.1", - "is-buffer": "~1.1.1" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "mdn-data": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", - "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", - "dev": true - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", - "dev": true - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - } - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", - "dev": true - }, - "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", - "dev": true - }, - "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "dev": true, - "requires": { - "mime-db": "1.44.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "mississippi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", - "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^2.0.1", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "multicast-dns": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.2.3.tgz", - "integrity": "sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g==", - "dev": true, - "requires": { - "dns-packet": "^1.3.1", - "thunky": "^1.0.2" - } - }, - "multicast-dns-service-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", - "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=", - "dev": true - }, - "nan": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", - "dev": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", - "dev": true - }, - "neo-async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", - "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", - "dev": true - }, - "ngtemplate-loader": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ngtemplate-loader/-/ngtemplate-loader-2.0.1.tgz", - "integrity": "sha1-nX7S6KI2NSOte2TXSqxALY2v8/M=", - "dev": true, - "requires": { - "jsesc": "^0.5.0", - "loader-utils": "^1.0.2" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - } - } - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "no-case": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", - "dev": true, - "requires": { - "lower-case": "^1.1.1" - } - }, - "node-forge": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", - "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==", - "dev": true - }, - "node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", - "dev": true, - "requires": { - "fstream": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^2.0.0", - "which": "1" - }, - "dependencies": { - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "dev": true - } - } - }, - "node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - } - } - }, - "node-sass": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.0.tgz", - "integrity": "sha512-AxqU+DFpk0lEz95sI6jO0hU0Rwyw7BXVEv6o9OItoXLyeygPeaSpiV4rwQb10JiTghHaa0gZeD21sz+OsQluaw==", - "dev": true, - "requires": { - "async-foreach": "^0.1.3", - "chalk": "^1.1.1", - "cross-spawn": "^3.0.0", - "gaze": "^1.0.0", - "get-stdin": "^4.0.1", - "glob": "^7.0.3", - "in-publish": "^2.0.0", - "lodash": "^4.17.15", - "meow": "^3.7.0", - "mkdirp": "^0.5.1", - "nan": "^2.13.2", - "node-gyp": "^3.8.0", - "npmlog": "^4.0.0", - "request": "^2.88.0", - "sass-graph": "^2.2.4", - "stdout-stream": "^1.4.0", - "true-case-path": "^1.0.2" - } - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "nth-check": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", - "dev": true, - "requires": { - "boolbase": "~1.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-inspect": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", - "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", - "dev": true - }, - "object-is": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz", - "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - } - }, - "object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "object.values": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", - "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "function-bind": "^1.1.1", - "has": "^1.0.3" - } - }, - "obuf": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", - "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", - "dev": true - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, - "on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "opn": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", - "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", - "dev": true, - "requires": { - "is-wsl": "^1.1.0" - } - }, - "original": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", - "integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==", - "dev": true, - "requires": { - "url-parse": "^1.4.3" - } - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", - "dev": true - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - }, - "p-retry": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-3.0.1.tgz", - "integrity": "sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w==", - "dev": true, - "requires": { - "retry": "^0.12.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "requires": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "param-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", - "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", - "dev": true, - "requires": { - "no-case": "^2.2.0" - } - }, - "parse-asn1": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", - "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", - "dev": true, - "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", - "dev": true - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", - "dev": true - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - }, - "portfinder": { - "version": "1.0.25", - "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.25.tgz", - "integrity": "sha512-6ElJnHBbxVA1XSLgBp7G1FiCkQdlqGzuF7DswL5tcea+E8UpuvPU7beVAjjRwCioTS9ZluNbu+ZyRvgTsmqEBg==", - "dev": true, - "requires": { - "async": "^2.6.2", - "debug": "^3.1.1", - "mkdirp": "^0.5.1" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "postcss-modules-extract-imports": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.1.tgz", - "integrity": "sha512-6jt9XZwUhwmRUhb/CkyJY020PYaPJsCyt3UjbaWo6XEbH/94Hmv6MP7fG2C5NDU/BcHzyGYxNtHvM+LTf9HrYw==", - "dev": true, - "requires": { - "postcss": "^6.0.1" - } - }, - "postcss-modules-local-by-default": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz", - "integrity": "sha1-99gMOYxaOT+nlkRmvRlQCn1hwGk=", - "dev": true, - "requires": { - "css-selector-tokenizer": "^0.7.0", - "postcss": "^6.0.1" - } - }, - "postcss-modules-scope": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz", - "integrity": "sha1-1upkmUx5+XtipytCb75gVqGUu5A=", - "dev": true, - "requires": { - "css-selector-tokenizer": "^0.7.0", - "postcss": "^6.0.1" - } - }, - "postcss-modules-values": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz", - "integrity": "sha1-7P+p1+GSUYOJ9CrQ6D9yrsRW6iA=", - "dev": true, - "requires": { - "icss-replace-symbols": "^1.1.0", - "postcss": "^6.0.1" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "pretty-error": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz", - "integrity": "sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM=", - "dev": true, - "requires": { - "renderkid": "^2.0.1", - "utila": "~0.4" - } - }, - "prism-themes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/prism-themes/-/prism-themes-1.4.0.tgz", - "integrity": "sha512-VTy6t69sS1FavspBsodoF/x/eduPydUXyZH+++Jkun0VQ4X7lCZVvsfGsYKzkUan2PJNcV2mA4lAFcr7KKXD1g==", - "dev": true - }, - "prismjs": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.20.0.tgz", - "integrity": "sha512-AEDjSrVNkynnw6A+B1DsFkd6AVdTnp+/WoUixFRULlCLZVRZlVQMVWio/16jv7G1FscUxQxOQhWwApgbnxr6kQ==", - "requires": { - "clipboard": "^2.0.0" - } - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, - "proxy-addr": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", - "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", - "dev": true, - "requires": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.9.1" - } - }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "dev": true - }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "dev": true - }, - "qs": { - "version": "6.9.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", - "integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==", - "dev": true - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "querystringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", - "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true - }, - "raw-body": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", - "dev": true, - "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "dependencies": { - "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", - "dev": true - } - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - } - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "recast": { - "version": "0.11.23", - "resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz", - "integrity": "sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=", - "dev": true, - "requires": { - "ast-types": "0.9.6", - "esprima": "~3.1.0", - "private": "~0.1.5", - "source-map": "~0.5.0" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "dev": true, - "requires": { - "regenerate": "^1.4.0" - } - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true - }, - "regenerator-transform": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", - "dev": true, - "requires": { - "babel-runtime": "^6.18.0", - "babel-types": "^6.19.0", - "private": "^0.1.6" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "regexp.prototype.flags": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", - "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, - "regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", - "dev": true, - "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - }, - "regjsgen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", - "dev": true - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - } - } - }, - "relateurl": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", - "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=", - "dev": true - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "renderkid": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.3.tgz", - "integrity": "sha512-z8CLQp7EZBPCwCnncgf9C4XAi3WR0dv+uWu/PjIyhhAb5d6IJ/QZqlHFprHeKT+59//V6BNUsLbvN8+2LarxGA==", - "dev": true, - "requires": { - "css-select": "^1.1.0", - "dom-converter": "^0.2", - "htmlparser2": "^3.3.0", - "strip-ansi": "^3.0.0", - "utila": "^0.4.0" - } - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - } - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true - }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - } - }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "dependencies": { - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - } - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", - "dev": true - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "sass-graph": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", - "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", - "dev": true, - "requires": { - "glob": "^7.0.0", - "lodash": "^4.0.0", - "scss-tokenizer": "^0.2.3", - "yargs": "^7.0.0" - } - }, - "sass-loader": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-7.3.1.tgz", - "integrity": "sha512-tuU7+zm0pTCynKYHpdqaPpe+MMTQ76I9TPZ7i4/5dZsigE350shQWe5EZNl5dBidM49TPET75tNqRbcsUZWeNA==", - "dev": true, - "requires": { - "clone-deep": "^4.0.1", - "loader-utils": "^1.0.1", - "neo-async": "^2.5.0", - "pify": "^4.0.1", - "semver": "^6.3.0" - }, - "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - } - } - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, - "schema-utils": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", - "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-keywords": "^3.1.0" - } - }, - "scss-tokenizer": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", - "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", - "dev": true, - "requires": { - "js-base64": "^2.1.8", - "source-map": "^0.4.2" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "select": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", - "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=", - "optional": true - }, - "select-hose": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", - "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=", - "dev": true - }, - "selfsigned": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz", - "integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==", - "dev": true, - "requires": { - "node-forge": "0.9.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, - "serialize-javascript": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", - "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==", - "dev": true - }, - "serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", - "dev": true, - "requires": { - "accepts": "~1.3.4", - "batch": "0.6.1", - "debug": "2.6.9", - "escape-html": "~1.0.3", - "http-errors": "~1.6.2", - "mime-types": "~2.1.17", - "parseurl": "~1.3.2" - }, - "dependencies": { - "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - } - } - }, - "serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", - "dev": true, - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "sockjs": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz", - "integrity": "sha512-V48klKZl8T6MzatbLlzzRNhMepEys9Y4oGFpypBFFn1gLI/QQ9HtLLyWJNbPlwGLelOVOEijUbTTJeLLI59jLw==", - "dev": true, - "requires": { - "faye-websocket": "^0.10.0", - "uuid": "^3.0.1" - } - }, - "sockjs-client": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.4.0.tgz", - "integrity": "sha512-5zaLyO8/nri5cua0VtOrFXBPK1jbL4+1cebT/mmKA1E1ZXOvJrII75bPu0l0k843G/+iAbhEqzyKr0w/eCCj7g==", - "dev": true, - "requires": { - "debug": "^3.2.5", - "eventsource": "^1.0.7", - "faye-websocket": "~0.11.1", - "inherits": "^2.0.3", - "json3": "^3.3.2", - "url-parse": "^1.4.3" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "faye-websocket": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz", - "integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==", - "dev": true, - "requires": { - "websocket-driver": ">=0.5.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "dev": true, - "requires": { - "source-map": "^0.5.6" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, - "spdy": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", - "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", - "dev": true, - "requires": { - "debug": "^4.1.0", - "handle-thing": "^2.0.0", - "http-deceiver": "^1.2.7", - "select-hose": "^2.0.0", - "spdy-transport": "^3.0.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "spdy-transport": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", - "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", - "dev": true, - "requires": { - "debug": "^4.1.0", - "detect-node": "^2.0.4", - "hpack.js": "^2.1.6", - "obuf": "^1.1.2", - "readable-stream": "^3.0.6", - "wbuf": "^1.7.3" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "ssri": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", - "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.1" - } - }, - "stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", - "dev": true - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true - }, - "stdout-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", - "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string.prototype.trimend": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", - "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "string.prototype.trimleft": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", - "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimstart": "^1.0.0" - } - }, - "string.prototype.trimright": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", - "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimend": "^1.0.0" - } - }, - "string.prototype.trimstart": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", - "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", - "dev": true - } - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1" - } - }, - "style-loader": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.21.0.tgz", - "integrity": "sha512-T+UNsAcl3Yg+BsPKs1vd22Fr8sVT+CJMtzqc6LEw9bbJZb43lm9GoeIfUcDEefBSWC0BhYbcdupV1GtI4DGzxg==", - "dev": true, - "requires": { - "loader-utils": "^1.1.0", - "schema-utils": "^0.4.5" - } - }, - "superagent": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.0.9.tgz", - "integrity": "sha512-aOBxh0xN3nCcaG0oot9apJe77FzzCOsg469l06Nw0gW7p9q0mfyAOhSiCLzHCFxKKCNtTx8cxymqoY2cGUfV8g==", - "dev": true, - "requires": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.2", - "debug": "^4.1.1", - "fast-safe-stringify": "^2.0.6", - "form-data": "^2.3.3", - "formidable": "^1.2.1", - "methods": "^1.1.2", - "mime": "^2.4.4", - "qs": "^6.7.0", - "readable-stream": "^3.4.0", - "semver": "^6.1.1" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "svg-url-loader": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/svg-url-loader/-/svg-url-loader-2.3.3.tgz", - "integrity": "sha512-dFXrXCrtyEucN6dWdvDGMipbVwPPez4OVVYUpxJwLJ5WuaPLYY9RmpOjUparDNs1+sPEXrsdDGIOCOK8NOy5VQ==", - "dev": true, - "requires": { - "file-loader": "4.0.0", - "loader-utils": "1.2.3" - }, - "dependencies": { - "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", - "dev": true - }, - "file-loader": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-4.0.0.tgz", - "integrity": "sha512-roAbL6IdSGczwfXxhMi6Zq+jD4IfUpL0jWHD7fvmjdOVb7xBfdRUHe4LpBgO23VtVK5AW1OlWZo0p34Jvx3iWg==", - "dev": true, - "requires": { - "loader-utils": "^1.2.2", - "schema-utils": "^1.0.0" - } - }, - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "loader-utils": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", - "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^2.0.0", - "json5": "^1.0.1" - } - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - } - } - }, - "svgo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz", - "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "coa": "^2.0.2", - "css-select": "^2.0.0", - "css-select-base-adapter": "^0.1.1", - "css-tree": "1.0.0-alpha.37", - "csso": "^4.0.2", - "js-yaml": "^3.13.1", - "mkdirp": "~0.5.1", - "object.values": "^1.1.0", - "sax": "~1.2.4", - "stable": "^0.1.8", - "unquote": "~1.1.1", - "util.promisify": "~1.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "css-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz", - "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", - "dev": true, - "requires": { - "boolbase": "^1.0.0", - "css-what": "^3.2.1", - "domutils": "^1.7.0", - "nth-check": "^1.0.2" - } - }, - "css-what": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.2.1.tgz", - "integrity": "sha512-WwOrosiQTvyms+Ti5ZC5vGEK0Vod3FTt1ca+payZqvKuGJF+dq7bG63DstxtN0dpm6FxY27a/zS3Wten+gEtGw==", - "dev": true - }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "dev": true - }, - "tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", - "dev": true, - "requires": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" - } - }, - "terser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.0.2.tgz", - "integrity": "sha512-IWLuJqTvx97KP3uTYkFVn93cXO+EtlzJu8TdJylq+H0VBDlPMIfQA9MBS5Vc5t3xTEUG1q0hIfHMpAP2R+gWTw==", - "dev": true, - "requires": { - "commander": "^2.19.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.10" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - } - } - }, - "terser-webpack-plugin": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz", - "integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==", - "dev": true, - "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^2.1.2", - "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" - }, - "dependencies": { - "cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - } - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "serialize-javascript": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", - "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1" - } - }, - "terser": { - "version": "4.6.12", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.12.tgz", - "integrity": "sha512-fnIwuaKjFPANG6MAixC/k1TDtnl1YlPLUlLVIxxGZUn1gfUx2+l3/zGNB72wya+lgsb50QBi2tUV75RiODwnww==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - } - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "thunky": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", - "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", - "dev": true - }, - "timers-browserify": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", - "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, - "tiny-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", - "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", - "optional": true - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", - "dev": true - }, - "toposort": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.7.tgz", - "integrity": "sha1-LmhELZ9k7HILjMieZEOsbKqVACk=", - "dev": true - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", - "dev": true - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true - }, - "true-case-path": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", - "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", - "dev": true, - "requires": { - "glob": "^7.1.2" - } - }, - "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", - "dev": true - }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, - "type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dev": true, - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "uglify-js": { - "version": "3.4.10", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", - "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", - "dev": true, - "requires": { - "commander": "~2.19.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "uglifyjs-webpack-plugin": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.3.0.tgz", - "integrity": "sha512-ovHIch0AMlxjD/97j9AYovZxG5wnHOPkL7T1GKochBADp/Zwc44pEWNqpKl1Loupp1WhFg7SlYmHZRUfdAacgw==", - "dev": true, - "requires": { - "cacache": "^10.0.4", - "find-cache-dir": "^1.0.0", - "schema-utils": "^0.4.5", - "serialize-javascript": "^1.4.0", - "source-map": "^0.6.1", - "uglify-es": "^3.3.4", - "webpack-sources": "^1.1.0", - "worker-farm": "^1.5.2" - }, - "dependencies": { - "commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "uglify-es": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", - "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", - "dev": true, - "requires": { - "commander": "~2.13.0", - "source-map": "~0.6.1" - } - } - } - }, - "underscore": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", - "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==", - "dev": true - }, - "unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "dev": true - }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true - }, - "unquote": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", - "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true - }, - "upper-case": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", - "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=", - "dev": true - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", - "dev": true, - "requires": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, - "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "util.promisify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", - "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.2", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.0" - } - }, - "utila": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz", - "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=", - "dev": true - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, - "v8-compile-cache": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz", - "integrity": "sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, - "watchpack": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.1.tgz", - "integrity": "sha512-+IF9hfUFOrYOOaKyfaI7h7dquUIOgyEMoQMLA7OP5FxegKA2+XdXThAZ9TU2kucfhDH7rfMHs1oPYziVGWRnZA==", - "dev": true, - "requires": { - "chokidar": "^2.1.8", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" - } - }, - "wbuf": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", - "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", - "dev": true, - "requires": { - "minimalistic-assert": "^1.0.0" - } - }, - "webpack": { - "version": "4.43.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.43.0.tgz", - "integrity": "sha512-GW1LjnPipFW2Y78OOab8NJlCflB7EFskMih2AHdvjbpKMeDJqEgSx24cXXXiPS65+WSwVyxtDsJH6jGX2czy+g==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/wasm-edit": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "acorn": "^6.4.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.1.0", - "eslint-scope": "^4.0.3", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.3", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.3", - "watchpack": "^1.6.1", - "webpack-sources": "^1.4.1" - }, - "dependencies": { - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - } - } - }, - "webpack-cli": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.11.tgz", - "integrity": "sha512-dXlfuml7xvAFwYUPsrtQAA9e4DOe58gnzSxhgrO/ZM/gyXTBowrsYeubyN4mqGhYdpXMFNyQ6emjJS9M7OBd4g==", - "dev": true, - "requires": { - "chalk": "2.4.2", - "cross-spawn": "6.0.5", - "enhanced-resolve": "4.1.0", - "findup-sync": "3.0.0", - "global-modules": "2.0.0", - "import-local": "2.0.0", - "interpret": "1.2.0", - "loader-utils": "1.2.3", - "supports-color": "6.1.0", - "v8-compile-cache": "2.0.3", - "yargs": "13.2.4" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", - "dev": true - }, - "enhanced-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", - "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.4.0", - "tapable": "^1.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "loader-utils": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", - "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^2.0.0", - "json5": "^1.0.1" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yargs": { - "version": "13.2.4", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", - "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.0" - } - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "webpack-dev-middleware": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.2.tgz", - "integrity": "sha512-1xC42LxbYoqLNAhV6YzTYacicgMZQTqRd27Sim9wn5hJrX3I5nxYy1SxSd4+gjUFsz1dQFj+yEe6zEVmSkeJjw==", - "dev": true, - "requires": { - "memory-fs": "^0.4.1", - "mime": "^2.4.4", - "mkdirp": "^0.5.1", - "range-parser": "^1.2.1", - "webpack-log": "^2.0.0" - } - }, - "webpack-dev-server": { - "version": "3.10.3", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.10.3.tgz", - "integrity": "sha512-e4nWev8YzEVNdOMcNzNeCN947sWJNd43E5XvsJzbAL08kGc2frm1tQ32hTJslRS+H65LCb/AaUCYU7fjHCpDeQ==", - "dev": true, - "requires": { - "ansi-html": "0.0.7", - "bonjour": "^3.5.0", - "chokidar": "^2.1.8", - "compression": "^1.7.4", - "connect-history-api-fallback": "^1.6.0", - "debug": "^4.1.1", - "del": "^4.1.1", - "express": "^4.17.1", - "html-entities": "^1.2.1", - "http-proxy-middleware": "0.19.1", - "import-local": "^2.0.0", - "internal-ip": "^4.3.0", - "ip": "^1.1.5", - "is-absolute-url": "^3.0.3", - "killable": "^1.0.1", - "loglevel": "^1.6.6", - "opn": "^5.5.0", - "p-retry": "^3.0.1", - "portfinder": "^1.0.25", - "schema-utils": "^1.0.0", - "selfsigned": "^1.10.7", - "semver": "^6.3.0", - "serve-index": "^1.9.1", - "sockjs": "0.3.19", - "sockjs-client": "1.4.0", - "spdy": "^4.0.1", - "strip-ansi": "^3.0.1", - "supports-color": "^6.1.0", - "url": "^0.11.0", - "webpack-dev-middleware": "^3.7.2", - "webpack-log": "^2.0.0", - "ws": "^6.2.1", - "yargs": "12.0.5" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "webpack-inline-svg-plugin": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/webpack-inline-svg-plugin/-/webpack-inline-svg-plugin-1.1.4.tgz", - "integrity": "sha512-UKI4NfFANd0s4wWkoSUj9+zFOqCeNMgVd9VXvPJc+6kMVX47EwObtFpUC3bPKJC84BUXt55NqXl0fzfM4e36+w==", - "dev": true - }, - "webpack-log": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/webpack-log/-/webpack-log-2.0.0.tgz", - "integrity": "sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg==", - "dev": true, - "requires": { - "ansi-colors": "^3.0.0", - "uuid": "^3.3.2" - } - }, - "webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, - "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "websocket-driver": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz", - "integrity": "sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==", - "dev": true, - "requires": { - "http-parser-js": ">=0.4.0 <0.4.11", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - } - }, - "websocket-extensions": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", - "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", - "dev": true, - "requires": { - "errno": "~0.1.7" - } - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, - "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", - "dev": true, - "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" - }, - "dependencies": { - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true - } - } - }, - "yargs-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", - "dev": true, - "requires": { - "camelcase": "^3.0.0" - }, - "dependencies": { - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true - } - } - } - } -} diff --git a/package.json b/package.json index 0ef72a02f..108bd508b 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,9 @@ { + "scripts": { + "test": "jest src/app/services", + "watch": "jest --watch src/app/services", + "start": "webpack-dev-server --disable-host-check" + }, "devDependencies": { "angular": "^1.7.9", "angular-loader": "~1.5.0", @@ -13,7 +18,7 @@ "bootstrap": "3", "css-loader": "^1.0.0", "cytoscape": "https://github.com/fishtown-analytics/cytoscape.js.git#feature/cubic-bezier-edges", - "cytoscape-context-menus": "^3.0.5", + "cytoscape-context-menus": "3.0.5", "cytoscape-dagre": "^2.2.1", "cytoscape-expand-collapse": "^3.1.1", "dagre": "^0.7.4", @@ -25,6 +30,7 @@ "html-webpack-plugin": "^3.2.0", "html5-boilerplate": "^5.3.0", "inline-source": "^6.1.5", + "jest": "^26.2.2", "jquery": "~3.4.0", "md5": "^2.2.1", "ngtemplate-loader": "^2.0.1", @@ -40,10 +46,6 @@ "webpack-dev-server": "^3.1.11", "webpack-inline-svg-plugin": "^1.1.4" }, - "scripts": { - "test": "echo 'Error: no test specified' && exit 1", - "start": "webpack-dev-server" - }, "dependencies": { "prismjs": "^1.20.0" } diff --git a/src/app/components/code_block/code_block.css b/src/app/components/code_block/code_block.css index 84459cf2d..8cf6b58b9 100644 --- a/src/app/components/code_block/code_block.css +++ b/src/app/components/code_block/code_block.css @@ -1,7 +1,3 @@ -pre, code { - background-color: transparent !important; -} - pre.code { border: none !important; overflow-y: visible !important; diff --git a/src/app/components/code_block/code_block.html b/src/app/components/code_block/code_block.html index 9b3cc04bb..fd7f7c575 100644 --- a/src/app/components/code_block/code_block.html +++ b/src/app/components/code_block/code_block.html @@ -14,7 +14,8 @@
    Code
    -
    +
    diff --git a/src/app/components/graph/graph-launcher.html b/src/app/components/graph/graph-launcher.html index 4b45f04a0..5a3b991a7 100644 --- a/src/app/components/graph/graph-launcher.html +++ b/src/app/components/graph/graph-launcher.html @@ -192,7 +192,7 @@
    class="field-input form-control input-dark" ng-model="selectorService.selection.dirty.include" placeholder="..." /> -
    --models
    +
    --select