From 0afcabf7c8ff1554c306687786f5af5c2fb8cfb6 Mon Sep 17 00:00:00 2001 From: Norina-Sun Date: Fri, 10 Sep 2021 10:46:20 -0400 Subject: [PATCH 1/5] feat: adding back subsidiary name and cust ex id --- models/netsuite__income_statement.sql | 1 + models/netsuite__transaction_details.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/models/netsuite__income_statement.sql b/models/netsuite__income_statement.sql index e2419c4a..c9bc2093 100644 --- a/models/netsuite__income_statement.sql +++ b/models/netsuite__income_statement.sql @@ -58,6 +58,7 @@ income_statement as ( accounts.type_name as account_type_name, accounts.account_id as account_id, accounts.account_number, + transaction_details.subsidiary_name, --The below script allows for accounts table pass through columns. {% if var('accounts_pass_through_columns') %} diff --git a/models/netsuite__transaction_details.sql b/models/netsuite__transaction_details.sql index 54fa216a..ce7a19a8 100644 --- a/models/netsuite__transaction_details.sql +++ b/models/netsuite__transaction_details.sql @@ -129,6 +129,7 @@ transaction_details as ( customers.zipcode as customer_zipcode, customers.country as customer_country, customers.date_first_order_at as customer_date_first_order, + customers.customer_extid as customer_external_id, items.name as item_name, items.type_name as item_type_name, items.sales_description, From c813d902435c63f9ebe797c6dc8b9a8de9dc0ab4 Mon Sep 17 00:00:00 2001 From: Norina-Sun Date: Fri, 10 Sep 2021 14:44:27 -0400 Subject: [PATCH 2/5] additional changes --- models/netsuite__income_statement.sql | 5 ++++- models/netsuite__transaction_details.sql | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/models/netsuite__income_statement.sql b/models/netsuite__income_statement.sql index c9bc2093..7afd44fb 100644 --- a/models/netsuite__income_statement.sql +++ b/models/netsuite__income_statement.sql @@ -58,7 +58,7 @@ income_statement as ( accounts.type_name as account_type_name, accounts.account_id as account_id, accounts.account_number, - transaction_details.subsidiary_name, + subsidiaries.name as subsidiary_name, --The below script allows for accounts table pass through columns. {% if var('accounts_pass_through_columns') %} @@ -123,6 +123,9 @@ income_statement as ( join accounting_periods as reporting_accounting_periods on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id + + join subsidiaries + on transactions_with_converted_amounts.subsidiary_id = subsidiaries.subsidiary_id --Below is only used if income statement transaction detail columns are specified dbt_project.yml file. {% if var('income_statement_transaction_detail_columns') != []%} diff --git a/models/netsuite__transaction_details.sql b/models/netsuite__transaction_details.sql index ce7a19a8..05a3c95a 100644 --- a/models/netsuite__transaction_details.sql +++ b/models/netsuite__transaction_details.sql @@ -73,6 +73,11 @@ currencies as ( from {{ var('currencies') }} ), +classes as ( + select * + from {{var('classes')}} +), + transaction_details as ( select transaction_lines.transaction_line_id, @@ -129,7 +134,8 @@ transaction_details as ( customers.zipcode as customer_zipcode, customers.country as customer_country, customers.date_first_order_at as customer_date_first_order, - customers.customer_extid as customer_external_id, + customers.customer_external_id, + classes.full_name as class_full_name, items.name as item_name, items.type_name as item_type_name, items.sales_description, @@ -185,6 +191,9 @@ transaction_details as ( left join customers on customers.customer_id = transaction_lines.company_id + + left join classes + on classes.class_id = transaction_lines.class_id left join items on items.item_id = transaction_lines.item_id From 589823de39006e29bfb3d35c927f0d06efaef963 Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Wed, 15 Sep 2021 16:21:29 -0500 Subject: [PATCH 3/5] initial commit --- dbt_project.yml | 2 +- integration_tests/dbt_project.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index cbf66aca..cae78474 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,6 +1,6 @@ config-version: 2 name: 'netsuite' -version: '0.4.0' +version: '0.4.1' profile: 'integration' require-dbt-version: [">=0.20.0"] models: diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index c0274db3..18afc648 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'netsuite_integration_tests' -version: '0.4.0' +version: '0.4.1' profile: 'integration_tests' config-version: 2 From 720a70882a9bb760d7e9399f69e5efd395cc9eda Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Thu, 16 Sep 2021 12:30:11 -0500 Subject: [PATCH 4/5] docs and final updates --- docs/catalog.json | 2 +- docs/index.html | 24 ++++++++++++------------ docs/manifest.json | 2 +- docs/run_results.json | 1 - models/netsuite.yml | 10 ++++++++++ models/netsuite__income_statement.sql | 2 ++ models/netsuite__transaction_details.sql | 2 +- packages.yml | 8 ++++++-- 8 files changed, 33 insertions(+), 18 deletions(-) delete mode 100644 docs/run_results.json diff --git a/docs/catalog.json b/docs/catalog.json index 4b3c8cc6..80842ad9 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "0.19.1", "generated_at": "2021-06-14T14:24:01.493237Z", "invocation_id": "c05eb1d6-c3fe-439d-be04-41015149fa2d", "env": {}}, "nodes": {"model.netsuite.netsuite__balance_sheet": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_netsuite", "name": "netsuite__balance_sheet", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"accounting_period_id": {"type": "INT64", "index": 1, "name": "accounting_period_id", "comment": null}, "accounting_period_ending": {"type": "TIMESTAMP", "index": 2, "name": "accounting_period_ending", "comment": null}, "accounting_period_full_name": {"type": "STRING", "index": 3, "name": "accounting_period_full_name", "comment": null}, "accounting_period_name": {"type": "STRING", "index": 4, "name": "accounting_period_name", "comment": null}, "is_accounting_period_adjustment": {"type": "BOOL", "index": 5, "name": "is_accounting_period_adjustment", "comment": null}, "is_accounting_period_closed": {"type": "BOOL", "index": 6, "name": "is_accounting_period_closed", "comment": null}, "account_category": {"type": "STRING", "index": 7, "name": "account_category", "comment": null}, "account_name": {"type": "STRING", "index": 8, "name": "account_name", "comment": null}, "account_type_name": {"type": "STRING", "index": 9, "name": "account_type_name", "comment": null}, "account_id": {"type": "INT64", "index": 10, "name": "account_id", "comment": null}, "account_number": {"type": "STRING", "index": 11, "name": "account_number", "comment": null}, "converted_amount": {"type": "INT64", "index": 12, "name": "converted_amount", "comment": null}, "balance_sheet_sort_helper": {"type": "INT64", "index": 13, "name": "balance_sheet_sort_helper", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 0.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite.netsuite__balance_sheet"}, "model.netsuite.netsuite__income_statement": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_netsuite", "name": "netsuite__income_statement", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"accounting_period_id": {"type": "INT64", "index": 1, "name": "accounting_period_id", "comment": null}, "accounting_period_ending": {"type": "TIMESTAMP", "index": 2, "name": "accounting_period_ending", "comment": null}, "accounting_period_full_name": {"type": "STRING", "index": 3, "name": "accounting_period_full_name", "comment": null}, "accounting_period_name": {"type": "STRING", "index": 4, "name": "accounting_period_name", "comment": null}, "is_accounting_period_adjustment": {"type": "BOOL", "index": 5, "name": "is_accounting_period_adjustment", "comment": null}, "is_accounting_period_closed": {"type": "BOOL", "index": 6, "name": "is_accounting_period_closed", "comment": null}, "account_name": {"type": "STRING", "index": 7, "name": "account_name", "comment": null}, "account_type_name": {"type": "STRING", "index": 8, "name": "account_type_name", "comment": null}, "account_id": {"type": "INT64", "index": 9, "name": "account_id", "comment": null}, "account_number": {"type": "STRING", "index": 10, "name": "account_number", "comment": null}, "account_number_and_name": {"type": "STRING", "index": 11, "name": "account_number_and_name", "comment": null}, "class_full_name": {"type": "STRING", "index": 12, "name": "class_full_name", "comment": null}, "location_full_name": {"type": "STRING", "index": 13, "name": "location_full_name", "comment": null}, "department_full_name": {"type": "STRING", "index": 14, "name": "department_full_name", "comment": null}, "converted_amount": {"type": "INT64", "index": 15, "name": "converted_amount", "comment": null}, "account_category": {"type": "STRING", "index": 16, "name": "account_category", "comment": null}, "income_statement_sort_helper": {"type": "INT64", "index": 17, "name": "income_statement_sort_helper", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 0.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite.netsuite__income_statement"}, "model.netsuite.netsuite__transaction_details": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_netsuite", "name": "netsuite__transaction_details", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"transaction_line_id": {"type": "INT64", "index": 1, "name": "transaction_line_id", "comment": null}, "transaction_memo": {"type": "STRING", "index": 2, "name": "transaction_memo", "comment": null}, "is_transaction_non_posting": {"type": "BOOL", "index": 3, "name": "is_transaction_non_posting", "comment": null}, "transaction_id": {"type": "INT64", "index": 4, "name": "transaction_id", "comment": null}, "transaction_status": {"type": "STRING", "index": 5, "name": "transaction_status", "comment": null}, "transaction_date": {"type": "TIMESTAMP", "index": 6, "name": "transaction_date", "comment": null}, "transaction_due_date": {"type": "TIMESTAMP", "index": 7, "name": "transaction_due_date", "comment": null}, "transaction_type": {"type": "STRING", "index": 8, "name": "transaction_type", "comment": null}, "is_transaction_intercompany": {"type": "BOOL", "index": 9, "name": "is_transaction_intercompany", "comment": null}, "accounting_period_ending": {"type": "TIMESTAMP", "index": 10, "name": "accounting_period_ending", "comment": null}, "accounting_period_full_name": {"type": "STRING", "index": 11, "name": "accounting_period_full_name", "comment": null}, "accounting_period_name": {"type": "STRING", "index": 12, "name": "accounting_period_name", "comment": null}, "is_accounting_period_adjustment": {"type": "BOOL", "index": 13, "name": "is_accounting_period_adjustment", "comment": null}, "is_accounting_period_closed": {"type": "BOOL", "index": 14, "name": "is_accounting_period_closed", "comment": null}, "account_name": {"type": "STRING", "index": 15, "name": "account_name", "comment": null}, "account_type_name": {"type": "STRING", "index": 16, "name": "account_type_name", "comment": null}, "account_id": {"type": "INT64", "index": 17, "name": "account_id", "comment": null}, "account_number": {"type": "STRING", "index": 18, "name": "account_number", "comment": null}, "is_account_leftside": {"type": "BOOL", "index": 19, "name": "is_account_leftside", "comment": null}, "is_accounts_payable": {"type": "BOOL", "index": 20, "name": "is_accounts_payable", "comment": null}, "is_accounts_receivable": {"type": "BOOL", "index": 21, "name": "is_accounts_receivable", "comment": null}, "is_account_intercompany": {"type": "BOOL", "index": 22, "name": "is_account_intercompany", "comment": null}, "parent_account_name": {"type": "STRING", "index": 23, "name": "parent_account_name", "comment": null}, "is_income_account": {"type": "BOOL", "index": 24, "name": "is_income_account", "comment": null}, "is_expense_account": {"type": "BOOL", "index": 25, "name": "is_expense_account", "comment": null}, "company_name": {"type": "STRING", "index": 26, "name": "company_name", "comment": null}, "customer_city": {"type": "INT64", "index": 27, "name": "customer_city", "comment": null}, "customer_state": {"type": "INT64", "index": 28, "name": "customer_state", "comment": null}, "customer_zipcode": {"type": "INT64", "index": 29, "name": "customer_zipcode", "comment": null}, "customer_country": {"type": "INT64", "index": 30, "name": "customer_country", "comment": null}, "customer_date_first_order": {"type": "INT64", "index": 31, "name": "customer_date_first_order", "comment": null}, "item_name": {"type": "STRING", "index": 32, "name": "item_name", "comment": null}, "item_type_name": {"type": "STRING", "index": 33, "name": "item_type_name", "comment": null}, "sales_description": {"type": "STRING", "index": 34, "name": "sales_description", "comment": null}, "location_name": {"type": "STRING", "index": 35, "name": "location_name", "comment": null}, "location_city": {"type": "STRING", "index": 36, "name": "location_city", "comment": null}, "location_country": {"type": "STRING", "index": 37, "name": "location_country", "comment": null}, "vendor_type_name": {"type": "STRING", "index": 38, "name": "vendor_type_name", "comment": null}, "vendor_name": {"type": "STRING", "index": 39, "name": "vendor_name", "comment": null}, "vendor_create_date": {"type": "DATETIME", "index": 40, "name": "vendor_create_date", "comment": null}, "currency_name": {"type": "STRING", "index": 41, "name": "currency_name", "comment": null}, "currency_symbol": {"type": "STRING", "index": 42, "name": "currency_symbol", "comment": null}, "department_name": {"type": "STRING", "index": 43, "name": "department_name", "comment": null}, "subsidiary_name": {"type": "STRING", "index": 44, "name": "subsidiary_name", "comment": null}, "converted_amount": {"type": "INT64", "index": 45, "name": "converted_amount", "comment": null}, "transaction_amount": {"type": "INT64", "index": 46, "name": "transaction_amount", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 0.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite.netsuite__transaction_details"}, "model.netsuite_source.stg_netsuite__consolidated_exchange_rates": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__consolidated_exchange_rates", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"consolidated_exchange_rate_id": {"type": "INT64", "index": 1, "name": "consolidated_exchange_rate_id", "comment": null}, "accounting_book_id": {"type": "INT64", "index": 2, "name": "accounting_book_id", "comment": null}, "accounting_period_id": {"type": "INT64", "index": 3, "name": "accounting_period_id", "comment": null}, "average_rate": {"type": "INT64", "index": 4, "name": "average_rate", "comment": null}, "current_rate": {"type": "INT64", "index": 5, "name": "current_rate", "comment": null}, "historical_rate": {"type": "INT64", "index": 6, "name": "historical_rate", "comment": null}, "from_subsidiary_id": {"type": "INT64", "index": 7, "name": "from_subsidiary_id", "comment": null}, "to_subsidiary_id": {"type": "INT64", "index": 8, "name": "to_subsidiary_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 9, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 650.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__consolidated_exchange_rates"}, "model.netsuite_source.stg_netsuite__accounts_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__accounts_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"account_id": {"type": "INT64", "index": 1, "name": "account_id", "comment": null}, "parent_id": {"type": "INT64", "index": 2, "name": "parent_id", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "type_name": {"type": "STRING", "index": 4, "name": "type_name", "comment": null}, "account_number": {"type": "INT64", "index": 5, "name": "account_number", "comment": null}, "general_rate_type": {"type": "STRING", "index": 6, "name": "general_rate_type", "comment": null}, "is_leftside": {"type": "STRING", "index": 7, "name": "is_leftside", "comment": null}, "is_balancesheet": {"type": "STRING", "index": 8, "name": "is_balancesheet", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounts_tmp"}, "model.netsuite_source.stg_netsuite__vendor_types_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__vendor_types_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"vendor_type_id": {"type": "INT64", "index": 1, "name": "vendor_type_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 3, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__vendor_types_tmp"}, "model.netsuite_source.stg_netsuite__accounts": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__accounts", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"account_id": {"type": "INT64", "index": 1, "name": "account_id", "comment": null}, "parent_id": {"type": "INT64", "index": 2, "name": "parent_id", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "type_name": {"type": "STRING", "index": 4, "name": "type_name", "comment": null}, "account_number": {"type": "STRING", "index": 5, "name": "account_number", "comment": null}, "general_rate_type": {"type": "STRING", "index": 6, "name": "general_rate_type", "comment": null}, "is_leftside": {"type": "STRING", "index": 7, "name": "is_leftside", "comment": null}, "is_balancesheet": {"type": "STRING", "index": 8, "name": "is_balancesheet", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1260.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounts"}, "model.netsuite_source.stg_netsuite__departments_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__departments_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"department_id": {"type": "INT64", "index": 1, "name": "department_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "STRING", "index": 3, "name": "full_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__departments_tmp"}, "model.netsuite_source.stg_netsuite__expense_accounts": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__expense_accounts", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"expense_account_id": {"type": "INT64", "index": 1, "name": "expense_account_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "INT64", "index": 4, "name": "account_number", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 500.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__expense_accounts"}, "model.netsuite_source.stg_netsuite__vendors": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__vendors", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"vendor_id": {"type": "INT64", "index": 1, "name": "vendor_id", "comment": null}, "company_name": {"type": "STRING", "index": 2, "name": "company_name", "comment": null}, "create_date_at": {"type": "DATETIME", "index": 3, "name": "create_date_at", "comment": null}, "vendor_type_id": {"type": "INT64", "index": 4, "name": "vendor_type_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 5, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 250.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__vendors"}, "model.netsuite_source.stg_netsuite__income_accounts": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__income_accounts", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"income_account_id": {"type": "INT64", "index": 1, "name": "income_account_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "INT64", "index": 4, "name": "account_number", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 556.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__income_accounts"}, "model.netsuite_source.stg_netsuite__accounting_periods": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__accounting_periods", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"accounting_period_id": {"type": "INT64", "index": 1, "name": "accounting_period_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "STRING", "index": 3, "name": "full_name", "comment": null}, "fiscal_calendar_id": {"type": "INT64", "index": 4, "name": "fiscal_calendar_id", "comment": null}, "year_id": {"type": "INT64", "index": 5, "name": "year_id", "comment": null}, "starting_at": {"type": "TIMESTAMP", "index": 6, "name": "starting_at", "comment": null}, "ending_at": {"type": "TIMESTAMP", "index": 7, "name": "ending_at", "comment": null}, "quarter": {"type": "STRING", "index": 8, "name": "quarter", "comment": null}, "year_0": {"type": "STRING", "index": 9, "name": "year_0", "comment": null}, "is_adjustment": {"type": "STRING", "index": 10, "name": "is_adjustment", "comment": null}, "closed": {"type": "STRING", "index": 11, "name": "closed", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1255.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounting_periods"}, "model.netsuite_source.stg_netsuite__accounting_books": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__accounting_books", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"accounting_book_id": {"type": "INT64", "index": 1, "name": "accounting_book_id", "comment": null}, "is_primary": {"type": "STRING", "index": 2, "name": "is_primary", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 25.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounting_books"}, "model.netsuite_source.stg_netsuite__currencies": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__currencies", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"currency_id": {"type": "INT64", "index": 1, "name": "currency_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "symbol": {"type": "STRING", "index": 3, "name": "symbol", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 4, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 301.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__currencies"}, "model.netsuite_source.stg_netsuite__customers": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__customers", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "INT64", "index": 1, "name": "customer_id", "comment": null}, "company_name": {"type": "STRING", "index": 2, "name": "company_name", "comment": null}, "city": {"type": "INT64", "index": 3, "name": "city", "comment": null}, "state": {"type": "INT64", "index": 4, "name": "state", "comment": null}, "zipcode": {"type": "INT64", "index": 5, "name": "zipcode", "comment": null}, "country": {"type": "INT64", "index": 6, "name": "country", "comment": null}, "date_first_order_at": {"type": "INT64", "index": 7, "name": "date_first_order_at", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 8, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 90.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__customers"}, "model.netsuite_source.stg_netsuite__classes": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__classes", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"class_id": {"type": "INT64", "index": 1, "name": "class_id", "comment": null}, "full_name": {"type": "STRING", "index": 2, "name": "full_name", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 42.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__classes"}, "model.netsuite_source.stg_netsuite__items": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__items", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"item_id": {"type": "INT64", "index": 1, "name": "item_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "type_name": {"type": "STRING", "index": 3, "name": "type_name", "comment": null}, "sales_description": {"type": "STRING", "index": 4, "name": "sales_description", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 760.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__items"}, "model.netsuite_source.stg_netsuite__vendors_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__vendors_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"vendor_id": {"type": "INT64", "index": 1, "name": "vendor_id", "comment": null}, "vendor_type_id": {"type": "INT64", "index": 2, "name": "vendor_type_id", "comment": null}, "company_name": {"type": "STRING", "index": 3, "name": "company_name", "comment": null}, "create_date": {"type": "DATETIME", "index": 4, "name": "create_date", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 5, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__vendors_tmp"}, "model.netsuite_source.stg_netsuite__vendor_types": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__vendor_types", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"vendor_type_id": {"type": "INT64", "index": 1, "name": "vendor_type_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 3, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 430.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__vendor_types"}, "model.netsuite_source.stg_netsuite__expense_accounts_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__expense_accounts_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"expense_account_id": {"type": "INT64", "index": 1, "name": "expense_account_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "INT64", "index": 4, "name": "account_number", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__expense_accounts_tmp"}, "model.netsuite_source.stg_netsuite__transaction_lines_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__transaction_lines_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"transaction_id": {"type": "INT64", "index": 1, "name": "transaction_id", "comment": null}, "transaction_line_id": {"type": "INT64", "index": 2, "name": "transaction_line_id", "comment": null}, "subsidiary_id": {"type": "INT64", "index": 3, "name": "subsidiary_id", "comment": null}, "account_id": {"type": "INT64", "index": 4, "name": "account_id", "comment": null}, "company_id": {"type": "INT64", "index": 5, "name": "company_id", "comment": null}, "item_id": {"type": "INT64", "index": 6, "name": "item_id", "comment": null}, "amount": {"type": "INT64", "index": 7, "name": "amount", "comment": null}, "non_posting_line": {"type": "STRING", "index": 8, "name": "non_posting_line", "comment": null}, "class_id": {"type": "INT64", "index": 9, "name": "class_id", "comment": null}, "location_id": {"type": "INT64", "index": 10, "name": "location_id", "comment": null}, "department_id": {"type": "INT64", "index": 11, "name": "department_id", "comment": null}, "memo": {"type": "STRING", "index": 12, "name": "memo", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__transaction_lines_tmp"}, "model.netsuite_source.stg_netsuite__locations": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__locations", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"location_id": {"type": "INT64", "index": 1, "name": "location_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "STRING", "index": 3, "name": "full_name", "comment": null}, "city": {"type": "STRING", "index": 4, "name": "city", "comment": null}, "country": {"type": "STRING", "index": 5, "name": "country", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 9.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1152.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__locations"}, "model.netsuite_source.stg_netsuite__accounting_periods_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__accounting_periods_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"accounting_period_id": {"type": "INT64", "index": 1, "name": "accounting_period_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "STRING", "index": 3, "name": "full_name", "comment": null}, "fiscal_calendar_id": {"type": "INT64", "index": 4, "name": "fiscal_calendar_id", "comment": null}, "year_id": {"type": "INT64", "index": 5, "name": "year_id", "comment": null}, "starting": {"type": "TIMESTAMP", "index": 6, "name": "starting", "comment": null}, "ending": {"type": "TIMESTAMP", "index": 7, "name": "ending", "comment": null}, "quarter": {"type": "STRING", "index": 8, "name": "quarter", "comment": null}, "year_0": {"type": "STRING", "index": 9, "name": "year_0", "comment": null}, "is_adjustment": {"type": "STRING", "index": 10, "name": "is_adjustment", "comment": null}, "closed": {"type": "STRING", "index": 11, "name": "closed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounting_periods_tmp"}, "model.netsuite_source.stg_netsuite__income_accounts_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__income_accounts_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"income_account_id": {"type": "INT64", "index": 1, "name": "income_account_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "INT64", "index": 4, "name": "account_number", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__income_accounts_tmp"}, "model.netsuite_source.stg_netsuite__subsidiaries": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__subsidiaries", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"subsidiary_id": {"type": "INT64", "index": 1, "name": "subsidiary_id", "comment": null}, "fiscal_calendar_id": {"type": "INT64", "index": 2, "name": "fiscal_calendar_id", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 4, "name": "parent_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 6.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 340.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__subsidiaries"}, "model.netsuite_source.stg_netsuite__accounting_books_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__accounting_books_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"accounting_book_id": {"type": "INT64", "index": 1, "name": "accounting_book_id", "comment": null}, "is_primary": {"type": "STRING", "index": 2, "name": "is_primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounting_books_tmp"}, "model.netsuite_source.stg_netsuite__subsidiaries_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__subsidiaries_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"subsidiary_id": {"type": "INT64", "index": 1, "name": "subsidiary_id", "comment": null}, "fiscal_calendar_id": {"type": "INT64", "index": 2, "name": "fiscal_calendar_id", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 4, "name": "parent_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__subsidiaries_tmp"}, "model.netsuite_source.stg_netsuite__transactions": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__transactions", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"transaction_id": {"type": "INT64", "index": 1, "name": "transaction_id", "comment": null}, "status": {"type": "STRING", "index": 2, "name": "status", "comment": null}, "transaction_date": {"type": "TIMESTAMP", "index": 3, "name": "transaction_date", "comment": null}, "currency_id": {"type": "INT64", "index": 4, "name": "currency_id", "comment": null}, "accounting_period_id": {"type": "INT64", "index": 5, "name": "accounting_period_id", "comment": null}, "due_date_at": {"type": "TIMESTAMP", "index": 6, "name": "due_date_at", "comment": null}, "transaction_type": {"type": "STRING", "index": 7, "name": "transaction_type", "comment": null}, "is_intercompany": {"type": "STRING", "index": 8, "name": "is_intercompany", "comment": null}, "is_advanced_intercompany": {"type": "STRING", "index": 9, "name": "is_advanced_intercompany", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 10, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1090.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__transactions"}, "model.netsuite_source.stg_netsuite__departments": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__departments", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"department_id": {"type": "INT64", "index": 1, "name": "department_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "STRING", "index": 3, "name": "full_name", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 760.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__departments"}, "model.netsuite_source.stg_netsuite__items_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__items_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"item_id": {"type": "INT64", "index": 1, "name": "item_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "type_name": {"type": "STRING", "index": 3, "name": "type_name", "comment": null}, "sales_description": {"type": "STRING", "index": 4, "name": "sales_description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__items_tmp"}, "model.netsuite_source.stg_netsuite__transactions_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__transactions_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"transaction_id": {"type": "INT64", "index": 1, "name": "transaction_id", "comment": null}, "status": {"type": "STRING", "index": 2, "name": "status", "comment": null}, "transaction_date": {"type": "DATETIME", "index": 3, "name": "transaction_date", "comment": null}, "currency_id": {"type": "INT64", "index": 4, "name": "currency_id", "comment": null}, "accounting_period_id": {"type": "INT64", "index": 5, "name": "accounting_period_id", "comment": null}, "due_date": {"type": "TIMESTAMP", "index": 6, "name": "due_date", "comment": null}, "transaction_type": {"type": "STRING", "index": 7, "name": "transaction_type", "comment": null}, "is_intercompany": {"type": "STRING", "index": 8, "name": "is_intercompany", "comment": null}, "is_advanced_intercompany": {"type": "STRING", "index": 9, "name": "is_advanced_intercompany", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 10, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__transactions_tmp"}, "model.netsuite_source.stg_netsuite__locations_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__locations_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"location_id": {"type": "INT64", "index": 1, "name": "location_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "STRING", "index": 3, "name": "full_name", "comment": null}, "city": {"type": "STRING", "index": 4, "name": "city", "comment": null}, "country": {"type": "STRING", "index": 5, "name": "country", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__locations_tmp"}, "model.netsuite_source.stg_netsuite__currencies_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__currencies_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"currency_id": {"type": "INT64", "index": 1, "name": "currency_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "symbol": {"type": "STRING", "index": 3, "name": "symbol", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 4, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__currencies_tmp"}, "model.netsuite_source.stg_netsuite__customers_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__customers_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "INT64", "index": 1, "name": "customer_id", "comment": null}, "company_name": {"type": "STRING", "index": 2, "name": "company_name", "comment": null}, "city": {"type": "INT64", "index": 3, "name": "city", "comment": null}, "state": {"type": "INT64", "index": 4, "name": "state", "comment": null}, "zipcode": {"type": "INT64", "index": 5, "name": "zipcode", "comment": null}, "country": {"type": "INT64", "index": 6, "name": "country", "comment": null}, "date_first_order": {"type": "INT64", "index": 7, "name": "date_first_order", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 8, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__customers_tmp"}, "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__consolidated_exchange_rates_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"consolidated_exchange_rate_id": {"type": "INT64", "index": 1, "name": "consolidated_exchange_rate_id", "comment": null}, "accounting_book_id": {"type": "INT64", "index": 2, "name": "accounting_book_id", "comment": null}, "accounting_period_id": {"type": "INT64", "index": 3, "name": "accounting_period_id", "comment": null}, "average_rate": {"type": "INT64", "index": 4, "name": "average_rate", "comment": null}, "current_rate": {"type": "INT64", "index": 5, "name": "current_rate", "comment": null}, "historical_rate": {"type": "INT64", "index": 6, "name": "historical_rate", "comment": null}, "from_subsidiary_id": {"type": "INT64", "index": 7, "name": "from_subsidiary_id", "comment": null}, "to_subsidiary_id": {"type": "INT64", "index": 8, "name": "to_subsidiary_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 9, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp"}, "model.netsuite_source.stg_netsuite__transaction_lines": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__transaction_lines", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"transaction_id": {"type": "INT64", "index": 1, "name": "transaction_id", "comment": null}, "transaction_line_id": {"type": "INT64", "index": 2, "name": "transaction_line_id", "comment": null}, "subsidiary_id": {"type": "INT64", "index": 3, "name": "subsidiary_id", "comment": null}, "account_id": {"type": "INT64", "index": 4, "name": "account_id", "comment": null}, "company_id": {"type": "INT64", "index": 5, "name": "company_id", "comment": null}, "item_id": {"type": "INT64", "index": 6, "name": "item_id", "comment": null}, "amount": {"type": "INT64", "index": 7, "name": "amount", "comment": null}, "non_posting_line": {"type": "STRING", "index": 8, "name": "non_posting_line", "comment": null}, "class_id": {"type": "INT64", "index": 9, "name": "class_id", "comment": null}, "location_id": {"type": "INT64", "index": 10, "name": "location_id", "comment": null}, "department_id": {"type": "INT64", "index": 11, "name": "department_id", "comment": null}, "memo": {"type": "STRING", "index": 12, "name": "memo", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 742.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__transaction_lines"}, "model.netsuite_source.stg_netsuite__classes_tmp": {"metadata": {"type": "view", "schema": "netsuite_source_integration_tests_stg_netsuite", "name": "stg_netsuite__classes_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"class_id": {"type": "INT64", "index": 1, "name": "class_id", "comment": null}, "full_name": {"type": "STRING", "index": 2, "name": "full_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__classes_tmp"}, "seed.netsuite_integration_tests.items_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "items_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"item_id": {"type": "INT64", "index": 1, "name": "item_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "type_name": {"type": "STRING", "index": 3, "name": "type_name", "comment": null}, "sales_description": {"type": "STRING", "index": 4, "name": "sales_description", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1100.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.items_data"}, "seed.netsuite_integration_tests.accounts_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "accounts_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"account_id": {"type": "INT64", "index": 1, "name": "account_id", "comment": null}, "parent_id": {"type": "INT64", "index": 2, "name": "parent_id", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "type_name": {"type": "STRING", "index": 4, "name": "type_name", "comment": null}, "account_number": {"type": "INT64", "index": 5, "name": "account_number", "comment": null}, "general_rate_type": {"type": "STRING", "index": 6, "name": "general_rate_type", "comment": null}, "is_leftside": {"type": "STRING", "index": 7, "name": "is_leftside", "comment": null}, "is_balancesheet": {"type": "STRING", "index": 8, "name": "is_balancesheet", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1340.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.accounts_data"}, "seed.netsuite_integration_tests.classes_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "classes_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"class_id": {"type": "INT64", "index": 1, "name": "class_id", "comment": null}, "full_name": {"type": "STRING", "index": 2, "name": "full_name", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 42.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.classes_data"}, "seed.netsuite_integration_tests.locations_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "locations_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"location_id": {"type": "INT64", "index": 1, "name": "location_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "STRING", "index": 3, "name": "full_name", "comment": null}, "city": {"type": "STRING", "index": 4, "name": "city", "comment": null}, "country": {"type": "STRING", "index": 5, "name": "country", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 9.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1152.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.locations_data"}, "seed.netsuite_integration_tests.customers_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "customers_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "INT64", "index": 1, "name": "customer_id", "comment": null}, "company_name": {"type": "STRING", "index": 2, "name": "company_name", "comment": null}, "city": {"type": "INT64", "index": 3, "name": "city", "comment": null}, "state": {"type": "INT64", "index": 4, "name": "state", "comment": null}, "zipcode": {"type": "INT64", "index": 5, "name": "zipcode", "comment": null}, "country": {"type": "INT64", "index": 6, "name": "country", "comment": null}, "date_first_order": {"type": "INT64", "index": 7, "name": "date_first_order", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 8, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 430.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.customers_data"}, "seed.netsuite_integration_tests.expense_accounts_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "expense_accounts_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"expense_account_id": {"type": "INT64", "index": 1, "name": "expense_account_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "INT64", "index": 4, "name": "account_number", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 500.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.expense_accounts_data"}, "seed.netsuite_integration_tests.vendors_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "vendors_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"vendor_id": {"type": "INT64", "index": 1, "name": "vendor_id", "comment": null}, "vendor_type_id": {"type": "INT64", "index": 2, "name": "vendor_type_id", "comment": null}, "company_name": {"type": "STRING", "index": 3, "name": "company_name", "comment": null}, "create_date": {"type": "DATETIME", "index": 4, "name": "create_date", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 5, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 590.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.vendors_data"}, "seed.netsuite_integration_tests.currencies_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "currencies_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"currency_id": {"type": "INT64", "index": 1, "name": "currency_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "symbol": {"type": "STRING", "index": 3, "name": "symbol", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 4, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 301.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.currencies_data"}, "seed.netsuite_integration_tests.transactions_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "transactions_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"transaction_id": {"type": "INT64", "index": 1, "name": "transaction_id", "comment": null}, "status": {"type": "STRING", "index": 2, "name": "status", "comment": null}, "transaction_date": {"type": "DATETIME", "index": 3, "name": "transaction_date", "comment": null}, "currency_id": {"type": "INT64", "index": 4, "name": "currency_id", "comment": null}, "accounting_period_id": {"type": "INT64", "index": 5, "name": "accounting_period_id", "comment": null}, "due_date": {"type": "TIMESTAMP", "index": 6, "name": "due_date", "comment": null}, "transaction_type": {"type": "STRING", "index": 7, "name": "transaction_type", "comment": null}, "is_intercompany": {"type": "STRING", "index": 8, "name": "is_intercompany", "comment": null}, "is_advanced_intercompany": {"type": "STRING", "index": 9, "name": "is_advanced_intercompany", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 10, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1170.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.transactions_data"}, "seed.netsuite_integration_tests.vendor_types_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "vendor_types_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"vendor_type_id": {"type": "INT64", "index": 1, "name": "vendor_type_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 3, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 430.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.vendor_types_data"}, "seed.netsuite_integration_tests.accounting_periods_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "accounting_periods_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"accounting_period_id": {"type": "INT64", "index": 1, "name": "accounting_period_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "STRING", "index": 3, "name": "full_name", "comment": null}, "fiscal_calendar_id": {"type": "INT64", "index": 4, "name": "fiscal_calendar_id", "comment": null}, "year_id": {"type": "INT64", "index": 5, "name": "year_id", "comment": null}, "starting": {"type": "TIMESTAMP", "index": 6, "name": "starting", "comment": null}, "ending": {"type": "TIMESTAMP", "index": 7, "name": "ending", "comment": null}, "quarter": {"type": "STRING", "index": 8, "name": "quarter", "comment": null}, "year_0": {"type": "STRING", "index": 9, "name": "year_0", "comment": null}, "is_adjustment": {"type": "STRING", "index": 10, "name": "is_adjustment", "comment": null}, "closed": {"type": "STRING", "index": 11, "name": "closed", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1255.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.accounting_periods_data"}, "seed.netsuite_integration_tests.income_accounts_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "income_accounts_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"income_account_id": {"type": "INT64", "index": 1, "name": "income_account_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "INT64", "index": 4, "name": "account_number", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 556.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.income_accounts_data"}, "seed.netsuite_integration_tests.subsidiaries_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "subsidiaries_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"subsidiary_id": {"type": "INT64", "index": 1, "name": "subsidiary_id", "comment": null}, "fiscal_calendar_id": {"type": "INT64", "index": 2, "name": "fiscal_calendar_id", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 4, "name": "parent_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 6.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 340.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.subsidiaries_data"}, "seed.netsuite_integration_tests.departments_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "departments_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"department_id": {"type": "INT64", "index": 1, "name": "department_id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "STRING", "index": 3, "name": "full_name", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 760.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.departments_data"}, "seed.netsuite_integration_tests.consolidated_exchange_rates_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "consolidated_exchange_rates_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"consolidated_exchange_rate_id": {"type": "INT64", "index": 1, "name": "consolidated_exchange_rate_id", "comment": null}, "accounting_book_id": {"type": "INT64", "index": 2, "name": "accounting_book_id", "comment": null}, "accounting_period_id": {"type": "INT64", "index": 3, "name": "accounting_period_id", "comment": null}, "average_rate": {"type": "INT64", "index": 4, "name": "average_rate", "comment": null}, "current_rate": {"type": "INT64", "index": 5, "name": "current_rate", "comment": null}, "historical_rate": {"type": "INT64", "index": 6, "name": "historical_rate", "comment": null}, "from_subsidiary_id": {"type": "INT64", "index": 7, "name": "from_subsidiary_id", "comment": null}, "to_subsidiary_id": {"type": "INT64", "index": 8, "name": "to_subsidiary_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 9, "name": "_fivetran_deleted", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 650.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.consolidated_exchange_rates_data"}, "seed.netsuite_integration_tests.accounting_books_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "accounting_books_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"accounting_book_id": {"type": "INT64", "index": 1, "name": "accounting_book_id", "comment": null}, "is_primary": {"type": "STRING", "index": 2, "name": "is_primary", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 25.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.accounting_books_data"}, "seed.netsuite_integration_tests.transaction_lines_data": {"metadata": {"type": "table", "schema": "netsuite_source_integration_tests", "name": "transaction_lines_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"transaction_id": {"type": "INT64", "index": 1, "name": "transaction_id", "comment": null}, "transaction_line_id": {"type": "INT64", "index": 2, "name": "transaction_line_id", "comment": null}, "subsidiary_id": {"type": "INT64", "index": 3, "name": "subsidiary_id", "comment": null}, "account_id": {"type": "INT64", "index": 4, "name": "account_id", "comment": null}, "company_id": {"type": "INT64", "index": 5, "name": "company_id", "comment": null}, "item_id": {"type": "INT64", "index": 6, "name": "item_id", "comment": null}, "amount": {"type": "INT64", "index": 7, "name": "amount", "comment": null}, "non_posting_line": {"type": "STRING", "index": 8, "name": "non_posting_line", "comment": null}, "class_id": {"type": "INT64", "index": 9, "name": "class_id", "comment": null}, "location_id": {"type": "INT64", "index": 10, "name": "location_id", "comment": null}, "department_id": {"type": "INT64", "index": 11, "name": "department_id", "comment": null}, "memo": {"type": "STRING", "index": 12, "name": "memo", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 742.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.transaction_lines_data"}}, "sources": {}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "0.20.2", "generated_at": "2021-09-16T17:28:49.804578Z", "invocation_id": "35ac22ef-cd70-4d6c-87c7-1329e7593fa6", "env": {}}, "nodes": {"seed.netsuite_integration_tests.accounting_books_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "accounting_books_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"accounting_book_id": {"type": "integer", "index": 1, "name": "accounting_book_id", "comment": null}, "is_primary": {"type": "text", "index": 2, "name": "is_primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.accounting_books_data"}, "seed.netsuite_integration_tests.accounting_periods_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "accounting_periods_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"accounting_period_id": {"type": "integer", "index": 1, "name": "accounting_period_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "text", "index": 3, "name": "full_name", "comment": null}, "fiscal_calendar_id": {"type": "bigint", "index": 4, "name": "fiscal_calendar_id", "comment": null}, "year_id": {"type": "integer", "index": 5, "name": "year_id", "comment": null}, "starting": {"type": "timestamp without time zone", "index": 6, "name": "starting", "comment": null}, "ending": {"type": "timestamp without time zone", "index": 7, "name": "ending", "comment": null}, "quarter": {"type": "text", "index": 8, "name": "quarter", "comment": null}, "year_0": {"type": "text", "index": 9, "name": "year_0", "comment": null}, "is_adjustment": {"type": "text", "index": 10, "name": "is_adjustment", "comment": null}, "closed": {"type": "text", "index": 11, "name": "closed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.accounting_periods_data"}, "seed.netsuite_integration_tests.accounts_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "accounts_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"account_id": {"type": "integer", "index": 1, "name": "account_id", "comment": null}, "parent_id": {"type": "integer", "index": 2, "name": "parent_id", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "type_name": {"type": "text", "index": 4, "name": "type_name", "comment": null}, "account_number": {"type": "integer", "index": 5, "name": "account_number", "comment": null}, "general_rate_type": {"type": "text", "index": 6, "name": "general_rate_type", "comment": null}, "is_leftside": {"type": "text", "index": 7, "name": "is_leftside", "comment": null}, "is_balancesheet": {"type": "text", "index": 8, "name": "is_balancesheet", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.accounts_data"}, "seed.netsuite_integration_tests.classes_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "classes_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"class_id": {"type": "integer", "index": 1, "name": "class_id", "comment": null}, "full_name": {"type": "text", "index": 2, "name": "full_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.classes_data"}, "seed.netsuite_integration_tests.consolidated_exchange_rates_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "consolidated_exchange_rates_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"consolidated_exchange_rate_id": {"type": "integer", "index": 1, "name": "consolidated_exchange_rate_id", "comment": null}, "accounting_book_id": {"type": "integer", "index": 2, "name": "accounting_book_id", "comment": null}, "accounting_period_id": {"type": "integer", "index": 3, "name": "accounting_period_id", "comment": null}, "average_rate": {"type": "integer", "index": 4, "name": "average_rate", "comment": null}, "current_rate": {"type": "integer", "index": 5, "name": "current_rate", "comment": null}, "historical_rate": {"type": "integer", "index": 6, "name": "historical_rate", "comment": null}, "from_subsidiary_id": {"type": "integer", "index": 7, "name": "from_subsidiary_id", "comment": null}, "to_subsidiary_id": {"type": "integer", "index": 8, "name": "to_subsidiary_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 9, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.consolidated_exchange_rates_data"}, "seed.netsuite_integration_tests.currencies_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "currencies_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"currency_id": {"type": "integer", "index": 1, "name": "currency_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "symbol": {"type": "text", "index": 3, "name": "symbol", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.currencies_data"}, "seed.netsuite_integration_tests.customers_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "customers_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"customer_id": {"type": "integer", "index": 1, "name": "customer_id", "comment": null}, "company_name": {"type": "text", "index": 2, "name": "company_name", "comment": null}, "city": {"type": "integer", "index": 3, "name": "city", "comment": null}, "state": {"type": "integer", "index": 4, "name": "state", "comment": null}, "zipcode": {"type": "integer", "index": 5, "name": "zipcode", "comment": null}, "country": {"type": "integer", "index": 6, "name": "country", "comment": null}, "date_first_order": {"type": "integer", "index": 7, "name": "date_first_order", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 8, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.customers_data"}, "seed.netsuite_integration_tests.departments_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "departments_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"department_id": {"type": "integer", "index": 1, "name": "department_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "text", "index": 3, "name": "full_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.departments_data"}, "seed.netsuite_integration_tests.expense_accounts_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "expense_accounts_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"expense_account_id": {"type": "integer", "index": 1, "name": "expense_account_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "integer", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "integer", "index": 4, "name": "account_number", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.expense_accounts_data"}, "seed.netsuite_integration_tests.income_accounts_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "income_accounts_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"income_account_id": {"type": "integer", "index": 1, "name": "income_account_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "integer", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "integer", "index": 4, "name": "account_number", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.income_accounts_data"}, "seed.netsuite_integration_tests.items_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "items_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"item_id": {"type": "integer", "index": 1, "name": "item_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "type_name": {"type": "text", "index": 3, "name": "type_name", "comment": null}, "sales_description": {"type": "text", "index": 4, "name": "sales_description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.items_data"}, "seed.netsuite_integration_tests.locations_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "locations_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"location_id": {"type": "integer", "index": 1, "name": "location_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "text", "index": 3, "name": "full_name", "comment": null}, "city": {"type": "text", "index": 4, "name": "city", "comment": null}, "country": {"type": "text", "index": 5, "name": "country", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.locations_data"}, "seed.netsuite_integration_tests.subsidiaries_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "subsidiaries_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"subsidiary_id": {"type": "integer", "index": 1, "name": "subsidiary_id", "comment": null}, "fiscal_calendar_id": {"type": "integer", "index": 2, "name": "fiscal_calendar_id", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "integer", "index": 4, "name": "parent_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.subsidiaries_data"}, "seed.netsuite_integration_tests.transaction_lines_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "transaction_lines_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"transaction_id": {"type": "integer", "index": 1, "name": "transaction_id", "comment": null}, "transaction_line_id": {"type": "integer", "index": 2, "name": "transaction_line_id", "comment": null}, "subsidiary_id": {"type": "integer", "index": 3, "name": "subsidiary_id", "comment": null}, "account_id": {"type": "integer", "index": 4, "name": "account_id", "comment": null}, "company_id": {"type": "integer", "index": 5, "name": "company_id", "comment": null}, "item_id": {"type": "integer", "index": 6, "name": "item_id", "comment": null}, "amount": {"type": "integer", "index": 7, "name": "amount", "comment": null}, "non_posting_line": {"type": "text", "index": 8, "name": "non_posting_line", "comment": null}, "class_id": {"type": "integer", "index": 9, "name": "class_id", "comment": null}, "location_id": {"type": "integer", "index": 10, "name": "location_id", "comment": null}, "department_id": {"type": "integer", "index": 11, "name": "department_id", "comment": null}, "memo": {"type": "text", "index": 12, "name": "memo", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.transaction_lines_data"}, "seed.netsuite_integration_tests.transactions_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "transactions_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"transaction_id": {"type": "integer", "index": 1, "name": "transaction_id", "comment": null}, "status": {"type": "text", "index": 2, "name": "status", "comment": null}, "transaction_date": {"type": "timestamp without time zone", "index": 3, "name": "transaction_date", "comment": null}, "currency_id": {"type": "integer", "index": 4, "name": "currency_id", "comment": null}, "accounting_period_id": {"type": "integer", "index": 5, "name": "accounting_period_id", "comment": null}, "due_date": {"type": "timestamp without time zone", "index": 6, "name": "due_date", "comment": null}, "transaction_type": {"type": "text", "index": 7, "name": "transaction_type", "comment": null}, "is_intercompany": {"type": "text", "index": 8, "name": "is_intercompany", "comment": null}, "is_advanced_intercompany": {"type": "text", "index": 9, "name": "is_advanced_intercompany", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 10, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.transactions_data"}, "seed.netsuite_integration_tests.vendor_types_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "vendor_types_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"vendor_type_id": {"type": "integer", "index": 1, "name": "vendor_type_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.vendor_types_data"}, "seed.netsuite_integration_tests.vendors_data": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests", "name": "vendors_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"vendor_id": {"type": "integer", "index": 1, "name": "vendor_id", "comment": null}, "vendor_type_id": {"type": "integer", "index": 2, "name": "vendor_type_id", "comment": null}, "company_name": {"type": "text", "index": 3, "name": "company_name", "comment": null}, "create_date": {"type": "timestamp without time zone", "index": 4, "name": "create_date", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.netsuite_integration_tests.vendors_data"}, "model.netsuite.netsuite__balance_sheet": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_netsuite", "name": "netsuite__balance_sheet", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"accounting_period_id": {"type": "integer", "index": 1, "name": "accounting_period_id", "comment": null}, "accounting_period_ending": {"type": "timestamp without time zone", "index": 2, "name": "accounting_period_ending", "comment": null}, "accounting_period_full_name": {"type": "text", "index": 3, "name": "accounting_period_full_name", "comment": null}, "accounting_period_name": {"type": "text", "index": 4, "name": "accounting_period_name", "comment": null}, "is_accounting_period_adjustment": {"type": "boolean", "index": 5, "name": "is_accounting_period_adjustment", "comment": null}, "is_accounting_period_closed": {"type": "boolean", "index": 6, "name": "is_accounting_period_closed", "comment": null}, "account_category": {"type": "text", "index": 7, "name": "account_category", "comment": null}, "account_name": {"type": "text", "index": 8, "name": "account_name", "comment": null}, "account_type_name": {"type": "text", "index": 9, "name": "account_type_name", "comment": null}, "account_id": {"type": "integer", "index": 10, "name": "account_id", "comment": null}, "account_number": {"type": "character varying", "index": 11, "name": "account_number", "comment": null}, "converted_amount": {"type": "integer", "index": 12, "name": "converted_amount", "comment": null}, "balance_sheet_sort_helper": {"type": "integer", "index": 13, "name": "balance_sheet_sort_helper", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite.netsuite__balance_sheet"}, "model.netsuite.netsuite__income_statement": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_netsuite", "name": "netsuite__income_statement", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"accounting_period_id": {"type": "integer", "index": 1, "name": "accounting_period_id", "comment": null}, "accounting_period_ending": {"type": "timestamp without time zone", "index": 2, "name": "accounting_period_ending", "comment": null}, "accounting_period_full_name": {"type": "text", "index": 3, "name": "accounting_period_full_name", "comment": null}, "accounting_period_name": {"type": "text", "index": 4, "name": "accounting_period_name", "comment": null}, "is_accounting_period_adjustment": {"type": "boolean", "index": 5, "name": "is_accounting_period_adjustment", "comment": null}, "is_accounting_period_closed": {"type": "boolean", "index": 6, "name": "is_accounting_period_closed", "comment": null}, "account_name": {"type": "text", "index": 7, "name": "account_name", "comment": null}, "account_type_name": {"type": "text", "index": 8, "name": "account_type_name", "comment": null}, "account_id": {"type": "integer", "index": 9, "name": "account_id", "comment": null}, "account_number": {"type": "character varying", "index": 10, "name": "account_number", "comment": null}, "subsidiary_id": {"type": "integer", "index": 11, "name": "subsidiary_id", "comment": null}, "subsidiary_full_name": {"type": "character varying", "index": 12, "name": "subsidiary_full_name", "comment": null}, "subsidiary_name": {"type": "text", "index": 13, "name": "subsidiary_name", "comment": null}, "account_number_and_name": {"type": "text", "index": 14, "name": "account_number_and_name", "comment": null}, "class_full_name": {"type": "text", "index": 15, "name": "class_full_name", "comment": null}, "location_full_name": {"type": "text", "index": 16, "name": "location_full_name", "comment": null}, "department_full_name": {"type": "text", "index": 17, "name": "department_full_name", "comment": null}, "converted_amount": {"type": "integer", "index": 18, "name": "converted_amount", "comment": null}, "account_category": {"type": "text", "index": 19, "name": "account_category", "comment": null}, "income_statement_sort_helper": {"type": "integer", "index": 20, "name": "income_statement_sort_helper", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite.netsuite__income_statement"}, "model.netsuite.netsuite__transaction_details": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_netsuite", "name": "netsuite__transaction_details", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"transaction_line_id": {"type": "integer", "index": 1, "name": "transaction_line_id", "comment": null}, "transaction_memo": {"type": "text", "index": 2, "name": "transaction_memo", "comment": null}, "is_transaction_non_posting": {"type": "boolean", "index": 3, "name": "is_transaction_non_posting", "comment": null}, "transaction_id": {"type": "integer", "index": 4, "name": "transaction_id", "comment": null}, "transaction_status": {"type": "text", "index": 5, "name": "transaction_status", "comment": null}, "transaction_date": {"type": "timestamp without time zone", "index": 6, "name": "transaction_date", "comment": null}, "transaction_due_date": {"type": "timestamp without time zone", "index": 7, "name": "transaction_due_date", "comment": null}, "transaction_type": {"type": "text", "index": 8, "name": "transaction_type", "comment": null}, "is_transaction_intercompany": {"type": "boolean", "index": 9, "name": "is_transaction_intercompany", "comment": null}, "accounting_period_ending": {"type": "timestamp without time zone", "index": 10, "name": "accounting_period_ending", "comment": null}, "accounting_period_full_name": {"type": "text", "index": 11, "name": "accounting_period_full_name", "comment": null}, "accounting_period_name": {"type": "text", "index": 12, "name": "accounting_period_name", "comment": null}, "is_accounting_period_adjustment": {"type": "boolean", "index": 13, "name": "is_accounting_period_adjustment", "comment": null}, "is_accounting_period_closed": {"type": "boolean", "index": 14, "name": "is_accounting_period_closed", "comment": null}, "account_name": {"type": "text", "index": 15, "name": "account_name", "comment": null}, "account_type_name": {"type": "text", "index": 16, "name": "account_type_name", "comment": null}, "account_id": {"type": "integer", "index": 17, "name": "account_id", "comment": null}, "account_number": {"type": "character varying", "index": 18, "name": "account_number", "comment": null}, "is_account_leftside": {"type": "boolean", "index": 19, "name": "is_account_leftside", "comment": null}, "is_accounts_payable": {"type": "boolean", "index": 20, "name": "is_accounts_payable", "comment": null}, "is_accounts_receivable": {"type": "boolean", "index": 21, "name": "is_accounts_receivable", "comment": null}, "is_account_intercompany": {"type": "boolean", "index": 22, "name": "is_account_intercompany", "comment": null}, "parent_account_name": {"type": "text", "index": 23, "name": "parent_account_name", "comment": null}, "is_income_account": {"type": "boolean", "index": 24, "name": "is_income_account", "comment": null}, "is_expense_account": {"type": "boolean", "index": 25, "name": "is_expense_account", "comment": null}, "company_name": {"type": "character varying", "index": 26, "name": "company_name", "comment": null}, "customer_city": {"type": "integer", "index": 27, "name": "customer_city", "comment": null}, "customer_state": {"type": "integer", "index": 28, "name": "customer_state", "comment": null}, "customer_zipcode": {"type": "integer", "index": 29, "name": "customer_zipcode", "comment": null}, "customer_country": {"type": "integer", "index": 30, "name": "customer_country", "comment": null}, "customer_date_first_order": {"type": "integer", "index": 31, "name": "customer_date_first_order", "comment": null}, "customer_external_id": {"type": "character varying", "index": 32, "name": "customer_external_id", "comment": null}, "class_full_name": {"type": "text", "index": 33, "name": "class_full_name", "comment": null}, "item_name": {"type": "text", "index": 34, "name": "item_name", "comment": null}, "item_type_name": {"type": "text", "index": 35, "name": "item_type_name", "comment": null}, "sales_description": {"type": "character varying", "index": 36, "name": "sales_description", "comment": null}, "location_name": {"type": "text", "index": 37, "name": "location_name", "comment": null}, "location_city": {"type": "text", "index": 38, "name": "location_city", "comment": null}, "location_country": {"type": "text", "index": 39, "name": "location_country", "comment": null}, "vendor_type_name": {"type": "text", "index": 40, "name": "vendor_type_name", "comment": null}, "vendor_name": {"type": "character varying", "index": 41, "name": "vendor_name", "comment": null}, "vendor_create_date": {"type": "timestamp without time zone", "index": 42, "name": "vendor_create_date", "comment": null}, "currency_name": {"type": "text", "index": 43, "name": "currency_name", "comment": null}, "currency_symbol": {"type": "text", "index": 44, "name": "currency_symbol", "comment": null}, "department_name": {"type": "text", "index": 45, "name": "department_name", "comment": null}, "subsidiary_name": {"type": "text", "index": 46, "name": "subsidiary_name", "comment": null}, "converted_amount": {"type": "integer", "index": 47, "name": "converted_amount", "comment": null}, "transaction_amount": {"type": "integer", "index": 48, "name": "transaction_amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite.netsuite__transaction_details"}, "model.netsuite_source.stg_netsuite__accounting_books": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__accounting_books", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"accounting_book_id": {"type": "integer", "index": 1, "name": "accounting_book_id", "comment": null}, "is_primary": {"type": "text", "index": 2, "name": "is_primary", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounting_books"}, "model.netsuite_source.stg_netsuite__accounting_books_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__accounting_books_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"accounting_book_id": {"type": "integer", "index": 1, "name": "accounting_book_id", "comment": null}, "is_primary": {"type": "text", "index": 2, "name": "is_primary", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounting_books_tmp"}, "model.netsuite_source.stg_netsuite__accounting_periods": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__accounting_periods", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"accounting_period_id": {"type": "integer", "index": 1, "name": "accounting_period_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "text", "index": 3, "name": "full_name", "comment": null}, "fiscal_calendar_id": {"type": "bigint", "index": 4, "name": "fiscal_calendar_id", "comment": null}, "year_id": {"type": "integer", "index": 5, "name": "year_id", "comment": null}, "starting_at": {"type": "timestamp without time zone", "index": 6, "name": "starting_at", "comment": null}, "ending_at": {"type": "timestamp without time zone", "index": 7, "name": "ending_at", "comment": null}, "quarter": {"type": "text", "index": 8, "name": "quarter", "comment": null}, "year_0": {"type": "text", "index": 9, "name": "year_0", "comment": null}, "is_adjustment": {"type": "text", "index": 10, "name": "is_adjustment", "comment": null}, "closed": {"type": "text", "index": 11, "name": "closed", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 12, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounting_periods"}, "model.netsuite_source.stg_netsuite__accounting_periods_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__accounting_periods_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"accounting_period_id": {"type": "integer", "index": 1, "name": "accounting_period_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "text", "index": 3, "name": "full_name", "comment": null}, "fiscal_calendar_id": {"type": "bigint", "index": 4, "name": "fiscal_calendar_id", "comment": null}, "year_id": {"type": "integer", "index": 5, "name": "year_id", "comment": null}, "starting": {"type": "timestamp without time zone", "index": 6, "name": "starting", "comment": null}, "ending": {"type": "timestamp without time zone", "index": 7, "name": "ending", "comment": null}, "quarter": {"type": "text", "index": 8, "name": "quarter", "comment": null}, "year_0": {"type": "text", "index": 9, "name": "year_0", "comment": null}, "is_adjustment": {"type": "text", "index": 10, "name": "is_adjustment", "comment": null}, "closed": {"type": "text", "index": 11, "name": "closed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounting_periods_tmp"}, "model.netsuite_source.stg_netsuite__accounts": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__accounts", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"account_id": {"type": "integer", "index": 1, "name": "account_id", "comment": null}, "parent_id": {"type": "integer", "index": 2, "name": "parent_id", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "type_name": {"type": "text", "index": 4, "name": "type_name", "comment": null}, "account_number": {"type": "character varying", "index": 5, "name": "account_number", "comment": null}, "general_rate_type": {"type": "text", "index": 6, "name": "general_rate_type", "comment": null}, "is_leftside": {"type": "text", "index": 7, "name": "is_leftside", "comment": null}, "is_balancesheet": {"type": "text", "index": 8, "name": "is_balancesheet", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 9, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounts"}, "model.netsuite_source.stg_netsuite__accounts_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__accounts_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"account_id": {"type": "integer", "index": 1, "name": "account_id", "comment": null}, "parent_id": {"type": "integer", "index": 2, "name": "parent_id", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "type_name": {"type": "text", "index": 4, "name": "type_name", "comment": null}, "account_number": {"type": "integer", "index": 5, "name": "account_number", "comment": null}, "general_rate_type": {"type": "text", "index": 6, "name": "general_rate_type", "comment": null}, "is_leftside": {"type": "text", "index": 7, "name": "is_leftside", "comment": null}, "is_balancesheet": {"type": "text", "index": 8, "name": "is_balancesheet", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__accounts_tmp"}, "model.netsuite_source.stg_netsuite__classes": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__classes", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"class_id": {"type": "integer", "index": 1, "name": "class_id", "comment": null}, "full_name": {"type": "text", "index": 2, "name": "full_name", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__classes"}, "model.netsuite_source.stg_netsuite__classes_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__classes_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"class_id": {"type": "integer", "index": 1, "name": "class_id", "comment": null}, "full_name": {"type": "text", "index": 2, "name": "full_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__classes_tmp"}, "model.netsuite_source.stg_netsuite__consolidated_exchange_rates": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__consolidated_exchange_rates", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"consolidated_exchange_rate_id": {"type": "integer", "index": 1, "name": "consolidated_exchange_rate_id", "comment": null}, "accounting_book_id": {"type": "integer", "index": 2, "name": "accounting_book_id", "comment": null}, "accounting_period_id": {"type": "integer", "index": 3, "name": "accounting_period_id", "comment": null}, "average_rate": {"type": "integer", "index": 4, "name": "average_rate", "comment": null}, "current_rate": {"type": "integer", "index": 5, "name": "current_rate", "comment": null}, "historical_rate": {"type": "integer", "index": 6, "name": "historical_rate", "comment": null}, "from_subsidiary_id": {"type": "integer", "index": 7, "name": "from_subsidiary_id", "comment": null}, "to_subsidiary_id": {"type": "integer", "index": 8, "name": "to_subsidiary_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 9, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__consolidated_exchange_rates"}, "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__consolidated_exchange_rates_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"consolidated_exchange_rate_id": {"type": "integer", "index": 1, "name": "consolidated_exchange_rate_id", "comment": null}, "accounting_book_id": {"type": "integer", "index": 2, "name": "accounting_book_id", "comment": null}, "accounting_period_id": {"type": "integer", "index": 3, "name": "accounting_period_id", "comment": null}, "average_rate": {"type": "integer", "index": 4, "name": "average_rate", "comment": null}, "current_rate": {"type": "integer", "index": 5, "name": "current_rate", "comment": null}, "historical_rate": {"type": "integer", "index": 6, "name": "historical_rate", "comment": null}, "from_subsidiary_id": {"type": "integer", "index": 7, "name": "from_subsidiary_id", "comment": null}, "to_subsidiary_id": {"type": "integer", "index": 8, "name": "to_subsidiary_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 9, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp"}, "model.netsuite_source.stg_netsuite__currencies": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__currencies", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"currency_id": {"type": "integer", "index": 1, "name": "currency_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "symbol": {"type": "text", "index": 3, "name": "symbol", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__currencies"}, "model.netsuite_source.stg_netsuite__currencies_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__currencies_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"currency_id": {"type": "integer", "index": 1, "name": "currency_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "symbol": {"type": "text", "index": 3, "name": "symbol", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__currencies_tmp"}, "model.netsuite_source.stg_netsuite__customers": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__customers", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"customer_id": {"type": "integer", "index": 1, "name": "customer_id", "comment": null}, "company_name": {"type": "character varying", "index": 2, "name": "company_name", "comment": null}, "customer_external_id": {"type": "character varying", "index": 3, "name": "customer_external_id", "comment": null}, "city": {"type": "integer", "index": 4, "name": "city", "comment": null}, "state": {"type": "integer", "index": 5, "name": "state", "comment": null}, "zipcode": {"type": "integer", "index": 6, "name": "zipcode", "comment": null}, "country": {"type": "integer", "index": 7, "name": "country", "comment": null}, "date_first_order_at": {"type": "integer", "index": 8, "name": "date_first_order_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 9, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__customers"}, "model.netsuite_source.stg_netsuite__customers_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__customers_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"customer_id": {"type": "integer", "index": 1, "name": "customer_id", "comment": null}, "company_name": {"type": "text", "index": 2, "name": "company_name", "comment": null}, "city": {"type": "integer", "index": 3, "name": "city", "comment": null}, "state": {"type": "integer", "index": 4, "name": "state", "comment": null}, "zipcode": {"type": "integer", "index": 5, "name": "zipcode", "comment": null}, "country": {"type": "integer", "index": 6, "name": "country", "comment": null}, "date_first_order": {"type": "integer", "index": 7, "name": "date_first_order", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 8, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__customers_tmp"}, "model.netsuite_source.stg_netsuite__departments": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__departments", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"department_id": {"type": "integer", "index": 1, "name": "department_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "text", "index": 3, "name": "full_name", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__departments"}, "model.netsuite_source.stg_netsuite__departments_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__departments_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"department_id": {"type": "integer", "index": 1, "name": "department_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "text", "index": 3, "name": "full_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__departments_tmp"}, "model.netsuite_source.stg_netsuite__expense_accounts": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__expense_accounts", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"expense_account_id": {"type": "integer", "index": 1, "name": "expense_account_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "integer", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "integer", "index": 4, "name": "account_number", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__expense_accounts"}, "model.netsuite_source.stg_netsuite__expense_accounts_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__expense_accounts_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"expense_account_id": {"type": "integer", "index": 1, "name": "expense_account_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "integer", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "integer", "index": 4, "name": "account_number", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__expense_accounts_tmp"}, "model.netsuite_source.stg_netsuite__income_accounts": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__income_accounts", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"income_account_id": {"type": "integer", "index": 1, "name": "income_account_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "integer", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "integer", "index": 4, "name": "account_number", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__income_accounts"}, "model.netsuite_source.stg_netsuite__income_accounts_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__income_accounts_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"income_account_id": {"type": "integer", "index": 1, "name": "income_account_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "parent_id": {"type": "integer", "index": 3, "name": "parent_id", "comment": null}, "account_number": {"type": "integer", "index": 4, "name": "account_number", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__income_accounts_tmp"}, "model.netsuite_source.stg_netsuite__items": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__items", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"item_id": {"type": "integer", "index": 1, "name": "item_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "type_name": {"type": "text", "index": 3, "name": "type_name", "comment": null}, "sales_description": {"type": "character varying", "index": 4, "name": "sales_description", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__items"}, "model.netsuite_source.stg_netsuite__items_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__items_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"item_id": {"type": "integer", "index": 1, "name": "item_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "type_name": {"type": "text", "index": 3, "name": "type_name", "comment": null}, "sales_description": {"type": "text", "index": 4, "name": "sales_description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__items_tmp"}, "model.netsuite_source.stg_netsuite__locations": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__locations", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"location_id": {"type": "integer", "index": 1, "name": "location_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "text", "index": 3, "name": "full_name", "comment": null}, "city": {"type": "text", "index": 4, "name": "city", "comment": null}, "country": {"type": "text", "index": 5, "name": "country", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 6, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__locations"}, "model.netsuite_source.stg_netsuite__locations_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__locations_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"location_id": {"type": "integer", "index": 1, "name": "location_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "full_name": {"type": "text", "index": 3, "name": "full_name", "comment": null}, "city": {"type": "text", "index": 4, "name": "city", "comment": null}, "country": {"type": "text", "index": 5, "name": "country", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__locations_tmp"}, "model.netsuite_source.stg_netsuite__subsidiaries": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__subsidiaries", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"subsidiary_id": {"type": "integer", "index": 1, "name": "subsidiary_id", "comment": null}, "fiscal_calendar_id": {"type": "integer", "index": 2, "name": "fiscal_calendar_id", "comment": null}, "full_name": {"type": "character varying", "index": 3, "name": "full_name", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "parent_id": {"type": "integer", "index": 5, "name": "parent_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 6, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__subsidiaries"}, "model.netsuite_source.stg_netsuite__subsidiaries_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__subsidiaries_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"subsidiary_id": {"type": "integer", "index": 1, "name": "subsidiary_id", "comment": null}, "fiscal_calendar_id": {"type": "integer", "index": 2, "name": "fiscal_calendar_id", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "integer", "index": 4, "name": "parent_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__subsidiaries_tmp"}, "model.netsuite_source.stg_netsuite__transaction_lines": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__transaction_lines", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"transaction_id": {"type": "integer", "index": 1, "name": "transaction_id", "comment": null}, "transaction_line_id": {"type": "integer", "index": 2, "name": "transaction_line_id", "comment": null}, "subsidiary_id": {"type": "integer", "index": 3, "name": "subsidiary_id", "comment": null}, "account_id": {"type": "integer", "index": 4, "name": "account_id", "comment": null}, "company_id": {"type": "integer", "index": 5, "name": "company_id", "comment": null}, "item_id": {"type": "integer", "index": 6, "name": "item_id", "comment": null}, "amount": {"type": "integer", "index": 7, "name": "amount", "comment": null}, "non_posting_line": {"type": "text", "index": 8, "name": "non_posting_line", "comment": null}, "class_id": {"type": "integer", "index": 9, "name": "class_id", "comment": null}, "location_id": {"type": "integer", "index": 10, "name": "location_id", "comment": null}, "department_id": {"type": "integer", "index": 11, "name": "department_id", "comment": null}, "memo": {"type": "text", "index": 12, "name": "memo", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__transaction_lines"}, "model.netsuite_source.stg_netsuite__transaction_lines_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__transaction_lines_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"transaction_id": {"type": "integer", "index": 1, "name": "transaction_id", "comment": null}, "transaction_line_id": {"type": "integer", "index": 2, "name": "transaction_line_id", "comment": null}, "subsidiary_id": {"type": "integer", "index": 3, "name": "subsidiary_id", "comment": null}, "account_id": {"type": "integer", "index": 4, "name": "account_id", "comment": null}, "company_id": {"type": "integer", "index": 5, "name": "company_id", "comment": null}, "item_id": {"type": "integer", "index": 6, "name": "item_id", "comment": null}, "amount": {"type": "integer", "index": 7, "name": "amount", "comment": null}, "non_posting_line": {"type": "text", "index": 8, "name": "non_posting_line", "comment": null}, "class_id": {"type": "integer", "index": 9, "name": "class_id", "comment": null}, "location_id": {"type": "integer", "index": 10, "name": "location_id", "comment": null}, "department_id": {"type": "integer", "index": 11, "name": "department_id", "comment": null}, "memo": {"type": "text", "index": 12, "name": "memo", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__transaction_lines_tmp"}, "model.netsuite_source.stg_netsuite__transactions": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__transactions", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"transaction_id": {"type": "integer", "index": 1, "name": "transaction_id", "comment": null}, "status": {"type": "text", "index": 2, "name": "status", "comment": null}, "transaction_date": {"type": "timestamp without time zone", "index": 3, "name": "transaction_date", "comment": null}, "currency_id": {"type": "integer", "index": 4, "name": "currency_id", "comment": null}, "accounting_period_id": {"type": "integer", "index": 5, "name": "accounting_period_id", "comment": null}, "due_date_at": {"type": "timestamp without time zone", "index": 6, "name": "due_date_at", "comment": null}, "transaction_type": {"type": "text", "index": 7, "name": "transaction_type", "comment": null}, "is_intercompany": {"type": "text", "index": 8, "name": "is_intercompany", "comment": null}, "is_advanced_intercompany": {"type": "text", "index": 9, "name": "is_advanced_intercompany", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 10, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__transactions"}, "model.netsuite_source.stg_netsuite__transactions_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__transactions_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"transaction_id": {"type": "integer", "index": 1, "name": "transaction_id", "comment": null}, "status": {"type": "text", "index": 2, "name": "status", "comment": null}, "transaction_date": {"type": "timestamp without time zone", "index": 3, "name": "transaction_date", "comment": null}, "currency_id": {"type": "integer", "index": 4, "name": "currency_id", "comment": null}, "accounting_period_id": {"type": "integer", "index": 5, "name": "accounting_period_id", "comment": null}, "due_date": {"type": "timestamp without time zone", "index": 6, "name": "due_date", "comment": null}, "transaction_type": {"type": "text", "index": 7, "name": "transaction_type", "comment": null}, "is_intercompany": {"type": "text", "index": 8, "name": "is_intercompany", "comment": null}, "is_advanced_intercompany": {"type": "text", "index": 9, "name": "is_advanced_intercompany", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 10, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__transactions_tmp"}, "model.netsuite_source.stg_netsuite__vendor_types": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__vendor_types", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"vendor_type_id": {"type": "integer", "index": 1, "name": "vendor_type_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__vendor_types"}, "model.netsuite_source.stg_netsuite__vendor_types_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__vendor_types_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"vendor_type_id": {"type": "integer", "index": 1, "name": "vendor_type_id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__vendor_types_tmp"}, "model.netsuite_source.stg_netsuite__vendors": {"metadata": {"type": "BASE TABLE", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__vendors", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"vendor_id": {"type": "integer", "index": 1, "name": "vendor_id", "comment": null}, "company_name": {"type": "character varying", "index": 2, "name": "company_name", "comment": null}, "create_date_at": {"type": "timestamp without time zone", "index": 3, "name": "create_date_at", "comment": null}, "vendor_type_id": {"type": "integer", "index": 4, "name": "vendor_type_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__vendors"}, "model.netsuite_source.stg_netsuite__vendors_tmp": {"metadata": {"type": "VIEW", "schema": "netsuite_integration_tests_stg_netsuite", "name": "stg_netsuite__vendors_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"vendor_id": {"type": "integer", "index": 1, "name": "vendor_id", "comment": null}, "vendor_type_id": {"type": "integer", "index": 2, "name": "vendor_type_id", "comment": null}, "company_name": {"type": "text", "index": 3, "name": "company_name", "comment": null}, "create_date": {"type": "timestamp without time zone", "index": 4, "name": "create_date", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.netsuite_source.stg_netsuite__vendors_tmp"}}, "sources": {}, "errors": null} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 360349ab..ee9f2978 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,7 +8,7 @@ - + @@ -16,9 +16,9 @@ - + - + @@ -26,7 +26,7 @@
diff --git a/docs/manifest.json b/docs/manifest.json index 1ea2ca9d..b009f959 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v1.json", "dbt_version": "0.19.1", "generated_at": "2021-06-14T14:23:56.108489Z", "invocation_id": "c05eb1d6-c3fe-439d-be04-41015149fa2d", "env": {}, "project_id": "1288e68047c03dc418c42073e1469b09", "user_id": "57178664-37b2-4047-9572-68ec8b488cd7", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.netsuite_integration_tests.accounting_books_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "accounting_books_data"], "unique_id": "seed.netsuite_integration_tests.accounting_books_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "accounting_books_data.csv", "original_file_path": "data/accounting_books_data.csv", "name": "accounting_books_data", "alias": "accounting_books_data", "checksum": {"name": "sha256", "checksum": "45b73583ed0a1425f131de59b6a17b997caec17d9b0884947f27008ae81c1684"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`accounting_books_data`"}, "seed.netsuite_integration_tests.vendors_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "vendors_data"], "unique_id": "seed.netsuite_integration_tests.vendors_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "vendors_data.csv", "original_file_path": "data/vendors_data.csv", "name": "vendors_data", "alias": "vendors_data", "checksum": {"name": "sha256", "checksum": "f050ea1d5fa346fcefbe9a5792dfbe9f5aabbec17a359ab2e497be7b3e888e2d"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`vendors_data`"}, "seed.netsuite_integration_tests.classes_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "classes_data"], "unique_id": "seed.netsuite_integration_tests.classes_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "classes_data.csv", "original_file_path": "data/classes_data.csv", "name": "classes_data", "alias": "classes_data", "checksum": {"name": "sha256", "checksum": "18e8a63665925edfacbeaa443c7f6632c4489bd521df77d945ee657d398588e3"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`classes_data`"}, "seed.netsuite_integration_tests.locations_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "locations_data"], "unique_id": "seed.netsuite_integration_tests.locations_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "locations_data.csv", "original_file_path": "data/locations_data.csv", "name": "locations_data", "alias": "locations_data", "checksum": {"name": "sha256", "checksum": "8a71a79adb44cc02707a75ee10a85f03b472324a894ddc32716eeea7d533bc2f"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`locations_data`"}, "seed.netsuite_integration_tests.consolidated_exchange_rates_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "consolidated_exchange_rates_data"], "unique_id": "seed.netsuite_integration_tests.consolidated_exchange_rates_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "consolidated_exchange_rates_data.csv", "original_file_path": "data/consolidated_exchange_rates_data.csv", "name": "consolidated_exchange_rates_data", "alias": "consolidated_exchange_rates_data", "checksum": {"name": "sha256", "checksum": "b8719124e41745363f91f996b99812a9e6c98306ef24034c5efb12b64600a496"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`consolidated_exchange_rates_data`"}, "seed.netsuite_integration_tests.customers_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "customers_data"], "unique_id": "seed.netsuite_integration_tests.customers_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "customers_data.csv", "original_file_path": "data/customers_data.csv", "name": "customers_data", "alias": "customers_data", "checksum": {"name": "sha256", "checksum": "e3ce06d6edaeb9f777c340a597d8de7cfb2d3423a20a2421eae4c86264a9c93a"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`customers_data`"}, "seed.netsuite_integration_tests.accounts_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "accounts_data"], "unique_id": "seed.netsuite_integration_tests.accounts_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "accounts_data.csv", "original_file_path": "data/accounts_data.csv", "name": "accounts_data", "alias": "accounts_data", "checksum": {"name": "sha256", "checksum": "a3d24c6bf7438f0bf6e0a725565ea0bb000c6fa01b7ffbdfb1b70689f5ad515b"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`accounts_data`"}, "seed.netsuite_integration_tests.subsidiaries_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "subsidiaries_data"], "unique_id": "seed.netsuite_integration_tests.subsidiaries_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "subsidiaries_data.csv", "original_file_path": "data/subsidiaries_data.csv", "name": "subsidiaries_data", "alias": "subsidiaries_data", "checksum": {"name": "sha256", "checksum": "4dd2e8b192c4c052a847d6791b5a32da6968a3234d48b85a37ae20f7ee9445de"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`subsidiaries_data`"}, "seed.netsuite_integration_tests.currencies_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "currencies_data"], "unique_id": "seed.netsuite_integration_tests.currencies_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "currencies_data.csv", "original_file_path": "data/currencies_data.csv", "name": "currencies_data", "alias": "currencies_data", "checksum": {"name": "sha256", "checksum": "f98ba1751b715296956912fc4c2b43f58875c56740e829c045aefe1172cb2232"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`currencies_data`"}, "seed.netsuite_integration_tests.income_accounts_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "income_accounts_data"], "unique_id": "seed.netsuite_integration_tests.income_accounts_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "income_accounts_data.csv", "original_file_path": "data/income_accounts_data.csv", "name": "income_accounts_data", "alias": "income_accounts_data", "checksum": {"name": "sha256", "checksum": "53a81321736b4a42663e253050539eb48b0d179847e23f161927d29c4cbf1367"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`income_accounts_data`"}, "seed.netsuite_integration_tests.expense_accounts_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "expense_accounts_data"], "unique_id": "seed.netsuite_integration_tests.expense_accounts_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "expense_accounts_data.csv", "original_file_path": "data/expense_accounts_data.csv", "name": "expense_accounts_data", "alias": "expense_accounts_data", "checksum": {"name": "sha256", "checksum": "983ef804359afb2c0f7db8c3bb32d5eecdec8c0d9fbf502360944877dc212f9c"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`expense_accounts_data`"}, "seed.netsuite_integration_tests.departments_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "departments_data"], "unique_id": "seed.netsuite_integration_tests.departments_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "departments_data.csv", "original_file_path": "data/departments_data.csv", "name": "departments_data", "alias": "departments_data", "checksum": {"name": "sha256", "checksum": "9060203f11419c602daf8afc578035d29ef612e1e868b12fa22eaf7b37942607"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`departments_data`"}, "seed.netsuite_integration_tests.vendor_types_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "vendor_types_data"], "unique_id": "seed.netsuite_integration_tests.vendor_types_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "vendor_types_data.csv", "original_file_path": "data/vendor_types_data.csv", "name": "vendor_types_data", "alias": "vendor_types_data", "checksum": {"name": "sha256", "checksum": "2111fb5a226e9e73c187a1a1a13caa0c2d3b54bb2eedfe3287f636c049c72b64"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`vendor_types_data`"}, "seed.netsuite_integration_tests.items_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "items_data"], "unique_id": "seed.netsuite_integration_tests.items_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "items_data.csv", "original_file_path": "data/items_data.csv", "name": "items_data", "alias": "items_data", "checksum": {"name": "sha256", "checksum": "567fc2b4c8e46962f9297095017fa529544feafed31503e9fc3ed51bf60b866d"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`items_data`"}, "seed.netsuite_integration_tests.transactions_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"due_date": "timestamp"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "transactions_data"], "unique_id": "seed.netsuite_integration_tests.transactions_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "transactions_data.csv", "original_file_path": "data/transactions_data.csv", "name": "transactions_data", "alias": "transactions_data", "checksum": {"name": "sha256", "checksum": "c1d88d96de5d5e6ed310a6b008df7390a2aaf7b0d857668e0dfed259f0c704ed"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "column_types": {"due_date": "timestamp"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`transactions_data`"}, "seed.netsuite_integration_tests.transaction_lines_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "transaction_lines_data"], "unique_id": "seed.netsuite_integration_tests.transaction_lines_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "transaction_lines_data.csv", "original_file_path": "data/transaction_lines_data.csv", "name": "transaction_lines_data", "alias": "transaction_lines_data", "checksum": {"name": "sha256", "checksum": "6786bdf4b6e00d6243008c46d0bb69a21158ff27265690503aaa9d8b6faa01d2"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`transaction_lines_data`"}, "seed.netsuite_integration_tests.accounting_periods_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"ending": "timestamp", "starting": "timestamp", "fiscal_calendar_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests", "fqn": ["netsuite_integration_tests", "accounting_periods_data"], "unique_id": "seed.netsuite_integration_tests.accounting_periods_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "accounting_periods_data.csv", "original_file_path": "data/accounting_periods_data.csv", "name": "accounting_periods_data", "alias": "accounting_periods_data", "checksum": {"name": "sha256", "checksum": "673c2f4c76e4cb8bbccecc7e30c0056163d39f53174013f0460a2e4e5efe6e33"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "column_types": {"ending": "timestamp", "starting": "timestamp", "fiscal_calendar_id": "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests`.`accounting_periods_data`"}, "model.netsuite_source.stg_netsuite__transactions": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__transactions_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__transactions_tmp')),\n staging_columns=get_transactions_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('transactions_pass_through_columns') %}\n ,\n {{ var('transactions_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from base\n),\n\nfinal as (\n \n select \n transaction_id,\n status,\n trandate as transaction_date,\n currency_id,\n accounting_period_id,\n due_date as due_date_at,\n transaction_type,\n is_intercompany,\n is_advanced_intercompany,\n _fivetran_deleted\n\n --The below script allows for pass through columns.\n {% if var('transactions_pass_through_columns') %}\n ,\n {{ var('transactions_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_transactions_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__transactions_tmp", "model.netsuite_source.stg_netsuite__transactions_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__transactions"], "unique_id": "model.netsuite_source.stg_netsuite__transactions", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__transactions.sql", "original_file_path": "models/stg_netsuite__transactions.sql", "name": "stg_netsuite__transactions", "alias": "stg_netsuite__transactions", "checksum": {"name": "sha256", "checksum": "0abff28b2320d70674f504b02dc967dcff81bcc0716198278bd375f2c7d3e3f7"}, "tags": [], "refs": [["stg_netsuite__transactions_tmp"], ["stg_netsuite__transactions_tmp"]], "sources": [], "description": "A table detailing all transactions.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The unique identifier of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction (ie. Paid In Full, Open, Cancelled).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_date": {"name": "transaction_date", "description": "The timestamp of the transaction date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_id": {"name": "currency_id", "description": "The currency id of the currency used in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_id": {"name": "accounting_period_id", "description": "The accounting period id of the accounting period which the transaction took place in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date_at": {"name": "due_date_at", "description": "The timestamp of the transaction due date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_type": {"name": "transaction_type", "description": "The transaction type (ie. Bill, Check, Deposit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_intercompany": {"name": "is_intercompany", "description": "Value indicating whether the transaction is intercompany (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_advanced_intercompany": {"name": "is_advanced_intercompany", "description": "Value indicating whether the transaction is an advanced intercompany journal entry (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__transactions.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n accounting_period_id\n \n as \n \n accounting_period_id\n \n, \n \n \n currency_id\n \n as \n \n currency_id\n \n, \n \n \n due_date\n \n as \n \n due_date\n \n, \n \n \n is_advanced_intercompany\n \n as \n \n is_advanced_intercompany\n \n, \n \n \n is_intercompany\n \n as \n \n is_intercompany\n \n, \n \n \n status\n \n as \n \n status\n \n, \n cast(null as \n timestamp\n) as \n \n trandate\n \n , \n \n \n transaction_id\n \n as \n \n transaction_id\n \n, \n \n \n transaction_type\n \n as \n \n transaction_type\n \n\n\n\n\n --The below script allows for pass through columns.\n \n \n from base\n),\n\nfinal as (\n \n select \n transaction_id,\n status,\n trandate as transaction_date,\n currency_id,\n accounting_period_id,\n due_date as due_date_at,\n transaction_type,\n is_intercompany,\n is_advanced_intercompany,\n _fivetran_deleted\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`"}, "model.netsuite_source.stg_netsuite__customers": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__customers_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__customers_tmp')),\n staging_columns=get_customers_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n customer_id,\n companyname as company_name,\n city,\n state,\n zipcode,\n country,\n date_first_order as date_first_order_at,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_customers_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__customers_tmp", "model.netsuite_source.stg_netsuite__customers_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__customers"], "unique_id": "model.netsuite_source.stg_netsuite__customers", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__customers.sql", "original_file_path": "models/stg_netsuite__customers.sql", "name": "stg_netsuite__customers", "alias": "stg_netsuite__customers", "checksum": {"name": "sha256", "checksum": "e89170382babb0207974b694f6238b22ce877ae13e85dc298e58a6b853b7e9e9"}, "tags": [], "refs": [["stg_netsuite__customers_tmp"], ["stg_netsuite__customers_tmp"]], "sources": [], "description": "Table detailing all customer information.", "columns": {"customer_id": {"name": "customer_id", "description": "The unique identifier of the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company_name": {"name": "company_name", "description": "The name of thecompany.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zipcode": {"name": "zipcode", "description": "The zipcode of the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The country where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_first_order_at": {"name": "date_first_order_at", "description": "The timestamp of the customers first order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__customers.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__customers_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n string\n) as \n \n account_owner\n \n , \n cast(null as \n string\n) as \n \n accountnumber\n \n , \n cast(null as \n string\n) as \n \n accounts_email\n \n , \n cast(null as \n string\n) as \n \n alcohol_recipient_type\n \n , \n cast(null as \n string\n) as \n \n allow_task_time_for_allocation\n \n , \n cast(null as \n string\n) as \n \n altemail\n \n , \n cast(null as \n float64\n) as \n \n alternate_contact_id\n \n , \n cast(null as \n string\n) as \n \n altphone\n \n , \n cast(null as \n float64\n) as \n \n amount_complete\n \n , \n cast(null as \n float64\n) as \n \n annual_revenue\n \n , \n cast(null as \n string\n) as \n \n assess_use_tax_on_billavatax\n \n , \n cast(null as \n string\n) as \n \n auto_renewals\n \n , \n cast(null as \n string\n) as \n \n auto_send_statements\n \n , \n cast(null as \n string\n) as \n \n bill_com_customer_name\n \n , \n cast(null as \n string\n) as \n \n bill_com_last_updated_by_impo\n \n , \n cast(null as \n string\n) as \n \n bill_com_shortname\n \n , \n cast(null as \n float64\n) as \n \n bill_com_vendor_info_id\n \n , \n cast(null as \n string\n) as \n \n bill_com_vendor_name\n \n , \n cast(null as \n string\n) as \n \n billaddress\n \n , \n cast(null as \n float64\n) as \n \n billing_rate_card_id\n \n , \n cast(null as \n float64\n) as \n \n billing_schedule_id\n \n , \n cast(null as \n string\n) as \n \n billing_schedule_type\n \n , \n cast(null as \n string\n) as \n \n billing_transaction_type\n \n , \n cast(null as \n string\n) as \n \n brn\n \n , \n cast(null as \n timestamp\n) as \n \n calculated_end\n \n , \n cast(null as \n string\n) as \n \n category_0\n \n , \n \n \n city\n \n as \n \n city\n \n, \n cast(null as \n string\n) as \n \n comments\n \n , \n cast(null as \n string\n) as \n \n companyname\n \n , \n cast(null as \n float64\n) as \n \n consol_days_overdue\n \n , \n cast(null as \n float64\n) as \n \n consol_deposit_balance\n \n , \n cast(null as \n float64\n) as \n \n consol_deposit_balance_foreign\n \n , \n cast(null as \n float64\n) as \n \n consol_openbalance\n \n , \n cast(null as \n float64\n) as \n \n consol_openbalance_foreign\n \n , \n cast(null as \n float64\n) as \n \n consol_unbilled_orders\n \n , \n cast(null as \n float64\n) as \n \n consol_unbilled_orders_foreign\n \n , \n cast(null as \n float64\n) as \n \n converted_to_contact_id\n \n , \n cast(null as \n float64\n) as \n \n converted_to_id\n \n , \n cast(null as \n float64\n) as \n \n cost_estimate\n \n , \n \n \n country\n \n as \n \n country\n \n, \n cast(null as \n timestamp\n) as \n \n create_date\n \n , \n cast(null as \n string\n) as \n \n credithold\n \n , \n cast(null as \n float64\n) as \n \n creditlimit\n \n , \n cast(null as \n float64\n) as \n \n currency_id\n \n , \n cast(null as \n string\n) as \n \n customer_extid\n \n , \n \n \n customer_id\n \n as \n \n customer_id\n \n, \n cast(null as \n float64\n) as \n \n customer_type_id\n \n , \n cast(null as \n timestamp\n) as \n \n date_calculated_start\n \n , \n cast(null as \n timestamp\n) as \n \n date_closed\n \n , \n cast(null as \n timestamp\n) as \n \n date_convsersion\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n \n \n date_first_order\n \n as \n \n date_first_order\n \n, \n cast(null as \n timestamp\n) as \n \n date_first_sale\n \n , \n cast(null as \n timestamp\n) as \n \n date_gross_lead\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_order\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_sale\n \n , \n cast(null as \n timestamp\n) as \n \n date_lead\n \n , \n cast(null as \n timestamp\n) as \n \n date_prospect\n \n , \n cast(null as \n timestamp\n) as \n \n date_scheduled_end\n \n , \n cast(null as \n float64\n) as \n \n days_overdue\n \n , \n cast(null as \n float64\n) as \n \n default_order_priority\n \n , \n cast(null as \n float64\n) as \n \n default_receivables_account_id\n \n , \n cast(null as \n float64\n) as \n \n deposit_balance\n \n , \n cast(null as \n float64\n) as \n \n deposit_balance_foreign\n \n , \n cast(null as \n string\n) as \n \n dic\n \n , \n cast(null as \n string\n) as \n \n email\n \n , \n cast(null as \n string\n) as \n \n email_bill_payment_vouchers\n \n , \n cast(null as \n string\n) as \n \n email_cash_sales\n \n , \n cast(null as \n string\n) as \n \n email_credit_notes\n \n , \n cast(null as \n string\n) as \n \n email_invoices\n \n , \n cast(null as \n string\n) as \n \n email_item_fulfilments\n \n , \n cast(null as \n string\n) as \n \n email_purchase_orders\n \n , \n cast(null as \n string\n) as \n \n email_quotes\n \n , \n cast(null as \n string\n) as \n \n email_sales_orders\n \n , \n cast(null as \n string\n) as \n \n email_statements\n \n , \n cast(null as \n string\n) as \n \n employee_number\n \n , \n cast(null as \n string\n) as \n \n exemption_certificate_no\n \n , \n cast(null as \n timestamp\n) as \n \n expected_close\n \n , \n cast(null as \n string\n) as \n \n fax\n \n , \n cast(null as \n float64\n) as \n \n first_sale_period_id\n \n , \n cast(null as \n timestamp\n) as \n \n first_visit\n \n , \n cast(null as \n string\n) as \n \n firstname\n \n , \n cast(null as \n string\n) as \n \n forecast_based_on_allocations\n \n , \n cast(null as \n string\n) as \n \n forecast_charge_run_on_demand\n \n , \n cast(null as \n string\n) as \n \n full_name\n \n , \n cast(null as \n string\n) as \n \n home_phone\n \n , \n cast(null as \n string\n) as \n \n hris_id\n \n , \n cast(null as \n string\n) as \n \n ico\n \n , \n cast(null as \n string\n) as \n \n id_number_in_the_country_of_r\n \n , \n cast(null as \n float64\n) as \n \n id_type_in_the_country_of_r_id\n \n , \n cast(null as \n float64\n) as \n \n industry_id\n \n , \n cast(null as \n string\n) as \n \n invoice_via_procurement_syste\n \n , \n cast(null as \n string\n) as \n \n invoicing_details\n \n , \n cast(null as \n string\n) as \n \n is_exempt_time\n \n , \n cast(null as \n string\n) as \n \n is_explicit_conversion\n \n , \n cast(null as \n string\n) as \n \n is_job\n \n , \n cast(null as \n string\n) as \n \n is_limit_time_to_assignees\n \n , \n cast(null as \n string\n) as \n \n is_partner\n \n , \n cast(null as \n string\n) as \n \n is_person\n \n , \n cast(null as \n string\n) as \n \n is_productive_time\n \n , \n cast(null as \n string\n) as \n \n is_project_completely_billed\n \n , \n cast(null as \n string\n) as \n \n is_source_item_from_brc\n \n , \n cast(null as \n string\n) as \n \n is_utilized_time\n \n , \n cast(null as \n string\n) as \n \n isemailhtml\n \n , \n cast(null as \n string\n) as \n \n isemailpdf\n \n , \n cast(null as \n string\n) as \n \n isinactive\n \n , \n cast(null as \n string\n) as \n \n istaxable\n \n , \n cast(null as \n timestamp\n) as \n \n job_end\n \n , \n cast(null as \n timestamp\n) as \n \n job_start\n \n , \n cast(null as \n float64\n) as \n \n job_type_id\n \n , \n cast(null as \n string\n) as \n \n labor_budget_from_allocations\n \n , \n cast(null as \n string\n) as \n \n language_id\n \n , \n cast(null as \n timestamp\n) as \n \n last_modified_date\n \n , \n cast(null as \n float64\n) as \n \n last_sale_period_id\n \n , \n cast(null as \n timestamp\n) as \n \n last_sales_activity\n \n , \n cast(null as \n timestamp\n) as \n \n last_visit\n \n , \n cast(null as \n string\n) as \n \n lastname\n \n , \n cast(null as \n float64\n) as \n \n lead_source_id\n \n , \n cast(null as \n string\n) as \n \n line1\n \n , \n cast(null as \n string\n) as \n \n line2\n \n , \n cast(null as \n string\n) as \n \n line3\n \n , \n cast(null as \n string\n) as \n \n loginaccess\n \n , \n cast(null as \n string\n) as \n \n lsa_link\n \n , \n cast(null as \n string\n) as \n \n lsa_link_name\n \n , \n cast(null as \n string\n) as \n \n middlename\n \n , \n cast(null as \n string\n) as \n \n mobile_phone\n \n , \n cast(null as \n timestamp\n) as \n \n msa_effective_date\n \n , \n cast(null as \n float64\n) as \n \n multiple_price_id\n \n , \n cast(null as \n string\n) as \n \n name\n \n , \n cast(null as \n float64\n) as \n \n no__of_employees\n \n , \n cast(null as \n float64\n) as \n \n openbalance\n \n , \n cast(null as \n float64\n) as \n \n openbalance_foreign\n \n , \n cast(null as \n float64\n) as \n \n parent_id\n \n , \n cast(null as \n float64\n) as \n \n partner_id\n \n , \n cast(null as \n float64\n) as \n \n payment_terms_id\n \n , \n cast(null as \n string\n) as \n \n phone\n \n , \n cast(null as \n float64\n) as \n \n primary_contact_id\n \n , \n cast(null as \n string\n) as \n \n print_on_check_as\n \n , \n cast(null as \n float64\n) as \n \n probability\n \n , \n cast(null as \n float64\n) as \n \n project_expense_type_id\n \n , \n cast(null as \n float64\n) as \n \n project_manager_id\n \n , \n cast(null as \n timestamp\n) as \n \n projected_end\n \n , \n cast(null as \n string\n) as \n \n purchases_email\n \n , \n cast(null as \n string\n) as \n \n referrer\n \n , \n cast(null as \n float64\n) as \n \n reminderdays\n \n , \n cast(null as \n timestamp\n) as \n \n renewal\n \n , \n cast(null as \n float64\n) as \n \n represents_subsidiary_id\n \n , \n cast(null as \n string\n) as \n \n resalenumber\n \n , \n cast(null as \n string\n) as \n \n restrict_access_to_expensify\n \n , \n cast(null as \n float64\n) as \n \n rev_rec_forecast_rule_id\n \n , \n cast(null as \n float64\n) as \n \n rev_rec_forecast_template\n \n , \n cast(null as \n float64\n) as \n \n revenue_estimate\n \n , \n cast(null as \n float64\n) as \n \n sales_rep_id\n \n , \n cast(null as \n float64\n) as \n \n sales_territory_id\n \n , \n cast(null as \n string\n) as \n \n salesforce_id\n \n , \n cast(null as \n string\n) as \n \n salutation\n \n , \n cast(null as \n string\n) as \n \n scheduling_method_id\n \n , \n cast(null as \n string\n) as \n \n ship_complete\n \n , \n cast(null as \n string\n) as \n \n shipaddress\n \n , \n cast(null as \n string\n) as \n \n shipping_email\n \n , \n \n \n state\n \n as \n \n state\n \n, \n cast(null as \n string\n) as \n \n status\n \n , \n cast(null as \n string\n) as \n \n status_descr\n \n , \n cast(null as \n float64\n) as \n \n status_probability\n \n , \n cast(null as \n string\n) as \n \n status_read_only\n \n , \n cast(null as \n float64\n) as \n \n subsidiary_id\n \n , \n cast(null as \n string\n) as \n \n tax_contact_first_name\n \n , \n cast(null as \n float64\n) as \n \n tax_contact_id\n \n , \n cast(null as \n string\n) as \n \n tax_contact_last_name\n \n , \n cast(null as \n string\n) as \n \n tax_contact_middle_name\n \n , \n cast(null as \n float64\n) as \n \n tax_item_id\n \n , \n cast(null as \n string\n) as \n \n tax_number\n \n , \n cast(null as \n string\n) as \n \n third_party_acct\n \n , \n cast(null as \n string\n) as \n \n third_party_carrier\n \n , \n cast(null as \n string\n) as \n \n third_party_country\n \n , \n cast(null as \n string\n) as \n \n third_party_zip_code\n \n , \n cast(null as \n float64\n) as \n \n time_approval_type_id\n \n , \n cast(null as \n float64\n) as \n \n top_level_parent_id\n \n , \n cast(null as \n string\n) as \n \n transactions_need_approval\n \n , \n cast(null as \n string\n) as \n \n uen\n \n , \n cast(null as \n float64\n) as \n \n unbilled_orders\n \n , \n cast(null as \n float64\n) as \n \n unbilled_orders_foreign\n \n , \n cast(null as \n string\n) as \n \n url\n \n , \n cast(null as \n string\n) as \n \n use_calculated_billing_budget\n \n , \n cast(null as \n string\n) as \n \n use_calculated_cost_budget\n \n , \n cast(null as \n string\n) as \n \n use_percent_complete_override\n \n , \n cast(null as \n string\n) as \n \n vat_reg_number\n \n , \n cast(null as \n string\n) as \n \n vat_registration_no\n \n , \n cast(null as \n string\n) as \n \n web_lead\n \n , \n \n \n zipcode\n \n as \n \n zipcode\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n customer_id,\n companyname as company_name,\n city,\n state,\n zipcode,\n country,\n date_first_order as date_first_order_at,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__customers`"}, "model.netsuite_source.stg_netsuite__accounting_books": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__accounting_books_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__accounting_books_tmp')),\n staging_columns=get_accounting_books_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n accounting_book_id,\n is_primary\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_accounting_books_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_books_tmp", "model.netsuite_source.stg_netsuite__accounting_books_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__accounting_books"], "unique_id": "model.netsuite_source.stg_netsuite__accounting_books", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__accounting_books.sql", "original_file_path": "models/stg_netsuite__accounting_books.sql", "name": "stg_netsuite__accounting_books", "alias": "stg_netsuite__accounting_books", "checksum": {"name": "sha256", "checksum": "0656e188f23e8001ed889fea70846463e5037324812c0936d2265cb4ef7c360b"}, "tags": [], "refs": [["stg_netsuite__accounting_books_tmp"], ["stg_netsuite__accounting_books_tmp"]], "sources": [], "description": "Table detailing all accounting books set up in Netsuite.", "columns": {"accounting_book_id": {"name": "accounting_book_id", "description": "The unique identifier of the accounting book.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_primary": {"name": "is_primary", "description": "Boolean indicating whether it is a primary accounting book.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__accounting_books.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n string\n) as \n \n accounting_book_extid\n \n , \n \n \n accounting_book_id\n \n as \n \n accounting_book_id\n \n, \n cast(null as \n string\n) as \n \n accounting_book_name\n \n , \n cast(null as \n float64\n) as \n \n base_book_id\n \n , \n cast(null as \n timestamp\n) as \n \n date_created\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n float64\n) as \n \n effective_period_id\n \n , \n cast(null as \n string\n) as \n \n form_template_component_id\n \n , \n cast(null as \n float64\n) as \n \n form_template_id\n \n , \n cast(null as \n string\n) as \n \n is_adjustment_only\n \n , \n cast(null as \n string\n) as \n \n is_arrangement_level_reclass\n \n , \n cast(null as \n string\n) as \n \n is_consolidated\n \n , \n cast(null as \n string\n) as \n \n is_contingent_revenue_handling\n \n , \n cast(null as \n string\n) as \n \n is_include_child_subsidiaries\n \n , \n \n \n is_primary\n \n as \n \n is_primary\n \n, \n cast(null as \n string\n) as \n \n is_two_step_revenue_allocation\n \n , \n cast(null as \n string\n) as \n \n status\n \n , \n cast(null as \n string\n) as \n \n unbilled_receivable_grouping\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n accounting_book_id,\n is_primary\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`"}, "model.netsuite_source.stg_netsuite__consolidated_exchange_rates": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__consolidated_exchange_rates_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__consolidated_exchange_rates_tmp')),\n staging_columns=get_consolidated_exchange_rates_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n consolidated_exchange_rate_id,\n accounting_book_id,\n accounting_period_id,\n average_rate,\n current_rate,\n historical_rate,\n from_subsidiary_id,\n to_subsidiary_id,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_consolidated_exchange_rates_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp", "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__consolidated_exchange_rates"], "unique_id": "model.netsuite_source.stg_netsuite__consolidated_exchange_rates", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__consolidated_exchange_rates.sql", "original_file_path": "models/stg_netsuite__consolidated_exchange_rates.sql", "name": "stg_netsuite__consolidated_exchange_rates", "alias": "stg_netsuite__consolidated_exchange_rates", "checksum": {"name": "sha256", "checksum": "282a2b65bcc994b187413fa57d28e587d1c70f80bde273e0eca768425db007d5"}, "tags": [], "refs": [["stg_netsuite__consolidated_exchange_rates_tmp"], ["stg_netsuite__consolidated_exchange_rates_tmp"]], "sources": [], "description": "Table detailing average, historical and current exchange rates for all accounting periods.", "columns": {"consolidated_exchange_rate_id": {"name": "consolidated_exchange_rate_id", "description": "The unique identifier for the consolidated exchange rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_book_id": {"name": "accounting_book_id", "description": "The accounting book the consolidated exchange rate is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_id": {"name": "accounting_period_id", "description": "The accounting period the consolidated exchange rate is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "average_rate": {"name": "average_rate", "description": "The consolidated exchange rates average rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "current_rate": {"name": "current_rate", "description": "The consolidated exchange rates current rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "historical_rate": {"name": "historical_rate", "description": "The consolidated exchange rates historical rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_subsidiary_id": {"name": "from_subsidiary_id", "description": "The subsidiary id which the consolidated exchange rate is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_subsidiary_id": {"name": "to_subsidiary_id", "description": "THe subsidiary id which the consolidated exchange rate is for.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__consolidated_exchange_rates.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n \n \n accounting_book_id\n \n as \n \n accounting_book_id\n \n, \n \n \n accounting_period_id\n \n as \n \n accounting_period_id\n \n, \n cast(null as \n float64\n) as \n \n average_budget_rate\n \n , \n \n \n average_rate\n \n as \n \n average_rate\n \n, \n \n \n consolidated_exchange_rate_id\n \n as \n \n consolidated_exchange_rate_id\n \n, \n cast(null as \n float64\n) as \n \n current_budget_rate\n \n , \n \n \n current_rate\n \n as \n \n current_rate\n \n, \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n \n \n from_subsidiary_id\n \n as \n \n from_subsidiary_id\n \n, \n cast(null as \n float64\n) as \n \n historical_budget_rate\n \n , \n \n \n historical_rate\n \n as \n \n historical_rate\n \n, \n \n \n to_subsidiary_id\n \n as \n \n to_subsidiary_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n consolidated_exchange_rate_id,\n accounting_book_id,\n accounting_period_id,\n average_rate,\n current_rate,\n historical_rate,\n from_subsidiary_id,\n to_subsidiary_id,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`"}, "model.netsuite_source.stg_netsuite__transaction_lines": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__transaction_lines_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__transaction_lines_tmp')),\n staging_columns=get_transaction_lines_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('transaction_lines_pass_through_columns') %}\n ,\n {{ var('transaction_lines_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from base\n),\n\nfinal as (\n \n select \n transaction_id,\n transaction_line_id,\n subsidiary_id,\n account_id,\n company_id,\n item_id,\n amount,\n non_posting_line,\n class_id,\n location_id,\n department_id,\n memo\n\n --The below script allows for pass through columns.\n {% if var('transaction_lines_pass_through_columns') %}\n ,\n {{ var('transaction_lines_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_transaction_lines_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__transaction_lines_tmp", "model.netsuite_source.stg_netsuite__transaction_lines_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__transaction_lines"], "unique_id": "model.netsuite_source.stg_netsuite__transaction_lines", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__transaction_lines.sql", "original_file_path": "models/stg_netsuite__transaction_lines.sql", "name": "stg_netsuite__transaction_lines", "alias": "stg_netsuite__transaction_lines", "checksum": {"name": "sha256", "checksum": "ea1b823803b4edb1476af0624d76af3be40121b28e3c5a13010829e7cdb3be7d"}, "tags": [], "refs": [["stg_netsuite__transaction_lines_tmp"], ["stg_netsuite__transaction_lines_tmp"]], "sources": [], "description": "A table detailing all transaction lines for all transactions.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The transaction id which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_line_id": {"name": "transaction_line_id", "description": "The unique identifier of the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subsidiary_id": {"name": "subsidiary_id", "description": "The subsidiary id of the subsidiary which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The account id of the account linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company_id": {"name": "company_id", "description": "The company id of the company linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_id": {"name": "item_id", "description": "The item id of the item which is included in the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "non_posting_line": {"name": "non_posting_line", "description": "Value indicating whether the transaction line is a non posting line (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_id": {"name": "class_id", "description": "The class id of the class which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The location id of the location which the transaction line took place.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_id": {"name": "department_id", "description": "The department id of the department linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "memo": {"name": "memo", "description": "The memo attached to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__transaction_lines.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n class_id\n \n as \n \n class_id\n \n, \n \n \n company_id\n \n as \n \n company_id\n \n, \n \n \n department_id\n \n as \n \n department_id\n \n, \n \n \n item_id\n \n as \n \n item_id\n \n, \n \n \n location_id\n \n as \n \n location_id\n \n, \n \n \n memo\n \n as \n \n memo\n \n, \n \n \n non_posting_line\n \n as \n \n non_posting_line\n \n, \n \n \n subsidiary_id\n \n as \n \n subsidiary_id\n \n, \n \n \n transaction_id\n \n as \n \n transaction_id\n \n, \n \n \n transaction_line_id\n \n as \n \n transaction_line_id\n \n\n\n\n\n --The below script allows for pass through columns.\n \n \n from base\n),\n\nfinal as (\n \n select \n transaction_id,\n transaction_line_id,\n subsidiary_id,\n account_id,\n company_id,\n item_id,\n amount,\n non_posting_line,\n class_id,\n location_id,\n department_id,\n memo\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`"}, "model.netsuite_source.stg_netsuite__income_accounts": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__income_accounts_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__income_accounts_tmp')),\n staging_columns=get_income_accounts_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n income_account_id,\n name, \n parent_id,\n account_number\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_income_accounts_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__income_accounts_tmp", "model.netsuite_source.stg_netsuite__income_accounts_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__income_accounts"], "unique_id": "model.netsuite_source.stg_netsuite__income_accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__income_accounts.sql", "original_file_path": "models/stg_netsuite__income_accounts.sql", "name": "stg_netsuite__income_accounts", "alias": "stg_netsuite__income_accounts", "checksum": {"name": "sha256", "checksum": "dd107f0395be7c28041a32de13e11b594e60f0ac55d201d43fdb4049a33824ab"}, "tags": [], "refs": [["stg_netsuite__income_accounts_tmp"], ["stg_netsuite__income_accounts_tmp"]], "sources": [], "description": "Table detailing all income accounts.", "columns": {"income_account_id": {"name": "income_account_id", "description": "The unique identifier of the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The income account's associated parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "The account number associated with the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__income_accounts.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__income_accounts_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n \n \n account_number\n \n as \n \n account_number\n \n, \n cast(null as \n string\n) as \n \n comments\n \n , \n cast(null as \n float64\n) as \n \n current_balance\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n string\n) as \n \n desription\n \n , \n cast(null as \n string\n) as \n \n full_name\n \n , \n cast(null as \n string\n) as \n \n income_account_extid\n \n , \n \n \n income_account_id\n \n as \n \n income_account_id\n \n, \n cast(null as \n string\n) as \n \n is_including_child_subs\n \n , \n cast(null as \n string\n) as \n \n is_summary\n \n , \n cast(null as \n string\n) as \n \n isinactive\n \n , \n cast(null as \n string\n) as \n \n legal_name\n \n , \n \n \n name\n \n as \n \n name\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n income_account_id,\n name, \n parent_id,\n account_number\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__income_accounts`"}, "model.netsuite_source.stg_netsuite__expense_accounts": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__expense_accounts_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__expense_accounts_tmp')),\n staging_columns=get_expense_accounts_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n expense_account_id,\n name,\n parent_id,\n account_number\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_expense_accounts_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__expense_accounts_tmp", "model.netsuite_source.stg_netsuite__expense_accounts_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__expense_accounts"], "unique_id": "model.netsuite_source.stg_netsuite__expense_accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__expense_accounts.sql", "original_file_path": "models/stg_netsuite__expense_accounts.sql", "name": "stg_netsuite__expense_accounts", "alias": "stg_netsuite__expense_accounts", "checksum": {"name": "sha256", "checksum": "d1bf448ebc81834756c50492b9f207c74e0a285f433c4b454e700af20ec1612a"}, "tags": [], "refs": [["stg_netsuite__expense_accounts_tmp"], ["stg_netsuite__expense_accounts_tmp"]], "sources": [], "description": "Table detailing all expense accounts.", "columns": {"expense_account_id": {"name": "expense_account_id", "description": "The unique identifier of the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The expense account's associated parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "The account number associated with the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__expense_accounts.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__expense_accounts_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n \n \n account_number\n \n as \n \n account_number\n \n, \n cast(null as \n string\n) as \n \n comments\n \n , \n cast(null as \n float64\n) as \n \n current_balance\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n string\n) as \n \n desription\n \n , \n cast(null as \n string\n) as \n \n expense_account_extid\n \n , \n \n \n expense_account_id\n \n as \n \n expense_account_id\n \n, \n cast(null as \n string\n) as \n \n full_name\n \n , \n cast(null as \n string\n) as \n \n is_including_child_subs\n \n , \n cast(null as \n string\n) as \n \n is_summary\n \n , \n cast(null as \n string\n) as \n \n isinactive\n \n , \n cast(null as \n string\n) as \n \n legal_name\n \n , \n \n \n name\n \n as \n \n name\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n expense_account_id,\n name,\n parent_id,\n account_number\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__expense_accounts`"}, "model.netsuite_source.stg_netsuite__vendors": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__vendors_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__vendors_tmp')),\n staging_columns=get_vendors_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n vendor_id,\n companyname as company_name,\n create_date as create_date_at,\n vendor_type_id,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_vendors_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__vendors_tmp", "model.netsuite_source.stg_netsuite__vendors_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__vendors"], "unique_id": "model.netsuite_source.stg_netsuite__vendors", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__vendors.sql", "original_file_path": "models/stg_netsuite__vendors.sql", "name": "stg_netsuite__vendors", "alias": "stg_netsuite__vendors", "checksum": {"name": "sha256", "checksum": "c9b0b1333c98e1c10776ccf679d64564e727c9f6807ed11c4e9004452d959ad1"}, "tags": [], "refs": [["stg_netsuite__vendors_tmp"], ["stg_netsuite__vendors_tmp"]], "sources": [], "description": "A table detailing all vendor information.", "columns": {"vendor_id": {"name": "vendor_id", "description": "The unique identifier of the vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_type_id": {"name": "vendor_type_id", "description": "The vendor type the vendor is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company_name": {"name": "company_name", "description": "The vendor's company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_date_at": {"name": "create_date_at", "description": "The timestamp of the date the vendor was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__vendors.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendors_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n string\n) as \n \n account_owner\n \n , \n cast(null as \n string\n) as \n \n accountnumber\n \n , \n cast(null as \n string\n) as \n \n accounts_email\n \n , \n cast(null as \n string\n) as \n \n altemail\n \n , \n cast(null as \n string\n) as \n \n altphone\n \n , \n cast(null as \n float64\n) as \n \n annual_revenue\n \n , \n cast(null as \n string\n) as \n \n assess_use_tax_on_billavatax\n \n , \n cast(null as \n string\n) as \n \n auto_renewals\n \n , \n cast(null as \n string\n) as \n \n auto_send_statements\n \n , \n cast(null as \n string\n) as \n \n bill_com_customer_name\n \n , \n cast(null as \n string\n) as \n \n bill_com_last_updated_by_impo\n \n , \n cast(null as \n string\n) as \n \n bill_com_shortname\n \n , \n cast(null as \n float64\n) as \n \n bill_com_vendor_info_id\n \n , \n cast(null as \n string\n) as \n \n bill_com_vendor_name\n \n , \n cast(null as \n string\n) as \n \n billaddress\n \n , \n cast(null as \n float64\n) as \n \n billing_class_id\n \n , \n cast(null as \n string\n) as \n \n brn\n \n , \n cast(null as \n string\n) as \n \n city\n \n , \n cast(null as \n string\n) as \n \n comments\n \n , \n cast(null as \n string\n) as \n \n companyname\n \n , \n cast(null as \n string\n) as \n \n country\n \n , \n \n \n create_date\n \n as \n \n create_date\n \n, \n cast(null as \n float64\n) as \n \n creditlimit\n \n , \n cast(null as \n float64\n) as \n \n currency_id\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n string\n) as \n \n dic\n \n , \n cast(null as \n string\n) as \n \n email\n \n , \n cast(null as \n string\n) as \n \n email_bill_payment_vouchers\n \n , \n cast(null as \n string\n) as \n \n email_cash_sales\n \n , \n cast(null as \n string\n) as \n \n email_credit_notes\n \n , \n cast(null as \n string\n) as \n \n email_invoices\n \n , \n cast(null as \n string\n) as \n \n email_item_fulfilments\n \n , \n cast(null as \n string\n) as \n \n email_purchase_orders\n \n , \n cast(null as \n string\n) as \n \n email_quotes\n \n , \n cast(null as \n string\n) as \n \n email_sales_orders\n \n , \n cast(null as \n string\n) as \n \n email_statements\n \n , \n cast(null as \n string\n) as \n \n employee_number\n \n , \n cast(null as \n string\n) as \n \n exemption_certificate_no\n \n , \n cast(null as \n float64\n) as \n \n expense_account_id\n \n , \n cast(null as \n string\n) as \n \n fax\n \n , \n cast(null as \n string\n) as \n \n full_name\n \n , \n cast(null as \n string\n) as \n \n home_phone\n \n , \n cast(null as \n string\n) as \n \n hris_id\n \n , \n cast(null as \n string\n) as \n \n ico\n \n , \n cast(null as \n string\n) as \n \n id_number_in_the_country_of_r\n \n , \n cast(null as \n float64\n) as \n \n id_type_in_the_country_of_r_id\n \n , \n cast(null as \n float64\n) as \n \n in_transit_balance\n \n , \n cast(null as \n string\n) as \n \n incoterm\n \n , \n cast(null as \n float64\n) as \n \n industry_id\n \n , \n cast(null as \n string\n) as \n \n invoice_via_procurement_syste\n \n , \n cast(null as \n string\n) as \n \n invoicing_details\n \n , \n cast(null as \n string\n) as \n \n is1099eligible\n \n , \n cast(null as \n string\n) as \n \n is_partner\n \n , \n cast(null as \n string\n) as \n \n is_person\n \n , \n cast(null as \n string\n) as \n \n isemailhtml\n \n , \n cast(null as \n string\n) as \n \n isemailpdf\n \n , \n cast(null as \n string\n) as \n \n isinactive\n \n , \n cast(null as \n float64\n) as \n \n labor_cost\n \n , \n cast(null as \n timestamp\n) as \n \n last_modified_date\n \n , \n cast(null as \n timestamp\n) as \n \n last_sales_activity\n \n , \n cast(null as \n string\n) as \n \n line1\n \n , \n cast(null as \n string\n) as \n \n line2\n \n , \n cast(null as \n string\n) as \n \n line3\n \n , \n cast(null as \n string\n) as \n \n loginaccess\n \n , \n cast(null as \n string\n) as \n \n lsa_link\n \n , \n cast(null as \n string\n) as \n \n lsa_link_name\n \n , \n cast(null as \n string\n) as \n \n mobile_phone\n \n , \n cast(null as \n timestamp\n) as \n \n msa_effective_date\n \n , \n cast(null as \n string\n) as \n \n name\n \n , \n cast(null as \n float64\n) as \n \n no__of_employees\n \n , \n cast(null as \n float64\n) as \n \n openbalance\n \n , \n cast(null as \n float64\n) as \n \n openbalance_foreign\n \n , \n cast(null as \n float64\n) as \n \n payables_account_id\n \n , \n cast(null as \n float64\n) as \n \n payment_terms_id\n \n , \n cast(null as \n string\n) as \n \n phone\n \n , \n cast(null as \n float64\n) as \n \n prepayment_balance\n \n , \n cast(null as \n string\n) as \n \n printoncheckas\n \n , \n cast(null as \n float64\n) as \n \n purchaseorderamount\n \n , \n cast(null as \n float64\n) as \n \n purchaseorderquantity\n \n , \n cast(null as \n float64\n) as \n \n purchaseorderquantitydiff\n \n , \n cast(null as \n string\n) as \n \n purchases_email\n \n , \n cast(null as \n float64\n) as \n \n receiptamount\n \n , \n cast(null as \n float64\n) as \n \n receiptquantity\n \n , \n cast(null as \n float64\n) as \n \n receiptquantitydiff\n \n , \n cast(null as \n float64\n) as \n \n represents_subsidiary_id\n \n , \n cast(null as \n string\n) as \n \n restrict_access_to_expensify\n \n , \n cast(null as \n string\n) as \n \n salesforce_id\n \n , \n cast(null as \n string\n) as \n \n shipaddress\n \n , \n cast(null as \n string\n) as \n \n shipping_email\n \n , \n cast(null as \n string\n) as \n \n state\n \n , \n cast(null as \n float64\n) as \n \n subsidiary\n \n , \n cast(null as \n string\n) as \n \n tax_contact_first_name\n \n , \n cast(null as \n float64\n) as \n \n tax_contact_id\n \n , \n cast(null as \n string\n) as \n \n tax_contact_last_name\n \n , \n cast(null as \n string\n) as \n \n tax_contact_middle_name\n \n , \n cast(null as \n string\n) as \n \n tax_number\n \n , \n cast(null as \n string\n) as \n \n taxidnum\n \n , \n cast(null as \n float64\n) as \n \n time_approver_id\n \n , \n cast(null as \n string\n) as \n \n transactions_need_approval\n \n , \n cast(null as \n string\n) as \n \n uen\n \n , \n cast(null as \n float64\n) as \n \n unbilled_orders\n \n , \n cast(null as \n float64\n) as \n \n unbilled_orders_foreign\n \n , \n cast(null as \n string\n) as \n \n url\n \n , \n cast(null as \n string\n) as \n \n vat_registration_no\n \n , \n cast(null as \n string\n) as \n \n vendor_extid\n \n , \n \n \n vendor_id\n \n as \n \n vendor_id\n \n, \n \n \n vendor_type_id\n \n as \n \n vendor_type_id\n \n, \n cast(null as \n string\n) as \n \n zipcode\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n vendor_id,\n companyname as company_name,\n create_date as create_date_at,\n vendor_type_id,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendors`"}, "model.netsuite_source.stg_netsuite__classes": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__classes_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__classes_tmp')),\n staging_columns=get_classes_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('classes_pass_through_columns') %}\n ,\n {{ var('classes_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from base\n),\n\nfinal as (\n \n select \n class_id,\n full_name\n\n --The below script allows for pass through columns.\n {% if var('classes_pass_through_columns') %}\n ,\n {{ var('classes_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_classes_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__classes_tmp", "model.netsuite_source.stg_netsuite__classes_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__classes"], "unique_id": "model.netsuite_source.stg_netsuite__classes", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__classes.sql", "original_file_path": "models/stg_netsuite__classes.sql", "name": "stg_netsuite__classes", "alias": "stg_netsuite__classes", "checksum": {"name": "sha256", "checksum": "a71d5e6362941ef487c652754ddd8f22537f166e38c9825531aecd9c5ebf0c59"}, "tags": [], "refs": [["stg_netsuite__classes_tmp"], ["stg_netsuite__classes_tmp"]], "sources": [], "description": "Table detailing all classes set up in Netsuite.", "columns": {"class_id": {"name": "class_id", "description": "The unique identifier of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__classes.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__classes_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n class_id\n \n as \n \n class_id\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n\n\n\n\n --The below script allows for pass through columns.\n \n \n from base\n),\n\nfinal as (\n \n select \n class_id,\n full_name\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__classes`"}, "model.netsuite_source.stg_netsuite__subsidiaries": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__subsidiaries_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__subsidiaries_tmp')),\n staging_columns=get_subsidiaries_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n subsidiary_id,\n fiscal_calendar_id,\n name,\n parent_id\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_subsidiaries_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__subsidiaries_tmp", "model.netsuite_source.stg_netsuite__subsidiaries_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__subsidiaries"], "unique_id": "model.netsuite_source.stg_netsuite__subsidiaries", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__subsidiaries.sql", "original_file_path": "models/stg_netsuite__subsidiaries.sql", "name": "stg_netsuite__subsidiaries", "alias": "stg_netsuite__subsidiaries", "checksum": {"name": "sha256", "checksum": "fa4b38a9c33146644ca7bb357278e341ffab7a85b9c17b79cbb4e43b3589123e"}, "tags": [], "refs": [["stg_netsuite__subsidiaries_tmp"], ["stg_netsuite__subsidiaries_tmp"]], "sources": [], "description": "Table detailing all subsidiaries.", "columns": {"subsidiary_id": {"name": "subsidiary_id", "description": "The unique identifier of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fiscal_calendar_id": {"name": "fiscal_calendar_id", "description": "The fiscal calendar id associated with the fiscal calendar the subsidiary is on.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The parent subsidiary id which the subsidiary is under.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__subsidiaries.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n string\n) as \n \n address\n \n , \n cast(null as \n string\n) as \n \n address1\n \n , \n cast(null as \n string\n) as \n \n address2\n \n , \n cast(null as \n float64\n) as \n \n base_currency_id\n \n , \n cast(null as \n string\n) as \n \n branch_id\n \n , \n cast(null as \n string\n) as \n \n brn\n \n , \n cast(null as \n string\n) as \n \n city\n \n , \n cast(null as \n string\n) as \n \n country\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n string\n) as \n \n edition\n \n , \n cast(null as \n string\n) as \n \n federal_number\n \n , \n \n \n fiscal_calendar_id\n \n as \n \n fiscal_calendar_id\n \n, \n cast(null as \n string\n) as \n \n full_name\n \n , \n cast(null as \n string\n) as \n \n is_elimination\n \n , \n cast(null as \n string\n) as \n \n is_moss\n \n , \n cast(null as \n string\n) as \n \n isinactive\n \n , \n cast(null as \n string\n) as \n \n isinactive_bool\n \n , \n cast(null as \n string\n) as \n \n legal_name\n \n , \n cast(null as \n float64\n) as \n \n moss_nexus_id\n \n , \n \n \n name\n \n as \n \n name\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n cast(null as \n float64\n) as \n \n purchaseorderamount\n \n , \n cast(null as \n float64\n) as \n \n purchaseorderquantity\n \n , \n cast(null as \n float64\n) as \n \n purchaseorderquantitydiff\n \n , \n cast(null as \n float64\n) as \n \n receiptamount\n \n , \n cast(null as \n float64\n) as \n \n receiptquantity\n \n , \n cast(null as \n float64\n) as \n \n receiptquantitydiff\n \n , \n cast(null as \n string\n) as \n \n return_address\n \n , \n cast(null as \n string\n) as \n \n return_address1\n \n , \n cast(null as \n string\n) as \n \n return_address2\n \n , \n cast(null as \n string\n) as \n \n return_city\n \n , \n cast(null as \n string\n) as \n \n return_country\n \n , \n cast(null as \n string\n) as \n \n return_state\n \n , \n cast(null as \n string\n) as \n \n return_zipcode\n \n , \n cast(null as \n string\n) as \n \n shipping_address\n \n , \n cast(null as \n string\n) as \n \n shipping_address1\n \n , \n cast(null as \n string\n) as \n \n shipping_address2\n \n , \n cast(null as \n string\n) as \n \n shipping_city\n \n , \n cast(null as \n string\n) as \n \n shipping_country\n \n , \n cast(null as \n string\n) as \n \n shipping_state\n \n , \n cast(null as \n string\n) as \n \n shipping_zipcode\n \n , \n cast(null as \n string\n) as \n \n state\n \n , \n cast(null as \n string\n) as \n \n state_tax_number\n \n , \n cast(null as \n float64\n) as \n \n subnav__searchable_subsidiary\n \n , \n cast(null as \n string\n) as \n \n subsidiary_extid\n \n , \n \n \n subsidiary_id\n \n as \n \n subsidiary_id\n \n, \n cast(null as \n float64\n) as \n \n taxonomy_reference_id\n \n , \n cast(null as \n string\n) as \n \n tran_num_prefix\n \n , \n cast(null as \n string\n) as \n \n uen\n \n , \n cast(null as \n string\n) as \n \n url\n \n , \n cast(null as \n string\n) as \n \n zipcode\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n subsidiary_id,\n fiscal_calendar_id,\n name,\n parent_id\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`"}, "model.netsuite_source.stg_netsuite__accounts": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__accounts_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__accounts_tmp')),\n staging_columns=get_accounts_columns()\n )\n }}\n --The below script allows for pass through columns.\n {% if var('accounts_pass_through_columns') %}\n ,\n {{ var('accounts_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from base\n),\n\nfinal as (\n \n select \n account_id,\n parent_id,\n name,\n type_name,\n accountnumber as account_number,\n general_rate_type,\n is_leftside,\n is_balancesheet\n\n --The below script allows for pass through columns.\n {% if var('accounts_pass_through_columns') %}\n ,\n {{ var('accounts_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_accounts_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__accounts_tmp", "model.netsuite_source.stg_netsuite__accounts_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__accounts"], "unique_id": "model.netsuite_source.stg_netsuite__accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__accounts.sql", "original_file_path": "models/stg_netsuite__accounts.sql", "name": "stg_netsuite__accounts", "alias": "stg_netsuite__accounts", "checksum": {"name": "sha256", "checksum": "71645aaaaf6a010497cdfd5eb0ba12889660be21a2336533f6de3dd0b549c523"}, "tags": [], "refs": [["stg_netsuite__accounts_tmp"], ["stg_netsuite__accounts_tmp"]], "sources": [], "description": "Table that provides a complete listing of every account in the accounting system.", "columns": {"account_id": {"name": "account_id", "description": "The unique identifier associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The accounts associated parent account id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type_name": {"name": "type_name", "description": "The name of the type of the account (ie. Bank, Equity, Income, Expense).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "The account number associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "general_rate_type": {"name": "general_rate_type", "description": "The general rate type of the account (Current, Historical, Average).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_leftside": {"name": "is_leftside", "description": "Value indicating whether the account is on the leftside (debit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_balancesheet": {"name": "is_balancesheet", "description": "Value indicating whether the account is a balance sheet account.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__accounts.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n account_id\n \n as \n \n account_id\n \n, \n cast(null as \n string\n) as \n \n accountnumber\n \n , \n \n \n general_rate_type\n \n as \n \n general_rate_type\n \n, \n \n \n is_balancesheet\n \n as \n \n is_balancesheet\n \n, \n \n \n is_leftside\n \n as \n \n is_leftside\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n type_name\n \n as \n \n type_name\n \n\n\n\n --The below script allows for pass through columns.\n \n \n from base\n),\n\nfinal as (\n \n select \n account_id,\n parent_id,\n name,\n type_name,\n accountnumber as account_number,\n general_rate_type,\n is_leftside,\n is_balancesheet\n\n --The below script allows for pass through columns.\n \n \n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`"}, "model.netsuite_source.stg_netsuite__items": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__items_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__items_tmp')),\n staging_columns=get_items_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n item_id,\n name,\n type_name,\n salesdescription as sales_description\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_items_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__items_tmp", "model.netsuite_source.stg_netsuite__items_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__items"], "unique_id": "model.netsuite_source.stg_netsuite__items", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__items.sql", "original_file_path": "models/stg_netsuite__items.sql", "name": "stg_netsuite__items", "alias": "stg_netsuite__items", "checksum": {"name": "sha256", "checksum": "456fa4e728a4b169a72c07487f4dd9bb61cf2ef7519d6ed6ddf5c3c2d002040f"}, "tags": [], "refs": [["stg_netsuite__items_tmp"], ["stg_netsuite__items_tmp"]], "sources": [], "description": "Table detailing information about the items created in Netsuite.", "columns": {"item_id": {"name": "item_id", "description": "The unique identifier of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type_name": {"name": "type_name", "description": "The type of the item (ie. Markup, Service, Discount).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sales_description": {"name": "sales_description", "description": "The items sales description.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__items.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__items_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n string\n) as \n \n allow_drop_ship\n \n , \n cast(null as \n float64\n) as \n \n alt_demand_source_item_id\n \n , \n cast(null as \n float64\n) as \n \n asset_account_id\n \n , \n cast(null as \n float64\n) as \n \n atp_lead_time\n \n , \n cast(null as \n string\n) as \n \n atp_method\n \n , \n cast(null as \n string\n) as \n \n available_to_partners\n \n , \n cast(null as \n string\n) as \n \n avatax_taxcode\n \n , \n cast(null as \n float64\n) as \n \n averagecost\n \n , \n cast(null as \n float64\n) as \n \n backward_consumption_days\n \n , \n cast(null as \n string\n) as \n \n bill_com_last_updated_by_impo\n \n , \n cast(null as \n float64\n) as \n \n bill_exch_rate_var_account_id\n \n , \n cast(null as \n float64\n) as \n \n bill_price_variance_account_id\n \n , \n cast(null as \n float64\n) as \n \n bill_qty_variance_account_id\n \n , \n cast(null as \n string\n) as \n \n build_sub_assemblies\n \n , \n cast(null as \n float64\n) as \n \n class_id\n \n , \n cast(null as \n float64\n) as \n \n code_of_supply_id\n \n , \n cast(null as \n string\n) as \n \n commodity_code\n \n , \n cast(null as \n float64\n) as \n \n consumption_unit_id\n \n , \n cast(null as \n float64\n) as \n \n cost_0\n \n , \n cast(null as \n string\n) as \n \n cost_category\n \n , \n cast(null as \n string\n) as \n \n cost_estimate_type\n \n , \n cast(null as \n string\n) as \n \n costing_method\n \n , \n cast(null as \n string\n) as \n \n country_of_manufacture\n \n , \n cast(null as \n string\n) as \n \n create_plan_on_event_type\n \n , \n cast(null as \n timestamp\n) as \n \n created\n \n , \n cast(null as \n float64\n) as \n \n current_on_order_count\n \n , \n cast(null as \n float64\n) as \n \n custreturn_variance_account_id\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n timestamp\n) as \n \n date_of_last_transaction\n \n , \n cast(null as \n float64\n) as \n \n default_return_cost\n \n , \n cast(null as \n float64\n) as \n \n deferred_expense_account_id\n \n , \n cast(null as \n float64\n) as \n \n deferred_revenue_account_id\n \n , \n cast(null as \n string\n) as \n \n demand_source\n \n , \n cast(null as \n float64\n) as \n \n demand_time_fence\n \n , \n cast(null as \n float64\n) as \n \n department_id\n \n , \n cast(null as \n string\n) as \n \n deposit\n \n , \n cast(null as \n string\n) as \n \n displayname\n \n , \n cast(null as \n string\n) as \n \n distribution_category\n \n , \n cast(null as \n string\n) as \n \n distribution_network\n \n , \n cast(null as \n float64\n) as \n \n dropship_expense_account_id\n \n , \n cast(null as \n string\n) as \n \n effective_bom_control_type\n \n , \n cast(null as \n float64\n) as \n \n expense_account_id\n \n , \n cast(null as \n string\n) as \n \n featureddescription\n \n , \n cast(null as \n string\n) as \n \n featureditem\n \n , \n cast(null as \n float64\n) as \n \n fixed_lot_size\n \n , \n cast(null as \n float64\n) as \n \n forward_consumption_days\n \n , \n cast(null as \n string\n) as \n \n fraud_risk\n \n , \n cast(null as \n string\n) as \n \n full_name\n \n , \n cast(null as \n float64\n) as \n \n fx_adjustment_account_id\n \n , \n cast(null as \n float64\n) as \n \n gain_loss_account_id\n \n , \n cast(null as \n float64\n) as \n \n handling_cost\n \n , \n cast(null as \n string\n) as \n \n hazmat\n \n , \n cast(null as \n string\n) as \n \n hazmat_hazard_class\n \n , \n cast(null as \n string\n) as \n \n hazmat_id\n \n , \n cast(null as \n string\n) as \n \n hazmat_item_units\n \n , \n cast(null as \n float64\n) as \n \n hazmat_item_units_qty\n \n , \n cast(null as \n string\n) as \n \n hazmat_packing_group\n \n , \n cast(null as \n string\n) as \n \n hazmat_shipping_name\n \n , \n cast(null as \n string\n) as \n \n include_child_subsidiaries\n \n , \n cast(null as \n float64\n) as \n \n income_account_id\n \n , \n cast(null as \n float64\n) as \n \n interco_expense_account_id\n \n , \n cast(null as \n float64\n) as \n \n interco_income_account_id\n \n , \n cast(null as \n float64\n) as \n \n invt_count_classification\n \n , \n cast(null as \n float64\n) as \n \n invt_count_interval\n \n , \n cast(null as \n string\n) as \n \n is_cont_rev_handling\n \n , \n cast(null as \n string\n) as \n \n is_enforce_min_qty_internally\n \n , \n cast(null as \n string\n) as \n \n is_hold_rev_rec\n \n , \n cast(null as \n string\n) as \n \n is_moss\n \n , \n cast(null as \n string\n) as \n \n is_phantom\n \n , \n cast(null as \n string\n) as \n \n is_special_order_item\n \n , \n cast(null as \n string\n) as \n \n isinactive\n \n , \n cast(null as \n string\n) as \n \n isonline\n \n , \n cast(null as \n string\n) as \n \n istaxable\n \n , \n cast(null as \n float64\n) as \n \n item_defined_cost\n \n , \n cast(null as \n string\n) as \n \n item_extid\n \n , \n \n \n item_id\n \n as \n \n item_id\n \n, \n cast(null as \n float64\n) as \n \n item_image\n \n , \n cast(null as \n string\n) as \n \n item_revenue_category\n \n , \n cast(null as \n float64\n) as \n \n item_term_id\n \n , \n cast(null as \n timestamp\n) as \n \n last_cogs_correction\n \n , \n cast(null as \n timestamp\n) as \n \n last_invt_count_date\n \n , \n cast(null as \n float64\n) as \n \n last_purchase_price\n \n , \n cast(null as \n float64\n) as \n \n location_id\n \n , \n cast(null as \n string\n) as \n \n lot_numbered_item\n \n , \n cast(null as \n string\n) as \n \n lot_sizing_method\n \n , \n cast(null as \n string\n) as \n \n manufacturer\n \n , \n cast(null as \n string\n) as \n \n manufacturing_charge_item\n \n , \n cast(null as \n string\n) as \n \n match_bill_to_receipt\n \n , \n cast(null as \n string\n) as \n \n matrix_type\n \n , \n cast(null as \n float64\n) as \n \n maximum_quantity\n \n , \n cast(null as \n float64\n) as \n \n minimum_quantity\n \n , \n cast(null as \n timestamp\n) as \n \n modified\n \n , \n cast(null as \n string\n) as \n \n mpn\n \n , \n \n \n name\n \n as \n \n name\n \n, \n cast(null as \n float64\n) as \n \n nature_of_transaction_codes_id\n \n , \n cast(null as \n timestamp\n) as \n \n next_invt_count_date\n \n , \n cast(null as \n float64\n) as \n \n ng_asset_type_id\n \n , \n cast(null as \n float64\n) as \n \n ns_lead_time\n \n , \n cast(null as \n string\n) as \n \n offersupport\n \n , \n cast(null as \n string\n) as \n \n onspecial\n \n , \n cast(null as \n string\n) as \n \n overhead_type\n \n , \n cast(null as \n float64\n) as \n \n parent_id\n \n , \n cast(null as \n float64\n) as \n \n payment_method_id\n \n , \n cast(null as \n float64\n) as \n \n periodic_lot_size_days\n \n , \n cast(null as \n string\n) as \n \n periodic_lot_size_type\n \n , \n cast(null as \n float64\n) as \n \n pref_purchase_tax_id\n \n , \n cast(null as \n float64\n) as \n \n pref_sale_tax_id\n \n , \n cast(null as \n float64\n) as \n \n pref_stock_level\n \n , \n cast(null as \n string\n) as \n \n prices_include_tax\n \n , \n cast(null as \n float64\n) as \n \n pricing_group_id\n \n , \n cast(null as \n string\n) as \n \n print_sub_items\n \n , \n cast(null as \n float64\n) as \n \n prod_price_var_account_id\n \n , \n cast(null as \n float64\n) as \n \n prod_qty_var_account_id\n \n , \n cast(null as \n string\n) as \n \n prompt_payment_discount_item\n \n , \n cast(null as \n float64\n) as \n \n purchase_price_var_account_id\n \n , \n cast(null as \n float64\n) as \n \n purchase_unit_id\n \n , \n cast(null as \n string\n) as \n \n purchasedescription\n \n , \n cast(null as \n float64\n) as \n \n purchaseorderamount\n \n , \n cast(null as \n float64\n) as \n \n purchaseorderquantity\n \n , \n cast(null as \n float64\n) as \n \n purchaseorderquantitydiff\n \n , \n cast(null as \n float64\n) as \n \n quantityavailable\n \n , \n cast(null as \n float64\n) as \n \n quantitybackordered\n \n , \n cast(null as \n float64\n) as \n \n quantityonhand\n \n , \n cast(null as \n float64\n) as \n \n receiptamount\n \n , \n cast(null as \n float64\n) as \n \n receiptquantity\n \n , \n cast(null as \n float64\n) as \n \n receiptquantitydiff\n \n , \n cast(null as \n float64\n) as \n \n reorder_multiple\n \n , \n cast(null as \n float64\n) as \n \n reorderpoint\n \n , \n cast(null as \n string\n) as \n \n replenishment_method\n \n , \n cast(null as \n string\n) as \n \n resalable\n \n , \n cast(null as \n float64\n) as \n \n reschedule_in_days\n \n , \n cast(null as \n float64\n) as \n \n reschedule_out_days\n \n , \n cast(null as \n float64\n) as \n \n rev_rec_forecast_rule_id\n \n , \n cast(null as \n float64\n) as \n \n rev_rec_rule_id\n \n , \n cast(null as \n string\n) as \n \n revenue_allocation_group\n \n , \n cast(null as \n string\n) as \n \n round_up_as_component\n \n , \n cast(null as \n float64\n) as \n \n safety_stock_days\n \n , \n cast(null as \n float64\n) as \n \n safety_stock_level\n \n , \n cast(null as \n float64\n) as \n \n sale_unit_id\n \n , \n cast(null as \n string\n) as \n \n salesdescription\n \n , \n cast(null as \n string\n) as \n \n salesforce_id\n \n , \n cast(null as \n string\n) as \n \n salesprice\n \n , \n cast(null as \n float64\n) as \n \n scrap_account_id\n \n , \n cast(null as \n string\n) as \n \n serialized_item\n \n , \n cast(null as \n float64\n) as \n \n shippingcost\n \n , \n cast(null as \n string\n) as \n \n special_work_order_item\n \n , \n cast(null as \n string\n) as \n \n specialsdescription\n \n , \n cast(null as \n float64\n) as \n \n stock_unit_id\n \n , \n cast(null as \n string\n) as \n \n storedescription\n \n , \n cast(null as \n string\n) as \n \n storedetaileddescription\n \n , \n cast(null as \n string\n) as \n \n storedisplayname\n \n , \n cast(null as \n string\n) as \n \n subtype\n \n , \n cast(null as \n string\n) as \n \n supplementary_unit__abberviat\n \n , \n cast(null as \n float64\n) as \n \n supplementary_unit_id\n \n , \n cast(null as \n float64\n) as \n \n supply_time_fence\n \n , \n cast(null as \n string\n) as \n \n supply_type\n \n , \n cast(null as \n float64\n) as \n \n tax_item_id\n \n , \n cast(null as \n float64\n) as \n \n totalvalue\n \n , \n cast(null as \n float64\n) as \n \n transferprice\n \n , \n \n \n type_name\n \n as \n \n type_name\n \n, \n cast(null as \n float64\n) as \n \n type_of_goods_id\n \n , \n cast(null as \n string\n) as \n \n udf1\n \n , \n cast(null as \n string\n) as \n \n udf2\n \n , \n cast(null as \n string\n) as \n \n un_number\n \n , \n cast(null as \n float64\n) as \n \n unbuild_variance_account_id\n \n , \n cast(null as \n float64\n) as \n \n units_type_id\n \n , \n cast(null as \n string\n) as \n \n upc_code\n \n , \n cast(null as \n string\n) as \n \n use_component_yield\n \n , \n cast(null as \n float64\n) as \n \n vendor_id\n \n , \n cast(null as \n string\n) as \n \n vendorname\n \n , \n cast(null as \n float64\n) as \n \n vendreturn_variance_account_id\n \n , \n cast(null as \n string\n) as \n \n vsoe_deferral\n \n , \n cast(null as \n string\n) as \n \n vsoe_delivered\n \n , \n cast(null as \n string\n) as \n \n vsoe_discount\n \n , \n cast(null as \n float64\n) as \n \n vsoe_price\n \n , \n cast(null as \n float64\n) as \n \n weight\n \n , \n cast(null as \n float64\n) as \n \n weight_in_user_defined_unit\n \n , \n cast(null as \n float64\n) as \n \n weight_unit_index\n \n , \n cast(null as \n float64\n) as \n \n wip_account_id\n \n , \n cast(null as \n float64\n) as \n \n wip_cost_variance_account_id\n \n , \n cast(null as \n float64\n) as \n \n work_order_lead_time\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n item_id,\n name,\n type_name,\n salesdescription as sales_description\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__items`"}, "model.netsuite_source.stg_netsuite__locations": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__locations_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__locations_tmp')),\n staging_columns=get_locations_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n location_id,\n name,\n full_name,\n city,\n country\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_locations_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__locations_tmp", "model.netsuite_source.stg_netsuite__locations_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__locations"], "unique_id": "model.netsuite_source.stg_netsuite__locations", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__locations.sql", "original_file_path": "models/stg_netsuite__locations.sql", "name": "stg_netsuite__locations", "alias": "stg_netsuite__locations", "checksum": {"name": "sha256", "checksum": "bf83d474f35ea2b9e8563ff6c240ebde146d8f169314737efeef250fea759dfa"}, "tags": [], "refs": [["stg_netsuite__locations_tmp"], ["stg_netsuite__locations_tmp"]], "sources": [], "description": "Table detailing all locations, including store, warehouse and office locations.", "columns": {"location_id": {"name": "location_id", "description": "The unique identifier of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The location's name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The location's city.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The location's country.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__locations.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__locations_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n string\n) as \n \n address\n \n , \n cast(null as \n string\n) as \n \n address_one\n \n , \n cast(null as \n string\n) as \n \n address_three\n \n , \n cast(null as \n string\n) as \n \n address_two\n \n , \n cast(null as \n string\n) as \n \n addressee\n \n , \n cast(null as \n string\n) as \n \n attention\n \n , \n cast(null as \n string\n) as \n \n bill_com_last_updated_by_impo\n \n , \n cast(null as \n string\n) as \n \n branch_id\n \n , \n \n \n city\n \n as \n \n city\n \n, \n \n \n country\n \n as \n \n country\n \n, \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n \n \n full_name\n \n as \n \n full_name\n \n, \n cast(null as \n string\n) as \n \n inventory_available\n \n , \n cast(null as \n string\n) as \n \n inventory_available_web_store\n \n , \n cast(null as \n string\n) as \n \n is_include_in_supply_planning\n \n , \n cast(null as \n string\n) as \n \n isinactive\n \n , \n cast(null as \n string\n) as \n \n location_extid\n \n , \n \n \n location_id\n \n as \n \n location_id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n cast(null as \n float64\n) as \n \n parent_id\n \n , \n cast(null as \n string\n) as \n \n phone\n \n , \n cast(null as \n string\n) as \n \n pick_up\n \n , \n cast(null as \n string\n) as \n \n return_address_one\n \n , \n cast(null as \n string\n) as \n \n return_address_two\n \n , \n cast(null as \n string\n) as \n \n return_city\n \n , \n cast(null as \n string\n) as \n \n return_country\n \n , \n cast(null as \n string\n) as \n \n return_state\n \n , \n cast(null as \n string\n) as \n \n return_zipcode\n \n , \n cast(null as \n string\n) as \n \n returnaddress\n \n , \n cast(null as \n string\n) as \n \n state\n \n , \n cast(null as \n string\n) as \n \n tran_num_prefix\n \n , \n cast(null as \n string\n) as \n \n use_bins\n \n , \n cast(null as \n string\n) as \n \n zipcode\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n location_id,\n name,\n full_name,\n city,\n country\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__locations`"}, "model.netsuite_source.stg_netsuite__departments": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__departments_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__departments_tmp')),\n staging_columns=get_departments_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('departments_pass_through_columns') %}\n ,\n {{ var('departments_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from base\n),\n\nfinal as (\n \n select \n department_id,\n name,\n full_name\n\n --The below script allows for pass through columns.\n {% if var('departments_pass_through_columns') %}\n ,\n {{ var('departments_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_departments_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__departments_tmp", "model.netsuite_source.stg_netsuite__departments_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__departments"], "unique_id": "model.netsuite_source.stg_netsuite__departments", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__departments.sql", "original_file_path": "models/stg_netsuite__departments.sql", "name": "stg_netsuite__departments", "alias": "stg_netsuite__departments", "checksum": {"name": "sha256", "checksum": "43c72f4fca8f368921cfcb6284e4fe2510b2f24b0dd18be24105bc23a1124fd5"}, "tags": [], "refs": [["stg_netsuite__departments_tmp"], ["stg_netsuite__departments_tmp"]], "sources": [], "description": "Table detailing all departments set up in Netsuite.", "columns": {"department_id": {"name": "department_id", "description": "The unique identifier of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The department's full name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__departments.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__departments_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n department_id\n \n as \n \n department_id\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n\n --The below script allows for pass through columns.\n \n \n from base\n),\n\nfinal as (\n \n select \n department_id,\n name,\n full_name\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__departments`"}, "model.netsuite_source.stg_netsuite__currencies": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__currencies_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__currencies_tmp')),\n staging_columns=get_currencies_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n currency_id,\n name,\n symbol,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_currencies_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__currencies_tmp", "model.netsuite_source.stg_netsuite__currencies_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__currencies"], "unique_id": "model.netsuite_source.stg_netsuite__currencies", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__currencies.sql", "original_file_path": "models/stg_netsuite__currencies.sql", "name": "stg_netsuite__currencies", "alias": "stg_netsuite__currencies", "checksum": {"name": "sha256", "checksum": "2a8203a626c5ad01369ddf566febe965a68f7c263f08f58da002125d3eff80c9"}, "tags": [], "refs": [["stg_netsuite__currencies_tmp"], ["stg_netsuite__currencies_tmp"]], "sources": [], "description": "The names and symbols for all currencies set up in Netsuite.", "columns": {"currency_id": {"name": "currency_id", "description": "The unique identifier of the currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "symbol": {"name": "symbol", "description": "The currency's three letter symbol (ie. USD, EUR, CAD).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__currencies.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__currencies_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n string\n) as \n \n currency_extid\n \n , \n \n \n currency_id\n \n as \n \n currency_id\n \n, \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n string\n) as \n \n is_inactive\n \n , \n \n \n name\n \n as \n \n name\n \n, \n cast(null as \n float64\n) as \n \n precision_0\n \n , \n \n \n symbol\n \n as \n \n symbol\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n currency_id,\n name,\n symbol,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__currencies`"}, "model.netsuite_source.stg_netsuite__vendor_types": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__vendor_types_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__vendor_types_tmp')),\n staging_columns=get_vendor_types_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n vendor_type_id,\n name,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_vendor_types_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__vendor_types_tmp", "model.netsuite_source.stg_netsuite__vendor_types_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__vendor_types"], "unique_id": "model.netsuite_source.stg_netsuite__vendor_types", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__vendor_types.sql", "original_file_path": "models/stg_netsuite__vendor_types.sql", "name": "stg_netsuite__vendor_types", "alias": "stg_netsuite__vendor_types", "checksum": {"name": "sha256", "checksum": "bb93e7ec1ad3c8c6851804dd6dae4f234462ceecdcd5782f2966cd5b6b48cdcd"}, "tags": [], "refs": [["stg_netsuite__vendor_types_tmp"], ["stg_netsuite__vendor_types_tmp"]], "sources": [], "description": "A table detailing all the various types of vendors.", "columns": {"vendor_type_id": {"name": "vendor_type_id", "description": "The unique identifier of the vendor type", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the vendor type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__vendor_types.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendor_types_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n string\n) as \n \n isinactive\n \n , \n \n \n name\n \n as \n \n name\n \n, \n cast(null as \n float64\n) as \n \n parent_id\n \n , \n cast(null as \n string\n) as \n \n vendor_type_extid\n \n , \n \n \n vendor_type_id\n \n as \n \n vendor_type_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n vendor_type_id,\n name,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendor_types`"}, "model.netsuite_source.stg_netsuite__accounting_periods": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__accounting_periods_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__accounting_periods_tmp')),\n staging_columns=get_accounting_periods_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n accounting_period_id,\n name,\n full_name,\n fiscal_calendar_id,\n year_id,\n starting as starting_at,\n ending as ending_at,\n quarter,\n year_0,\n is_adjustment,\n closed\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_accounting_periods_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_periods_tmp", "model.netsuite_source.stg_netsuite__accounting_periods_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__accounting_periods"], "unique_id": "model.netsuite_source.stg_netsuite__accounting_periods", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__accounting_periods.sql", "original_file_path": "models/stg_netsuite__accounting_periods.sql", "name": "stg_netsuite__accounting_periods", "alias": "stg_netsuite__accounting_periods", "checksum": {"name": "sha256", "checksum": "74444e8cee5ff531a4ae661962042a173d7586eb5fd1e5808cbfdaaf0dffccf8"}, "tags": [], "refs": [["stg_netsuite__accounting_periods_tmp"], ["stg_netsuite__accounting_periods_tmp"]], "sources": [], "description": "Table detailing all accounting periods, including monthly, quarterly and yearly.", "columns": {"accounting_period_id": {"name": "accounting_period_id", "description": "The unique identifier of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_id": {"name": "year_id", "description": "The year id the accounting period is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fiscal_calendar_id": {"name": "fiscal_calendar_id", "description": "The fiscal calendar id the accounting period is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quarter": {"name": "quarter", "description": "The quarter which the accounting period takes place in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "starting_at": {"name": "starting_at", "description": "The timestamp indicating the start of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ending_at": {"name": "ending_at", "description": "The timestamp indicating the end of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_0": {"name": "year_0", "description": "Value indicating whether the accounting period is in it's initial year.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_adjustment": {"name": "is_adjustment", "description": "Value indicating whether the accounting period is an adjustment (either yes or no).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Value indicating whether the accounting period is closed (either yes or no).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_netsuite.yml", "build_path": "target/compiled/netsuite_source/models/stg_netsuite__accounting_periods.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n string\n) as \n \n _fivetran_id\n \n , \n cast(null as \n string\n) as \n \n _fivetran_id2\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n \n \n accounting_period_id\n \n as \n \n accounting_period_id\n \n, \n \n \n closed\n \n as \n \n closed\n \n, \n cast(null as \n string\n) as \n \n closed_accounts_payable\n \n , \n cast(null as \n string\n) as \n \n closed_accounts_receivable\n \n , \n cast(null as \n string\n) as \n \n closed_all\n \n , \n cast(null as \n timestamp\n) as \n \n closed_on\n \n , \n cast(null as \n string\n) as \n \n closed_payroll\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n \n \n ending\n \n as \n \n ending\n \n, \n \n \n fiscal_calendar_id\n \n as \n \n fiscal_calendar_id\n \n, \n cast(null as \n string\n) as \n \n fivetran_index\n \n , \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n is_adjustment\n \n as \n \n is_adjustment\n \n, \n cast(null as \n string\n) as \n \n isinactive\n \n , \n cast(null as \n string\n) as \n \n locked_accounts_payable\n \n , \n cast(null as \n string\n) as \n \n locked_accounts_receivable\n \n , \n cast(null as \n string\n) as \n \n locked_all\n \n , \n cast(null as \n string\n) as \n \n locked_payroll\n \n , \n \n \n name\n \n as \n \n name\n \n, \n cast(null as \n float64\n) as \n \n parent_id\n \n , \n \n \n quarter\n \n as \n \n quarter\n \n, \n \n \n starting\n \n as \n \n starting\n \n, \n \n \n year_0\n \n as \n \n year_0\n \n, \n \n \n year_id\n \n as \n \n year_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n accounting_period_id,\n name,\n full_name,\n fiscal_calendar_id,\n year_id,\n starting as starting_at,\n ending as ending_at,\n quarter,\n year_0,\n is_adjustment,\n closed\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`"}, "model.netsuite_source.stg_netsuite__accounting_periods_tmp": {"raw_sql": "select * \nfrom {{ var('accounting_periods') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.accounting_periods_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__accounting_periods_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__accounting_periods_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__accounting_periods_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__accounting_periods_tmp.sql", "name": "stg_netsuite__accounting_periods_tmp", "alias": "stg_netsuite__accounting_periods_tmp", "checksum": {"name": "sha256", "checksum": "37b0fc99f88a139849589336915b535b93f80881d4cdc8f4aeb512bca1e5e2b5"}, "tags": [], "refs": [["accounting_periods_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__accounting_periods_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`accounting_periods_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods_tmp`"}, "model.netsuite_source.stg_netsuite__accounting_books_tmp": {"raw_sql": "select * \nfrom {{ var('accounting_books') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.accounting_books_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__accounting_books_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__accounting_books_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__accounting_books_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__accounting_books_tmp.sql", "name": "stg_netsuite__accounting_books_tmp", "alias": "stg_netsuite__accounting_books_tmp", "checksum": {"name": "sha256", "checksum": "672ae882498c5a60f42fc501a2efa14c7719dff1e12dd5259532a760662e7f7a"}, "tags": [], "refs": [["accounting_books_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__accounting_books_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`accounting_books_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books_tmp`"}, "model.netsuite_source.stg_netsuite__customers_tmp": {"raw_sql": "select * \nfrom {{ var('customers') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.customers_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__customers_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__customers_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__customers_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__customers_tmp.sql", "name": "stg_netsuite__customers_tmp", "alias": "stg_netsuite__customers_tmp", "checksum": {"name": "sha256", "checksum": "7a6da414265f879ac1179c3fa8b35cdc92d579e8cbeb14ee7f8176acea94717f"}, "tags": [], "refs": [["customers_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__customers_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`customers_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__customers_tmp`"}, "model.netsuite_source.stg_netsuite__transaction_lines_tmp": {"raw_sql": "select * \nfrom {{ var('transaction_lines') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.transaction_lines_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__transaction_lines_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__transaction_lines_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__transaction_lines_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__transaction_lines_tmp.sql", "name": "stg_netsuite__transaction_lines_tmp", "alias": "stg_netsuite__transaction_lines_tmp", "checksum": {"name": "sha256", "checksum": "b234f02f54dad882aa03d5ecf2c57b682e1e725b508818e007185b445b1c5377"}, "tags": [], "refs": [["transaction_lines_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__transaction_lines_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`transaction_lines_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines_tmp`"}, "model.netsuite_source.stg_netsuite__income_accounts_tmp": {"raw_sql": "select * \nfrom {{ var('income_accounts') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.income_accounts_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__income_accounts_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__income_accounts_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__income_accounts_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__income_accounts_tmp.sql", "name": "stg_netsuite__income_accounts_tmp", "alias": "stg_netsuite__income_accounts_tmp", "checksum": {"name": "sha256", "checksum": "1e0b69d8de773531b477ea6e967b81d8c5af275f261913be4ac73a24d156a44d"}, "tags": [], "refs": [["income_accounts_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__income_accounts_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`income_accounts_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__income_accounts_tmp`"}, "model.netsuite_source.stg_netsuite__accounts_tmp": {"raw_sql": "select * \nfrom {{ var('accounts') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.accounts_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__accounts_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__accounts_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__accounts_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__accounts_tmp.sql", "name": "stg_netsuite__accounts_tmp", "alias": "stg_netsuite__accounts_tmp", "checksum": {"name": "sha256", "checksum": "2c146b1084dc499ea18c9a5e1c94c73f50fd209b32c059786845b9bdd7f2f67e"}, "tags": [], "refs": [["accounts_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__accounts_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`accounts_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts_tmp`"}, "model.netsuite_source.stg_netsuite__departments_tmp": {"raw_sql": "select * \nfrom {{ var('departments') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.departments_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__departments_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__departments_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__departments_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__departments_tmp.sql", "name": "stg_netsuite__departments_tmp", "alias": "stg_netsuite__departments_tmp", "checksum": {"name": "sha256", "checksum": "12b870e18e2f73deee6df6f03c32c6a83aa242b739ef48b2e3659bb0cb02ed9c"}, "tags": [], "refs": [["departments_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__departments_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`departments_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__departments_tmp`"}, "model.netsuite_source.stg_netsuite__currencies_tmp": {"raw_sql": "select * \nfrom {{ var('currencies') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.currencies_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__currencies_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__currencies_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__currencies_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__currencies_tmp.sql", "name": "stg_netsuite__currencies_tmp", "alias": "stg_netsuite__currencies_tmp", "checksum": {"name": "sha256", "checksum": "f70a591c58fbaa98b45518cec8895145244bc4425fe3b52806a211cc1642fa30"}, "tags": [], "refs": [["currencies_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__currencies_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`currencies_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__currencies_tmp`"}, "model.netsuite_source.stg_netsuite__vendor_types_tmp": {"raw_sql": "select * \nfrom {{ var('vendor_types') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.vendor_types_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__vendor_types_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__vendor_types_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__vendor_types_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__vendor_types_tmp.sql", "name": "stg_netsuite__vendor_types_tmp", "alias": "stg_netsuite__vendor_types_tmp", "checksum": {"name": "sha256", "checksum": "09da7c1581904eb447cc86f19e9c2ea570cba759362b66a292bff57f451a20f2"}, "tags": [], "refs": [["vendor_types_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__vendor_types_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`vendor_types_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendor_types_tmp`"}, "model.netsuite_source.stg_netsuite__vendors_tmp": {"raw_sql": "select * \nfrom {{ var('vendors') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.vendors_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__vendors_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__vendors_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__vendors_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__vendors_tmp.sql", "name": "stg_netsuite__vendors_tmp", "alias": "stg_netsuite__vendors_tmp", "checksum": {"name": "sha256", "checksum": "a28390b43a916d9bfd2a9cc0da58469bf4360460474c5b3bbd999afd05efdc0d"}, "tags": [], "refs": [["vendors_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__vendors_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`vendors_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendors_tmp`"}, "model.netsuite_source.stg_netsuite__locations_tmp": {"raw_sql": "select * \nfrom {{ var('locations') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.locations_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__locations_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__locations_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__locations_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__locations_tmp.sql", "name": "stg_netsuite__locations_tmp", "alias": "stg_netsuite__locations_tmp", "checksum": {"name": "sha256", "checksum": "df2534bac90e3709f081742c3bb995e4062955cc495bed1e1975c52b234c525c"}, "tags": [], "refs": [["locations_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__locations_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`locations_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__locations_tmp`"}, "model.netsuite_source.stg_netsuite__items_tmp": {"raw_sql": "select * \nfrom {{ var('items') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.items_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__items_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__items_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__items_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__items_tmp.sql", "name": "stg_netsuite__items_tmp", "alias": "stg_netsuite__items_tmp", "checksum": {"name": "sha256", "checksum": "b161cb5499b4e7b91fc1ec3dc6e0b8f776f37a9d9070369b45465d099cc477aa"}, "tags": [], "refs": [["items_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__items_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`items_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__items_tmp`"}, "model.netsuite_source.stg_netsuite__subsidiaries_tmp": {"raw_sql": "select * \nfrom {{ var('subsidiaries') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.subsidiaries_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__subsidiaries_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__subsidiaries_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__subsidiaries_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__subsidiaries_tmp.sql", "name": "stg_netsuite__subsidiaries_tmp", "alias": "stg_netsuite__subsidiaries_tmp", "checksum": {"name": "sha256", "checksum": "d8cef2bf2319a75db711f6964af07f8ee054a083766cdcaa76a5e4a9a25c3783"}, "tags": [], "refs": [["subsidiaries_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__subsidiaries_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`subsidiaries_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries_tmp`"}, "model.netsuite_source.stg_netsuite__transactions_tmp": {"raw_sql": "select * \nfrom {{ var('transactions') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.transactions_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__transactions_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__transactions_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__transactions_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__transactions_tmp.sql", "name": "stg_netsuite__transactions_tmp", "alias": "stg_netsuite__transactions_tmp", "checksum": {"name": "sha256", "checksum": "d729b8447fa068f1941f3f7d9ae9a4d0c5445b86c869a367effcd25b64b73188"}, "tags": [], "refs": [["transactions_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__transactions_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`transactions_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions_tmp`"}, "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp": {"raw_sql": "select * \nfrom {{ var('consolidated_exchange_rates') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.consolidated_exchange_rates_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__consolidated_exchange_rates_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__consolidated_exchange_rates_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__consolidated_exchange_rates_tmp.sql", "name": "stg_netsuite__consolidated_exchange_rates_tmp", "alias": "stg_netsuite__consolidated_exchange_rates_tmp", "checksum": {"name": "sha256", "checksum": "2d75d2f524a0c79e3c3f28b80f2d32b5c0a2d0bc2966b3d0d4ebfdb846fb33e8"}, "tags": [], "refs": [["consolidated_exchange_rates_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__consolidated_exchange_rates_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`consolidated_exchange_rates_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates_tmp`"}, "model.netsuite_source.stg_netsuite__classes_tmp": {"raw_sql": "select * \nfrom {{ var('classes') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.classes_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__classes_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__classes_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__classes_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__classes_tmp.sql", "name": "stg_netsuite__classes_tmp", "alias": "stg_netsuite__classes_tmp", "checksum": {"name": "sha256", "checksum": "a25075f79a52054372de86e51c39bba108aee19cd3ae09cdf2dae1bbc3c98ecb"}, "tags": [], "refs": [["classes_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__classes_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`classes_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__classes_tmp`"}, "model.netsuite_source.stg_netsuite__expense_accounts_tmp": {"raw_sql": "select * \nfrom {{ var('expense_accounts') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.expense_accounts_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__expense_accounts_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__expense_accounts_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__expense_accounts_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__expense_accounts_tmp.sql", "name": "stg_netsuite__expense_accounts_tmp", "alias": "stg_netsuite__expense_accounts_tmp", "checksum": {"name": "sha256", "checksum": "7072d825bb0dcceb497e3d644b38bfdc2d4a32f846bb4e19736da29689268f68"}, "tags": [], "refs": [["expense_accounts_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__expense_accounts_tmp.sql", "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`netsuite_source_integration_tests`.`expense_accounts_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__expense_accounts_tmp`"}, "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "accounting_book_id", "model": "{{ ref('stg_netsuite__accounting_books') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_books"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__accounting_books_accounting_book_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__accounting_books_accounting_book_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__accounting_books_accounting_book_id", "alias": "unique_stg_netsuite__accounting_books_accounting_book_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounting_books"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__accounting_books_accounting_book_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n accounting_book_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\n where accounting_book_id is not null\n group by accounting_book_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "accounting_book_id"}, "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "accounting_book_id", "model": "{{ ref('stg_netsuite__accounting_books') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_books"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__accounting_books_accounting_book_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__accounting_books_accounting_book_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__accounting_books_accounting_book_id", "alias": "not_null_stg_netsuite__accounting_books_accounting_book_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounting_books"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__accounting_books_accounting_book_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\nwhere accounting_book_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "accounting_book_id"}, "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "accounting_period_id", "model": "{{ ref('stg_netsuite__accounting_periods') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_periods"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__accounting_periods_accounting_period_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__accounting_periods_accounting_period_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__accounting_periods_accounting_period_id", "alias": "not_null_stg_netsuite__accounting_periods_accounting_period_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounting_periods"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__accounting_periods_accounting_period_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\nwhere accounting_period_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "accounting_period_id"}, "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "fiscal_calendar_id", "model": "{{ ref('stg_netsuite__accounting_periods') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_periods"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__accounting_periods_fiscal_calendar_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__accounting_periods_fiscal_calendar_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__accounting_periods_fiscal_calendar_id", "alias": "not_null_stg_netsuite__accounting_periods_fiscal_calendar_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounting_periods"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__accounting_periods_fiscal_calendar_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\nwhere fiscal_calendar_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "fiscal_calendar_id"}, "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ dbt_utils.test_unique_combination_of_columns(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["accounting_period_id", "fiscal_calendar_id"], "model": "{{ ref('stg_netsuite__accounting_periods') }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_periods"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id"], "unique_id": "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_66365bc62c914e82762141a181706804.sql", "original_file_path": "models/stg_netsuite.yml", "name": "dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id", "alias": "dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounting_periods"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_66365bc62c914e82762141a181706804.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n accounting_period_id, fiscal_calendar_id\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n\n group by accounting_period_id, fiscal_calendar_id\n having count(*) > 1\n\n)\n\nselect count(*)\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null}, "test.netsuite_source.unique_stg_netsuite__accounts_account_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "account_id", "model": "{{ ref('stg_netsuite__accounts') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__accounts"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__accounts_account_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__accounts_account_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__accounts_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__accounts_account_id", "alias": "unique_stg_netsuite__accounts_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__accounts_account_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n account_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n where account_id is not null\n group by account_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "account_id"}, "test.netsuite_source.not_null_stg_netsuite__accounts_account_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "account_id", "model": "{{ ref('stg_netsuite__accounts') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__accounts"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__accounts_account_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounts_account_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__accounts_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__accounts_account_id", "alias": "not_null_stg_netsuite__accounts_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__accounts_account_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\nwhere account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "account_id"}, "test.netsuite_source.unique_stg_netsuite__classes_class_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "class_id", "model": "{{ ref('stg_netsuite__classes') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__classes"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__classes_class_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__classes_class_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__classes_class_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__classes_class_id", "alias": "unique_stg_netsuite__classes_class_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__classes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__classes_class_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n class_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__classes`\n where class_id is not null\n group by class_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "class_id"}, "test.netsuite_source.not_null_stg_netsuite__classes_class_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "class_id", "model": "{{ ref('stg_netsuite__classes') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__classes"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__classes_class_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__classes_class_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__classes_class_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__classes_class_id", "alias": "not_null_stg_netsuite__classes_class_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__classes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__classes_class_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__classes`\nwhere class_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "class_id"}, "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "consolidated_exchange_rate_id", "model": "{{ ref('stg_netsuite__consolidated_exchange_rates') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id", "alias": "unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__consolidated_exchange_rates"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n consolidated_exchange_rate_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\n where consolidated_exchange_rate_id is not null\n group by consolidated_exchange_rate_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "consolidated_exchange_rate_id"}, "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "consolidated_exchange_rate_id", "model": "{{ ref('stg_netsuite__consolidated_exchange_rates') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id", "alias": "not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__consolidated_exchange_rates"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\nwhere consolidated_exchange_rate_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "consolidated_exchange_rate_id"}, "test.netsuite_source.unique_stg_netsuite__currencies_currency_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "currency_id", "model": "{{ ref('stg_netsuite__currencies') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__currencies"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__currencies_currency_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__currencies_currency_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__currencies_currency_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__currencies_currency_id", "alias": "unique_stg_netsuite__currencies_currency_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__currencies"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__currencies_currency_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n currency_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__currencies`\n where currency_id is not null\n group by currency_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "currency_id"}, "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "currency_id", "model": "{{ ref('stg_netsuite__currencies') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__currencies"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__currencies_currency_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__currencies_currency_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__currencies_currency_id", "alias": "not_null_stg_netsuite__currencies_currency_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__currencies"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__currencies_currency_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__currencies`\nwhere currency_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "currency_id"}, "test.netsuite_source.unique_stg_netsuite__customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ ref('stg_netsuite__customers') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__customers"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__customers_customer_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__customers_customer_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__customers_customer_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__customers_customer_id", "alias": "unique_stg_netsuite__customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__customers_customer_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n customer_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__customers`\n where customer_id is not null\n group by customer_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.netsuite_source.not_null_stg_netsuite__customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ ref('stg_netsuite__customers') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__customers"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__customers_customer_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__customers_customer_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__customers_customer_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__customers_customer_id", "alias": "not_null_stg_netsuite__customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__customers_customer_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__customers`\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.netsuite_source.unique_stg_netsuite__departments_department_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "department_id", "model": "{{ ref('stg_netsuite__departments') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__departments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__departments_department_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__departments_department_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__departments_department_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__departments_department_id", "alias": "unique_stg_netsuite__departments_department_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__departments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__departments_department_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n department_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__departments`\n where department_id is not null\n group by department_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "department_id"}, "test.netsuite_source.not_null_stg_netsuite__departments_department_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "department_id", "model": "{{ ref('stg_netsuite__departments') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__departments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__departments_department_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__departments_department_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__departments_department_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__departments_department_id", "alias": "not_null_stg_netsuite__departments_department_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__departments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__departments_department_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__departments`\nwhere department_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "department_id"}, "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "expense_account_id", "model": "{{ ref('stg_netsuite__expense_accounts') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__expense_accounts"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__expense_accounts_expense_account_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__expense_accounts_expense_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__expense_accounts_expense_account_id", "alias": "unique_stg_netsuite__expense_accounts_expense_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__expense_accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__expense_accounts_expense_account_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n expense_account_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__expense_accounts`\n where expense_account_id is not null\n group by expense_account_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "expense_account_id"}, "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "expense_account_id", "model": "{{ ref('stg_netsuite__expense_accounts') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__expense_accounts"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__expense_accounts_expense_account_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__expense_accounts_expense_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__expense_accounts_expense_account_id", "alias": "not_null_stg_netsuite__expense_accounts_expense_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__expense_accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__expense_accounts_expense_account_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__expense_accounts`\nwhere expense_account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "expense_account_id"}, "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "income_account_id", "model": "{{ ref('stg_netsuite__income_accounts') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__income_accounts"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__income_accounts_income_account_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__income_accounts_income_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__income_accounts_income_account_id", "alias": "unique_stg_netsuite__income_accounts_income_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__income_accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__income_accounts_income_account_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n income_account_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__income_accounts`\n where income_account_id is not null\n group by income_account_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "income_account_id"}, "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "income_account_id", "model": "{{ ref('stg_netsuite__income_accounts') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__income_accounts"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__income_accounts_income_account_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__income_accounts_income_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__income_accounts_income_account_id", "alias": "not_null_stg_netsuite__income_accounts_income_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__income_accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__income_accounts_income_account_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__income_accounts`\nwhere income_account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "income_account_id"}, "test.netsuite_source.unique_stg_netsuite__items_item_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "item_id", "model": "{{ ref('stg_netsuite__items') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__items"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__items_item_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__items_item_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__items_item_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__items_item_id", "alias": "unique_stg_netsuite__items_item_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__items"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__items_item_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n item_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__items`\n where item_id is not null\n group by item_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "item_id"}, "test.netsuite_source.not_null_stg_netsuite__items_item_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "item_id", "model": "{{ ref('stg_netsuite__items') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__items"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__items_item_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__items_item_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__items_item_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__items_item_id", "alias": "not_null_stg_netsuite__items_item_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__items"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__items_item_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__items`\nwhere item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "item_id"}, "test.netsuite_source.unique_stg_netsuite__locations_location_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "location_id", "model": "{{ ref('stg_netsuite__locations') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__locations"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__locations_location_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__locations_location_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__locations_location_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__locations_location_id", "alias": "unique_stg_netsuite__locations_location_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__locations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__locations_location_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n location_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__locations`\n where location_id is not null\n group by location_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "location_id"}, "test.netsuite_source.not_null_stg_netsuite__locations_location_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "location_id", "model": "{{ ref('stg_netsuite__locations') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__locations"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__locations_location_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__locations_location_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__locations_location_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__locations_location_id", "alias": "not_null_stg_netsuite__locations_location_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__locations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__locations_location_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__locations`\nwhere location_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "location_id"}, "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "subsidiary_id", "model": "{{ ref('stg_netsuite__subsidiaries') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__subsidiaries"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__subsidiaries_subsidiary_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__subsidiaries_subsidiary_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__subsidiaries_subsidiary_id", "alias": "unique_stg_netsuite__subsidiaries_subsidiary_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__subsidiaries"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__subsidiaries_subsidiary_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n subsidiary_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n where subsidiary_id is not null\n group by subsidiary_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "subsidiary_id"}, "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "subsidiary_id", "model": "{{ ref('stg_netsuite__subsidiaries') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__subsidiaries"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__subsidiaries_subsidiary_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__subsidiaries_subsidiary_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__subsidiaries_subsidiary_id", "alias": "not_null_stg_netsuite__subsidiaries_subsidiary_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__subsidiaries"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__subsidiaries_subsidiary_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\nwhere subsidiary_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "subsidiary_id"}, "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "transaction_id", "model": "{{ ref('stg_netsuite__transaction_lines') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__transaction_lines"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__transaction_lines_transaction_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__transaction_lines_transaction_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__transaction_lines_transaction_id", "alias": "not_null_stg_netsuite__transaction_lines_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__transaction_lines"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__transaction_lines_transaction_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\nwhere transaction_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_id"}, "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "transaction_line_id", "model": "{{ ref('stg_netsuite__transaction_lines') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__transaction_lines"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__transaction_lines_transaction_line_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__transaction_lines_transaction_line_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__transaction_lines_transaction_line_id", "alias": "not_null_stg_netsuite__transaction_lines_transaction_line_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__transaction_lines"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__transaction_lines_transaction_line_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\nwhere transaction_line_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_line_id"}, "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ dbt_utils.test_unique_combination_of_columns(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["transaction_id", "transaction_line_id"], "model": "{{ ref('stg_netsuite__transaction_lines') }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns"], "nodes": ["model.netsuite_source.stg_netsuite__transaction_lines"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id"], "unique_id": "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_ce4eeeb4dddc34896344a3fa703bedb3.sql", "original_file_path": "models/stg_netsuite.yml", "name": "dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id", "alias": "dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__transaction_lines"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_ce4eeeb4dddc34896344a3fa703bedb3.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n transaction_id, transaction_line_id\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n\n group by transaction_id, transaction_line_id\n having count(*) > 1\n\n)\n\nselect count(*)\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null}, "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "transaction_id", "model": "{{ ref('stg_netsuite__transactions') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__transactions"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__transactions_transaction_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__transactions_transaction_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__transactions_transaction_id", "alias": "unique_stg_netsuite__transactions_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__transactions"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__transactions_transaction_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n transaction_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n where transaction_id is not null\n group by transaction_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_id"}, "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "transaction_id", "model": "{{ ref('stg_netsuite__transactions') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__transactions"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__transactions_transaction_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__transactions_transaction_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__transactions_transaction_id", "alias": "not_null_stg_netsuite__transactions_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__transactions"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__transactions_transaction_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\nwhere transaction_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_id"}, "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "vendor_type_id", "model": "{{ ref('stg_netsuite__vendor_types') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__vendor_types"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__vendor_types_vendor_type_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__vendor_types_vendor_type_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__vendor_types_vendor_type_id", "alias": "unique_stg_netsuite__vendor_types_vendor_type_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__vendor_types"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__vendor_types_vendor_type_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n vendor_type_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendor_types`\n where vendor_type_id is not null\n group by vendor_type_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "vendor_type_id"}, "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "vendor_type_id", "model": "{{ ref('stg_netsuite__vendor_types') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__vendor_types"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__vendor_types_vendor_type_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__vendor_types_vendor_type_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__vendor_types_vendor_type_id", "alias": "not_null_stg_netsuite__vendor_types_vendor_type_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__vendor_types"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__vendor_types_vendor_type_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendor_types`\nwhere vendor_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "vendor_type_id"}, "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "vendor_id", "model": "{{ ref('stg_netsuite__vendors') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__vendors"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__vendors_vendor_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__vendors_vendor_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__vendors_vendor_id", "alias": "unique_stg_netsuite__vendors_vendor_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__vendors"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__vendors_vendor_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n vendor_id\n\n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendors`\n where vendor_id is not null\n group by vendor_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "vendor_id"}, "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "vendor_id", "model": "{{ ref('stg_netsuite__vendors') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__vendors"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__vendors_vendor_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__vendors_vendor_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__vendors_vendor_id", "alias": "not_null_stg_netsuite__vendors_vendor_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__vendors"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__vendors_vendor_id.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendors`\nwhere vendor_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "vendor_id"}, "model.netsuite.netsuite__income_statement": {"raw_sql": "with transactions_with_converted_amounts as (\n select * \n from {{ ref('int_netsuite__transactions_with_converted_amounts') }}\n), \n\n--Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n{% if var('income_statement_transaction_detail_columns') != []%}\ntransaction_details as (\n select * \n from {{ ref('netsuite__transaction_details') }}\n), \n{% endif %}\n\naccounts as (\n select * \n from {{ ref('stg_netsuite__accounts') }}\n), \n\naccounting_periods as (\n select * \n from {{ ref('stg_netsuite__accounting_periods') }}\n),\n\nsubsidiaries as (\n select * \n from {{ ref('stg_netsuite__subsidiaries') }}\n),\n\ntransaction_lines as (\n select * \n from {{ ref('stg_netsuite__transaction_lines') }}\n),\n\nclasses as (\n select * \n from {{ ref('stg_netsuite__classes') }}\n),\n\nlocations as (\n select * \n from {{ ref('stg_netsuite__locations') }}\n),\n\ndepartments as (\n select * \n from {{ ref('stg_netsuite__departments') }}\n),\n\nincom_statement as (\n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n accounts.name as account_name,\n accounts.type_name as account_type_name,\n accounts.account_id as account_id,\n accounts.account_number,\n\n --The below script allows for accounts table pass through columns.\n {% if var('accounts_pass_through_columns') %}\n\n accounts.{{ var('accounts_pass_through_columns') | join (\", accounts.\")}} ,\n\n {% endif %}\n\n {{ dbt_utils.concat(['accounts.account_number',\"'-'\", 'accounts.name']) }} as account_number_and_name,\n classes.full_name as class_full_name,\n\n --The below script allows for classes table pass through columns.\n {% if var('classes_pass_through_columns') %}\n \n classes.{{ var('classes_pass_through_columns') | join (\", classes.\")}} ,\n\n {% endif %}\n\n locations.full_name as location_full_name,\n departments.full_name as department_full_name,\n\n --The below script allows for departments table pass through columns.\n {% if var('departments_pass_through_columns') %}\n \n departments.{{ var('departments_pass_through_columns') | join (\", departments.\")}} ,\n\n {% endif %}\n\n -converted_amount_using_transaction_accounting_period as converted_amount,\n transactions_with_converted_amounts.account_category as account_category,\n case when lower(accounts.type_name) = 'income' then 1\n when lower(accounts.type_name) = 'cost of goods sold' then 2\n when lower(accounts.type_name) = 'expense' then 3\n when lower(accounts.type_name) = 'other income' then 4\n when lower(accounts.type_name) = 'other expense' then 5\n else null\n end as income_statement_sort_helper\n\n --Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n {% if var('income_statement_transaction_detail_columns') %}\n\n , transaction_details.{{ var('income_statement_transaction_detail_columns') | join (\", transaction_details.\")}}\n\n {% endif %}\n \n \n from transactions_with_converted_amounts\n\n join transaction_lines as transaction_lines\n on transaction_lines.transaction_line_id = transactions_with_converted_amounts.transaction_line_id\n and transaction_lines.transaction_id = transactions_with_converted_amounts.transaction_id\n\n left join classes \n on classes.class_id = transaction_lines.class_id\n\n left join locations\n on locations.location_id = transaction_lines.location_id\n\n left join departments \n on departments.department_id = transaction_lines.department_id\n join accounts on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n\n --Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n {% if var('income_statement_transaction_detail_columns') != []%}\n join transaction_details\n on transaction_details.transaction_id = transactions_with_converted_amounts.transaction_id\n and transaction_details.transaction_line_id = transactions_with_converted_amounts.transaction_line_id\n {% endif %}\n\n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and transactions_with_converted_amounts.transaction_accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n and transactions_with_converted_amounts.is_income_statement\n)\n\nselect *\nfrom incom_statement", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.concat"], "nodes": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__transaction_lines", "model.netsuite_source.stg_netsuite__classes", "model.netsuite_source.stg_netsuite__locations", "model.netsuite_source.stg_netsuite__departments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_netsuite", "fqn": ["netsuite", "netsuite__income_statement"], "unique_id": "model.netsuite.netsuite__income_statement", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "netsuite__income_statement.sql", "original_file_path": "models/netsuite__income_statement.sql", "name": "netsuite__income_statement", "alias": "netsuite__income_statement", "checksum": {"name": "sha256", "checksum": "05c6a749145e27a5e9ca311fe1f7aa3cd4da28afe7ab83db4416cf79b2222227"}, "tags": [], "refs": [["int_netsuite__transactions_with_converted_amounts"], ["stg_netsuite__accounts"], ["stg_netsuite__accounting_periods"], ["stg_netsuite__subsidiaries"], ["stg_netsuite__transaction_lines"], ["stg_netsuite__classes"], ["stg_netsuite__locations"], ["stg_netsuite__departments"]], "sources": [], "description": "The income statement query uses the transactions_with_converted_amount transformation to recreate all lines necessary for the income statement. It also joins in class, department and location information for enhanced reporting. \n", "columns": {"accounting_period_id": {"name": "accounting_period_id", "description": "The unique identifier of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_ending": {"name": "accounting_period_ending", "description": "End date of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_full_name": {"name": "accounting_period_full_name", "description": "Accounting periods full name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_name": {"name": "accounting_period_name", "description": "Name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_adjustment": {"name": "is_accounting_period_adjustment", "description": "Yes/No field, indicating whether or not the selecting accounting period is an adjustment period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_closed": {"name": "is_accounting_period_closed", "description": "Yes/No field, indicating whether or not the selecting accounting period is closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_type_name": {"name": "account_type_name", "description": "The accounts type name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The unique identifier of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number_and_name": {"name": "account_number_and_name", "description": "Concatenation of account number and account name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_full_name": {"name": "class_full_name", "description": "Full name of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_full_name": {"name": "location_full_name", "description": "Full name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_full_name": {"name": "department_full_name", "description": "Full name of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "converted_amount": {"name": "converted_amount", "description": "Transaction amount, converted into the primary subsidiary's default currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_category": {"name": "account_category", "description": "Category of the account. Options include Asset, Liability, Equity, Expense or Income.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "income_statement_sort_helper": {"name": "income_statement_sort_helper", "description": "Helper column for sorting income statement records.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/netsuite.yml", "build_path": "target/compiled/netsuite/models/netsuite__income_statement.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "netsuite"}, "compiled_sql": "with __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n), \n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n), __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_books as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\n), \n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\nconsolidated_exchange_rates as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n), __dbt__CTE__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= CURRENT_TIMESTAMP() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n), __dbt__CTE__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__CTE__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n),transactions_with_converted_amounts as (\n select * \n from __dbt__CTE__int_netsuite__transactions_with_converted_amounts\n), \n\n--Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n\n\naccounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\nclasses as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__classes`\n),\n\nlocations as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__locations`\n),\n\ndepartments as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__departments`\n),\n\nincom_statement as (\n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n accounts.name as account_name,\n accounts.type_name as account_type_name,\n accounts.account_id as account_id,\n accounts.account_number,\n\n --The below script allows for accounts table pass through columns.\n \n\n concat(accounts.account_number, '-', accounts.name) as account_number_and_name,\n classes.full_name as class_full_name,\n\n --The below script allows for classes table pass through columns.\n \n\n locations.full_name as location_full_name,\n departments.full_name as department_full_name,\n\n --The below script allows for departments table pass through columns.\n \n\n -converted_amount_using_transaction_accounting_period as converted_amount,\n transactions_with_converted_amounts.account_category as account_category,\n case when lower(accounts.type_name) = 'income' then 1\n when lower(accounts.type_name) = 'cost of goods sold' then 2\n when lower(accounts.type_name) = 'expense' then 3\n when lower(accounts.type_name) = 'other income' then 4\n when lower(accounts.type_name) = 'other expense' then 5\n else null\n end as income_statement_sort_helper\n\n --Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n \n \n \n from transactions_with_converted_amounts\n\n join transaction_lines as transaction_lines\n on transaction_lines.transaction_line_id = transactions_with_converted_amounts.transaction_line_id\n and transaction_lines.transaction_id = transactions_with_converted_amounts.transaction_id\n\n left join classes \n on classes.class_id = transaction_lines.class_id\n\n left join locations\n on locations.location_id = transaction_lines.location_id\n\n left join departments \n on departments.department_id = transaction_lines.department_id\n join accounts on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n\n --Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n \n\n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and transactions_with_converted_amounts.transaction_accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n and transactions_with_converted_amounts.is_income_statement\n)\n\nselect *\nfrom incom_statement", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "sql": " __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n), \n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n)"}, {"id": "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "sql": " __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_books as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\n), \n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\nconsolidated_exchange_rates as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n)"}, {"id": "model.netsuite.int_netsuite__transaction_and_reporting_periods", "sql": " __dbt__CTE__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= CURRENT_TIMESTAMP() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n)"}, {"id": "model.netsuite.int_netsuite__transactions_with_converted_amounts", "sql": " __dbt__CTE__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__CTE__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n)"}], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_netsuite`.`netsuite__income_statement`"}, "model.netsuite.netsuite__balance_sheet": {"raw_sql": "with transactions_with_converted_amounts as (\n select * \n from {{ref('int_netsuite__transactions_with_converted_amounts')}}\n), \n\n--Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n{% if var('balance_sheet_transaction_detail_columns') != []%}\ntransaction_details as (\n select * \n from {{ ref('netsuite__transaction_details') }}\n), \n{% endif %}\n\naccounts as (\n select * \n from {{ ref('stg_netsuite__accounts') }}\n), \n\naccounting_periods as (\n select * \n from {{ ref('stg_netsuite__accounting_periods') }}\n), \n\nsubsidiaries as (\n select * \n from {{ ref('stg_netsuite__subsidiaries') }}\n),\n\nbalance_sheet as ( \n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n transactions_with_converted_amounts.account_category as account_category,\n case\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 'Net Income'\n when lower(accounts.is_balancesheet) = 'f' then 'Retained Earnings'\n else accounts.name\n end as account_name,\n case\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 'Net Income'\n when lower(accounts.is_balancesheet) = 'f' then 'Retained Earnings'\n else accounts.type_name\n end as account_type_name,\n case\n when lower(accounts.is_balancesheet) = 'f' then null\n else accounts.account_id\n end as account_id,\n case\n when lower(accounts.is_balancesheet) = 'f' then null\n else accounts.account_number\n end as account_number,\n \n --The below script allows for accounts table pass through columns.\n {% if var('accounts_pass_through_columns') %}\n \n accounts.{{ var('accounts_pass_through_columns') | join (\", accounts.\")}} ,\n\n {% endif %}\n\n case\n when lower(accounts.is_balancesheet) = 'f' or lower(transactions_with_converted_amounts.account_category) = 'equity' then -converted_amount_using_transaction_accounting_period\n when lower(accounts.is_leftside) = 'f' then -converted_amount_using_reporting_month\n when lower(accounts.is_leftside) = 't' then converted_amount_using_reporting_month\n else 0\n end as converted_amount,\n \n case\n when lower(accounts.type_name) = 'bank' then 1\n when lower(accounts.type_name) = 'accounts receivable' then 2\n when lower(accounts.type_name) = 'unbilled receivable' then 3\n when lower(accounts.type_name) = 'other current asset' then 4\n when lower(accounts.type_name) = 'fixed asset' then 5\n when lower(accounts.type_name) = 'other asset' then 6\n when lower(accounts.type_name) = 'deferred expense' then 7\n when lower(accounts.type_name) = 'accounts payable' then 8\n when lower(accounts.type_name) = 'credit card' then 9\n when lower(accounts.type_name) = 'other current liability' then 10\n when lower(accounts.type_name) = 'long term liability' then 11\n when lower(accounts.type_name) = 'deferred revenue' then 12\n when lower(accounts.type_name) = 'equity' then 13\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 15\n when lower(accounts.is_balancesheet) = 'f' then 14\n else null\n end as balance_sheet_sort_helper\n \n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n {% if var('balance_sheet_transaction_detail_columns') %}\n \n , transaction_details.{{ var('balance_sheet_transaction_detail_columns') | join (\", transaction_details.\")}}\n\n {% endif %}\n\n from transactions_with_converted_amounts\n \n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n {% if var('balance_sheet_transaction_detail_columns') != []%}\n join transaction_details\n on transaction_details.transaction_id = transactions_with_converted_amounts.transaction_id\n and transaction_details.transaction_line_id = transactions_with_converted_amounts.transaction_line_id\n {% endif %}\n\n\n join accounts \n on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n\n join accounting_periods as transaction_accounting_periods \n on transaction_accounting_periods.accounting_period_id = transactions_with_converted_amounts.transaction_accounting_period_id\n\n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and transaction_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and (lower(accounts.is_balancesheet) = 't'\n or transactions_with_converted_amounts.is_income_statement)\n\n union all\n\n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n 'Equity' as account_category,\n 'Cumulative Translation Adjustment' as account_name,\n 'Cumulative Translation Adjustment' as account_type_name,\n null as account_id,\n null as account_number,\n\n --The below script allows for accounts table pass through columns.\n {% if var('accounts_pass_through_columns') %}\n\n null as {{ var('accounts_pass_through_columns') | join (\", null as \")}} ,\n\n {% endif %}\n\n case\n when lower(account_category) = 'equity' or is_income_statement then converted_amount_using_transaction_accounting_period\n else converted_amount_using_reporting_month\n end as converted_amount,\n 16 as balance_sheet_sort_helper\n\n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n {% if var('balance_sheet_transaction_detail_columns') %}\n\n , transaction_details.{{ var('balance_sheet_transaction_detail_columns') | join (\", transaction_details.\")}}\n\n {% endif %}\n\n from transactions_with_converted_amounts\n\n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n {% if var('balance_sheet_transaction_detail_columns') != []%}\n join transaction_details\n on transaction_details.transaction_id = transactions_with_converted_amounts.transaction_id\n and transaction_details.transaction_line_id = transactions_with_converted_amounts.transaction_line_id\n {% endif %}\n\n join accounts\n on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n \n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and (lower(accounts.is_balancesheet) = 't'\n or transactions_with_converted_amounts.is_income_statement)\n)\n\nselect *\nfrom balance_sheet\nlimit 100", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__subsidiaries"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_netsuite", "fqn": ["netsuite", "netsuite__balance_sheet"], "unique_id": "model.netsuite.netsuite__balance_sheet", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "netsuite__balance_sheet.sql", "original_file_path": "models/netsuite__balance_sheet.sql", "name": "netsuite__balance_sheet", "alias": "netsuite__balance_sheet", "checksum": {"name": "sha256", "checksum": "1ccf01869f4e9ef64477da8ddee8a3b4ce5ba80d89e8a89ac60331a9c71def5d"}, "tags": [], "refs": [["int_netsuite__transactions_with_converted_amounts"], ["stg_netsuite__accounts"], ["stg_netsuite__accounting_periods"], ["stg_netsuite__subsidiaries"]], "sources": [], "description": "The balance sheet query uses the transactions_with_converted_amount transformation to recreate all lines necessary for the balance sheet. Transactions that are not balance sheet transactions are categorized as either Retained Earnings or Net Income. The Cumulative Translation Adjustment total, which in most cases does not have transactions associated with it, is calculated manually in the second part of the query.\n", "columns": {"accounting_period_id": {"name": "accounting_period_id", "description": "The unique identifier of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_ending": {"name": "accounting_period_ending", "description": "End date of the accounting period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_full_name": {"name": "accounting_period_full_name", "description": "Accounting periods full name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_name": {"name": "accounting_period_name", "description": "Name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_adjustment": {"name": "is_accounting_period_adjustment", "description": "Yes/No field, indicating whether or not the selecting accounting period is an adjustment period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_closed": {"name": "is_accounting_period_closed", "description": "Yes/No field, indicating whether or not the selecting accounting period is closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_category": {"name": "account_category", "description": "Category of the account. Options include Asset, Liability, Equity, Expense or Income.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_type_name": {"name": "account_type_name", "description": "The accounts type name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The unique identifier of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "converted_amount": {"name": "converted_amount", "description": "Transaction amount, converted into the primary subsidiary's default currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "balance_sheet_sort_helper": {"name": "balance_sheet_sort_helper", "description": "Helper column for sorting balance sheet records.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/netsuite.yml", "build_path": "target/compiled/netsuite/models/netsuite__balance_sheet.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "netsuite"}, "compiled_sql": "with __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n), \n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n), __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_books as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\n), \n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\nconsolidated_exchange_rates as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n), __dbt__CTE__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= CURRENT_TIMESTAMP() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n), __dbt__CTE__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__CTE__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n),transactions_with_converted_amounts as (\n select * \n from __dbt__CTE__int_netsuite__transactions_with_converted_amounts\n), \n\n--Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n\n\naccounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n), \n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\nbalance_sheet as ( \n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n transactions_with_converted_amounts.account_category as account_category,\n case\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 'Net Income'\n when lower(accounts.is_balancesheet) = 'f' then 'Retained Earnings'\n else accounts.name\n end as account_name,\n case\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 'Net Income'\n when lower(accounts.is_balancesheet) = 'f' then 'Retained Earnings'\n else accounts.type_name\n end as account_type_name,\n case\n when lower(accounts.is_balancesheet) = 'f' then null\n else accounts.account_id\n end as account_id,\n case\n when lower(accounts.is_balancesheet) = 'f' then null\n else accounts.account_number\n end as account_number,\n \n --The below script allows for accounts table pass through columns.\n \n\n case\n when lower(accounts.is_balancesheet) = 'f' or lower(transactions_with_converted_amounts.account_category) = 'equity' then -converted_amount_using_transaction_accounting_period\n when lower(accounts.is_leftside) = 'f' then -converted_amount_using_reporting_month\n when lower(accounts.is_leftside) = 't' then converted_amount_using_reporting_month\n else 0\n end as converted_amount,\n \n case\n when lower(accounts.type_name) = 'bank' then 1\n when lower(accounts.type_name) = 'accounts receivable' then 2\n when lower(accounts.type_name) = 'unbilled receivable' then 3\n when lower(accounts.type_name) = 'other current asset' then 4\n when lower(accounts.type_name) = 'fixed asset' then 5\n when lower(accounts.type_name) = 'other asset' then 6\n when lower(accounts.type_name) = 'deferred expense' then 7\n when lower(accounts.type_name) = 'accounts payable' then 8\n when lower(accounts.type_name) = 'credit card' then 9\n when lower(accounts.type_name) = 'other current liability' then 10\n when lower(accounts.type_name) = 'long term liability' then 11\n when lower(accounts.type_name) = 'deferred revenue' then 12\n when lower(accounts.type_name) = 'equity' then 13\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 15\n when lower(accounts.is_balancesheet) = 'f' then 14\n else null\n end as balance_sheet_sort_helper\n \n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n \n\n from transactions_with_converted_amounts\n \n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n \n\n\n join accounts \n on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n\n join accounting_periods as transaction_accounting_periods \n on transaction_accounting_periods.accounting_period_id = transactions_with_converted_amounts.transaction_accounting_period_id\n\n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and transaction_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and (lower(accounts.is_balancesheet) = 't'\n or transactions_with_converted_amounts.is_income_statement)\n\n union all\n\n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n 'Equity' as account_category,\n 'Cumulative Translation Adjustment' as account_name,\n 'Cumulative Translation Adjustment' as account_type_name,\n null as account_id,\n null as account_number,\n\n --The below script allows for accounts table pass through columns.\n \n\n case\n when lower(account_category) = 'equity' or is_income_statement then converted_amount_using_transaction_accounting_period\n else converted_amount_using_reporting_month\n end as converted_amount,\n 16 as balance_sheet_sort_helper\n\n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n \n\n from transactions_with_converted_amounts\n\n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n \n\n join accounts\n on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n \n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and (lower(accounts.is_balancesheet) = 't'\n or transactions_with_converted_amounts.is_income_statement)\n)\n\nselect *\nfrom balance_sheet\nlimit 100", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "sql": " __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n), \n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n)"}, {"id": "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "sql": " __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_books as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\n), \n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\nconsolidated_exchange_rates as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n)"}, {"id": "model.netsuite.int_netsuite__transaction_and_reporting_periods", "sql": " __dbt__CTE__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= CURRENT_TIMESTAMP() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n)"}, {"id": "model.netsuite.int_netsuite__transactions_with_converted_amounts", "sql": " __dbt__CTE__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__CTE__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n)"}], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_netsuite`.`netsuite__balance_sheet`"}, "model.netsuite.netsuite__transaction_details": {"raw_sql": "with transactions_with_converted_amounts as (\n select * \n from {{ref('int_netsuite__transactions_with_converted_amounts')}}\n),\n\naccounts as (\n select * \n from {{ ref('stg_netsuite__accounts') }}\n),\n\naccounting_periods as (\n select * \n from {{ ref('stg_netsuite__accounting_periods') }}\n),\n\nsubsidiaries as (\n select * \n from {{ ref('stg_netsuite__subsidiaries') }}\n),\n\ntransaction_lines as (\n select * \n from {{ ref('stg_netsuite__transaction_lines') }}\n),\n\ntransactions as (\n select * \n from {{ ref('stg_netsuite__transactions') }}\n),\n\nincome_accounts as (\n select * \n from {{ ref('stg_netsuite__income_accounts') }}\n),\n\nexpense_accounts as (\n select * \n from {{ ref('stg_netsuite__expense_accounts') }}\n),\n\ncustomers as (\n select * \n from {{ ref('stg_netsuite__customers') }}\n),\n\nitems as (\n select * \n from {{ ref('stg_netsuite__items') }}\n),\n\nlocations as (\n select * \n from {{ ref('stg_netsuite__locations') }}\n),\n\nvendors as (\n select * \n from {{ ref('stg_netsuite__vendors') }}\n),\n\nvendor_types as (\n select * \n from {{ ref('stg_netsuite__vendor_types') }}\n),\n\ndepartments as (\n select * \n from {{ ref('stg_netsuite__departments') }}\n),\n\ncurrencies as (\n select * \n from {{ ref('stg_netsuite__currencies') }}\n),\n\ntransaction_details as (\n select\n transaction_lines.transaction_line_id,\n transaction_lines.memo as transaction_memo,\n lower(transaction_lines.non_posting_line) = 'yes' as is_transaction_non_posting,\n transactions.transaction_id,\n transactions.status as transaction_status,\n transactions.transaction_date,\n transactions.due_date_at as transaction_due_date,\n transactions.transaction_type as transaction_type,\n (lower(transactions.is_advanced_intercompany) = 'yes' or lower(transactions.is_intercompany) = 'yes') as is_transaction_intercompany,\n\n --The below script allows for transactions table pass through columns.\n {% if var('transactions_pass_through_columns') %}\n\n transactions.{{ var('transactions_pass_through_columns') | join (\", transactions.\")}} ,\n\n {% endif %}\n\n --The below script allows for transaction lines table pass through columns.\n {% if var('transaction_lines_pass_through_columns') %}\n \n transaction_lines.{{ var('transaction_lines_pass_through_columns') | join (\", transaction_lines.\")}} ,\n\n {% endif %}\n\n accounting_periods.ending_at as accounting_period_ending,\n accounting_periods.full_name as accounting_period_full_name,\n accounting_periods.name as accounting_period_name,\n lower(accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n accounts.name as account_name,\n accounts.type_name as account_type_name,\n accounts.account_id as account_id,\n accounts.account_number,\n\n --The below script allows for accounts table pass through columns.\n {% if var('accounts_pass_through_columns') %}\n \n accounts.{{ var('accounts_pass_through_columns') | join (\", accounts.\")}} ,\n\n {% endif %}\n\n lower(accounts.is_leftside) = 't' as is_account_leftside,\n lower(accounts.type_name) like 'accounts payable%' as is_accounts_payable,\n lower(accounts.type_name) like 'accounts receivable%' as is_accounts_receivable,\n lower(accounts.name) like '%intercompany%' as is_account_intercompany,\n coalesce(parent_account.name, accounts.name) as parent_account_name,\n income_accounts.income_account_id is not null as is_income_account,\n expense_accounts.expense_account_id is not null as is_expense_account,\n customers.company_name,\n customers.city as customer_city,\n customers.state as customer_state,\n customers.zipcode as customer_zipcode,\n customers.country as customer_country,\n customers.date_first_order_at as customer_date_first_order,\n items.name as item_name,\n items.type_name as item_type_name,\n items.sales_description,\n locations.name as location_name,\n locations.city as location_city,\n locations.country as location_country,\n vendor_types.name as vendor_type_name,\n vendors.company_name as vendor_name,\n vendors.create_date_at as vendor_create_date,\n currencies.name as currency_name,\n currencies.symbol as currency_symbol,\n departments.name as department_name,\n\n --The below script allows for departments table pass through columns.\n {% if var('departments_pass_through_columns') %}\n \n departments.{{ var('departments_pass_through_columns') | join (\", departments.\")}} ,\n\n {% endif %}\n\n subsidiaries.name as subsidiary_name,\n case\n when lower(accounts.type_name) = 'income' or lower(accounts.type_name) = 'other income' then -converted_amount_using_transaction_accounting_period\n else converted_amount_using_transaction_accounting_period\n end as converted_amount,\n case\n when lower(accounts.type_name) = 'income' or lower(accounts.type_name) = 'other income' then -transaction_lines.amount\n else transaction_lines.amount\n end as transaction_amount\n from transaction_lines\n\n join transactions\n on transactions.transaction_id = transaction_lines.transaction_id\n\n left join transactions_with_converted_amounts as transactions_with_converted_amounts\n on transactions_with_converted_amounts.transaction_line_id = transaction_lines.transaction_line_id\n and transactions_with_converted_amounts.transaction_id = transaction_lines.transaction_id\n and transactions_with_converted_amounts.transaction_accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n\n left join accounts \n on accounts.account_id = transaction_lines.account_id\n\n left join accounts as parent_account \n on parent_account.account_id = accounts.parent_id\n\n left join accounting_periods \n on accounting_periods.accounting_period_id = transactions.accounting_period_id\n left join income_accounts \n on income_accounts.income_account_id = accounts.account_id\n\n left join expense_accounts \n on expense_accounts.expense_account_id = accounts.account_id\n\n left join customers \n on customers.customer_id = transaction_lines.company_id\n\n left join items \n on items.item_id = transaction_lines.item_id\n\n left join locations \n on locations.location_id = transaction_lines.location_id\n\n left join vendors \n on vendors.vendor_id = transaction_lines.company_id\n\n left join vendor_types \n on vendor_types.vendor_type_id = vendors.vendor_type_id\n\n left join currencies \n on currencies.currency_id = transactions.currency_id\n\n left join departments \n on departments.department_id = transaction_lines.department_id\n\n join subsidiaries \n on subsidiaries.subsidiary_id = transaction_lines.subsidiary_id\n \n where (accounting_periods.fiscal_calendar_id is null\n or accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null))\n)\n\nselect *\nfrom transaction_details", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__transaction_lines", "model.netsuite_source.stg_netsuite__transactions", "model.netsuite_source.stg_netsuite__income_accounts", "model.netsuite_source.stg_netsuite__expense_accounts", "model.netsuite_source.stg_netsuite__customers", "model.netsuite_source.stg_netsuite__items", "model.netsuite_source.stg_netsuite__locations", "model.netsuite_source.stg_netsuite__vendors", "model.netsuite_source.stg_netsuite__vendor_types", "model.netsuite_source.stg_netsuite__departments", "model.netsuite_source.stg_netsuite__currencies"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_netsuite", "fqn": ["netsuite", "netsuite__transaction_details"], "unique_id": "model.netsuite.netsuite__transaction_details", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "netsuite__transaction_details.sql", "original_file_path": "models/netsuite__transaction_details.sql", "name": "netsuite__transaction_details", "alias": "netsuite__transaction_details", "checksum": {"name": "sha256", "checksum": "d7ff4ba843433df1badd5c8ffd10c00f06903b63731d2bf5c8870c177f6e4e5b"}, "tags": [], "refs": [["int_netsuite__transactions_with_converted_amounts"], ["stg_netsuite__accounts"], ["stg_netsuite__accounting_periods"], ["stg_netsuite__subsidiaries"], ["stg_netsuite__transaction_lines"], ["stg_netsuite__transactions"], ["stg_netsuite__income_accounts"], ["stg_netsuite__expense_accounts"], ["stg_netsuite__customers"], ["stg_netsuite__items"], ["stg_netsuite__locations"], ["stg_netsuite__vendors"], ["stg_netsuite__vendor_types"], ["stg_netsuite__departments"], ["stg_netsuite__currencies"]], "sources": [], "description": "This table uses Netsuite's core table, transaction_lines, and joins a handful of other tables to add more detail to those line items. For all transactions, you are able to see the associated accounting period, account and subsidiary. Where applicable, you can also see information about the customer, location, item, vendor, and department.\n", "columns": {"transaction_line_id": {"name": "transaction_line_id", "description": "Netsuite internal transaction line ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_memo": {"name": "transaction_memo", "description": "Memo associated with the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_transaction_non_posting": {"name": "is_transaction_non_posting", "description": "Yes/No field, indicating whether or not the transaction line is non-posting.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_id": {"name": "transaction_id", "description": "Netsuite internal transaction ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_status": {"name": "transaction_status", "description": "Status of the transaction (Closed, Pending Billing, Billing, etc.).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_date": {"name": "transaction_date", "description": "Timestamp of the date which the transaction occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_due_date": {"name": "transaction_due_date", "description": "Timestamp of the date which the transaction is due.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_type": {"name": "transaction_type", "description": "Type identifier of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_transaction_intercompany": {"name": "is_transaction_intercompany", "description": "Yes/No field, indicating whether or not the transaction is an intercompany transaction or an advanced intercompany transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_ending": {"name": "accounting_period_ending", "description": "End date of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_full_name": {"name": "accounting_period_full_name", "description": "Full name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_name": {"name": "accounting_period_name", "description": "Name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_adjustment": {"name": "is_accounting_period_adjustment", "description": "Yes/No field, indicating whether or not the selecting accounting period is an adjustment period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_closed": {"name": "is_accounting_period_closed", "description": "Yes/No field, indicating whether or not the selecting accounting period is closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_type_name": {"name": "account_type_name", "description": "The accounts type name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique identifier of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_account_leftside": {"name": "is_account_leftside", "description": "Yes/No field indicating whether or not the account is leftside.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounts_payable": {"name": "is_accounts_payable", "description": "Yes/No field indicating whether or not the account type name includes 'accounts payable'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounts_receivable": {"name": "is_accounts_receivable", "description": "Yes/No field indicating whether or not the account type name includes 'accounts receivable'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_account_intercompany": {"name": "is_account_intercompany", "description": "Yes/No field indicating whether or not the account type name includes 'intercompany'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_account_name": {"name": "parent_account_name", "description": "Name of the parent account, if parent account relationship exists. Otherwise, the name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_income_account": {"name": "is_income_account", "description": "Yes/No field indicating whether or not the account is an income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_expense_account": {"name": "is_expense_account", "description": "Yes/No field indicating whether or not the account is an expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company_name": {"name": "company_name", "description": "Name of the company.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_city": {"name": "customer_city", "description": "City where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_state": {"name": "customer_state", "description": "State where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_zipcode": {"name": "customer_zipcode", "description": "Zip Code of the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_country": {"name": "customer_country", "description": "Country where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_date_first_order": {"name": "customer_date_first_order", "description": "Date customer placed first order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_name": {"name": "item_name", "description": "Name of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_type_name": {"name": "item_type_name", "description": "Type name of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sales_description": {"name": "sales_description", "description": "Description of the item for sales purposes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_name": {"name": "location_name", "description": "Name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_city": {"name": "location_city", "description": "City used as a location reference.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_country": {"name": "location_country", "description": "Country used as a location reference.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_type_name": {"name": "vendor_type_name", "description": "Type name of the vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_name": {"name": "vendor_name", "description": "Name of the vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_create_date": {"name": "vendor_create_date", "description": "Date vendor was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_name": {"name": "currency_name", "description": "Name of the currency used.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_symbol": {"name": "currency_symbol", "description": "Symbol used to identify the currency type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_name": {"name": "department_name", "description": "Name of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subsidiary_name": {"name": "subsidiary_name", "description": "Name of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "converted_amount": {"name": "converted_amount", "description": "Transaction amount, converted into the primary subsidiary's default currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_amount": {"name": "transaction_amount", "description": "Total amount of the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/netsuite.yml", "build_path": "target/compiled/netsuite/models/netsuite__transaction_details.sql", "deferred": false, "unrendered_config": {"materialized": "table", "schema": "netsuite"}, "compiled_sql": "with __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n), \n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n), __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_books as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\n), \n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\nconsolidated_exchange_rates as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n), __dbt__CTE__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= CURRENT_TIMESTAMP() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n), __dbt__CTE__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__CTE__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n),transactions_with_converted_amounts as (\n select * \n from __dbt__CTE__int_netsuite__transactions_with_converted_amounts\n),\n\naccounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n),\n\naccounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\ntransactions as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n),\n\nincome_accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__income_accounts`\n),\n\nexpense_accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__expense_accounts`\n),\n\ncustomers as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__customers`\n),\n\nitems as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__items`\n),\n\nlocations as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__locations`\n),\n\nvendors as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendors`\n),\n\nvendor_types as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__vendor_types`\n),\n\ndepartments as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__departments`\n),\n\ncurrencies as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__currencies`\n),\n\ntransaction_details as (\n select\n transaction_lines.transaction_line_id,\n transaction_lines.memo as transaction_memo,\n lower(transaction_lines.non_posting_line) = 'yes' as is_transaction_non_posting,\n transactions.transaction_id,\n transactions.status as transaction_status,\n transactions.transaction_date,\n transactions.due_date_at as transaction_due_date,\n transactions.transaction_type as transaction_type,\n (lower(transactions.is_advanced_intercompany) = 'yes' or lower(transactions.is_intercompany) = 'yes') as is_transaction_intercompany,\n\n --The below script allows for transactions table pass through columns.\n \n\n --The below script allows for transaction lines table pass through columns.\n \n\n accounting_periods.ending_at as accounting_period_ending,\n accounting_periods.full_name as accounting_period_full_name,\n accounting_periods.name as accounting_period_name,\n lower(accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n accounts.name as account_name,\n accounts.type_name as account_type_name,\n accounts.account_id as account_id,\n accounts.account_number,\n\n --The below script allows for accounts table pass through columns.\n \n\n lower(accounts.is_leftside) = 't' as is_account_leftside,\n lower(accounts.type_name) like 'accounts payable%' as is_accounts_payable,\n lower(accounts.type_name) like 'accounts receivable%' as is_accounts_receivable,\n lower(accounts.name) like '%intercompany%' as is_account_intercompany,\n coalesce(parent_account.name, accounts.name) as parent_account_name,\n income_accounts.income_account_id is not null as is_income_account,\n expense_accounts.expense_account_id is not null as is_expense_account,\n customers.company_name,\n customers.city as customer_city,\n customers.state as customer_state,\n customers.zipcode as customer_zipcode,\n customers.country as customer_country,\n customers.date_first_order_at as customer_date_first_order,\n items.name as item_name,\n items.type_name as item_type_name,\n items.sales_description,\n locations.name as location_name,\n locations.city as location_city,\n locations.country as location_country,\n vendor_types.name as vendor_type_name,\n vendors.company_name as vendor_name,\n vendors.create_date_at as vendor_create_date,\n currencies.name as currency_name,\n currencies.symbol as currency_symbol,\n departments.name as department_name,\n\n --The below script allows for departments table pass through columns.\n \n\n subsidiaries.name as subsidiary_name,\n case\n when lower(accounts.type_name) = 'income' or lower(accounts.type_name) = 'other income' then -converted_amount_using_transaction_accounting_period\n else converted_amount_using_transaction_accounting_period\n end as converted_amount,\n case\n when lower(accounts.type_name) = 'income' or lower(accounts.type_name) = 'other income' then -transaction_lines.amount\n else transaction_lines.amount\n end as transaction_amount\n from transaction_lines\n\n join transactions\n on transactions.transaction_id = transaction_lines.transaction_id\n\n left join transactions_with_converted_amounts as transactions_with_converted_amounts\n on transactions_with_converted_amounts.transaction_line_id = transaction_lines.transaction_line_id\n and transactions_with_converted_amounts.transaction_id = transaction_lines.transaction_id\n and transactions_with_converted_amounts.transaction_accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n\n left join accounts \n on accounts.account_id = transaction_lines.account_id\n\n left join accounts as parent_account \n on parent_account.account_id = accounts.parent_id\n\n left join accounting_periods \n on accounting_periods.accounting_period_id = transactions.accounting_period_id\n left join income_accounts \n on income_accounts.income_account_id = accounts.account_id\n\n left join expense_accounts \n on expense_accounts.expense_account_id = accounts.account_id\n\n left join customers \n on customers.customer_id = transaction_lines.company_id\n\n left join items \n on items.item_id = transaction_lines.item_id\n\n left join locations \n on locations.location_id = transaction_lines.location_id\n\n left join vendors \n on vendors.vendor_id = transaction_lines.company_id\n\n left join vendor_types \n on vendor_types.vendor_type_id = vendors.vendor_type_id\n\n left join currencies \n on currencies.currency_id = transactions.currency_id\n\n left join departments \n on departments.department_id = transaction_lines.department_id\n\n join subsidiaries \n on subsidiaries.subsidiary_id = transaction_lines.subsidiary_id\n \n where (accounting_periods.fiscal_calendar_id is null\n or accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null))\n)\n\nselect *\nfrom transaction_details", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "sql": " __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n), \n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n)"}, {"id": "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "sql": " __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_books as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\n), \n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\nconsolidated_exchange_rates as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n)"}, {"id": "model.netsuite.int_netsuite__transaction_and_reporting_periods", "sql": " __dbt__CTE__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= CURRENT_TIMESTAMP() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n)"}, {"id": "model.netsuite.int_netsuite__transactions_with_converted_amounts", "sql": " __dbt__CTE__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__CTE__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n)"}], "relation_name": "`dbt-package-testing`.`netsuite_source_integration_tests_netsuite`.`netsuite__transaction_details`"}, "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map": {"raw_sql": "with accounts as (\n select * \n from {{ ref('stg_netsuite__accounts') }}\n), \n\naccounting_books as (\n select * \n from {{ ref('stg_netsuite__accounting_books') }}\n), \n\nsubsidiaries as (\n select * \n from {{ ref('stg_netsuite__subsidiaries') }}\n),\n\nconsolidated_exchange_rates as (\n select * \n from {{ ref('stg_netsuite__consolidated_exchange_rates') }}\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__accounting_books", "model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__consolidated_exchange_rates"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_netsuite", "fqn": ["netsuite", "intermediate", "int_netsuite__accountxperiod_exchange_rate_map"], "unique_id": "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "intermediate/int_netsuite__accountxperiod_exchange_rate_map.sql", "original_file_path": "models/intermediate/int_netsuite__accountxperiod_exchange_rate_map.sql", "name": "int_netsuite__accountxperiod_exchange_rate_map", "alias": "int_netsuite__accountxperiod_exchange_rate_map", "checksum": {"name": "sha256", "checksum": "d8e3d3a4eea92a89d1c873ebfebcdf6ce6b93499db8803b84700f25a44160b1d"}, "tags": [], "refs": [["stg_netsuite__accounts"], ["stg_netsuite__accounting_books"], ["stg_netsuite__subsidiaries"], ["stg_netsuite__consolidated_exchange_rates"]], "sources": [], "description": "(Step 1/4) In order to accurately recreate the balance sheet and income statement, it is necessary to convert all transaction amounts into the currency of the parent subsidiary. The logic gets complicated fast, mostly because of the behavior of the balance sheet. On the balance sheet, the conversion rate you use for a single transaction will differ by accounting period. For example, if a transaction took place in August, and you are generating balances for the December period, you will need to convert the August transaction using the December conversion rate.\nThe first step here is to create a mapping of all accounting periods and the respective exchange rates, by subsidiary. This is called period_exchange_rate_map\nNext, we cross join the accounts table to the period_exchange_rate_map, so we can generate a map of exchange rates, by account, accounting period, and subsidiary.\n", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "models/netsuite.yml", "build_path": "target/compiled/netsuite/models/intermediate/int_netsuite__accountxperiod_exchange_rate_map.sql", "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "netsuite"}, "compiled_sql": "with accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_books as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\n), \n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\nconsolidated_exchange_rates as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.netsuite.int_netsuite__transaction_lines_w_accounting_period": {"raw_sql": "with transactions as (\n select * \n from {{ ref('stg_netsuite__transactions') }}\n), \n\ntransaction_lines as (\n select * \n from {{ ref('stg_netsuite__transaction_lines') }}\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.netsuite_source.stg_netsuite__transactions", "model.netsuite_source.stg_netsuite__transaction_lines"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_netsuite", "fqn": ["netsuite", "intermediate", "int_netsuite__transaction_lines_w_accounting_period"], "unique_id": "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "intermediate/int_netsuite__transaction_lines_w_accounting_period.sql", "original_file_path": "models/intermediate/int_netsuite__transaction_lines_w_accounting_period.sql", "name": "int_netsuite__transaction_lines_w_accounting_period", "alias": "int_netsuite__transaction_lines_w_accounting_period", "checksum": {"name": "sha256", "checksum": "5e66312dc5e5d99350f94760ca44e3edeb8da21a5844078f65e102668a08cf57"}, "tags": [], "refs": [["stg_netsuite__transactions"], ["stg_netsuite__transaction_lines"]], "sources": [], "description": "(Step 2/4) Next, we need to prepare a cleaned version of all transactions we need. Using the transactions and transaction_lines tables, the necessary fields are extracted, and transactions that are deleted, revenue arrangements, or non-posting transactions are filtered out. This is called transaction_lines_w_accounting_period. \n", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "models/netsuite.yml", "build_path": "target/compiled/netsuite/models/intermediate/int_netsuite__transaction_lines_w_accounting_period.sql", "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "netsuite"}, "compiled_sql": "with transactions as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n), \n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.netsuite.int_netsuite__transaction_and_reporting_periods": {"raw_sql": "with accounting_periods as (\n select * \n from {{ ref('stg_netsuite__accounting_periods') }}\n),\n\nsubsidiaries as (\n select * \n from {{ ref('stg_netsuite__subsidiaries') }}\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= {{ current_timestamp() }} \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__subsidiaries"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_netsuite", "fqn": ["netsuite", "intermediate", "int_netsuite__transaction_and_reporting_periods"], "unique_id": "model.netsuite.int_netsuite__transaction_and_reporting_periods", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "intermediate/int_netsuite__transaction_and_reporting_periods.sql", "original_file_path": "models/intermediate/int_netsuite__transaction_and_reporting_periods.sql", "name": "int_netsuite__transaction_and_reporting_periods", "alias": "int_netsuite__transaction_and_reporting_periods", "checksum": {"name": "sha256", "checksum": "7260cfdc6e09fbde9badbc18024ddc2e00ad9b047cf5c778de16d02263140ec7"}, "tags": [], "refs": [["stg_netsuite__accounting_periods"], ["stg_netsuite__subsidiaries"]], "sources": [], "description": "(Step 3/4) Once we have the cleaned transaction_lines_w_accounting_periods, we now need to figure out which exchange rate we should use for the currency conversion. The balance sheet complicates things, as conversion rates vary based on the reporting period. Therefore, all transactions need to be converted not only for the period in which the transaction took place in, but also all subsequent periods. transaction_and_reporting_periods creates the necessary mapping for this.\n", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "models/netsuite.yml", "build_path": "target/compiled/netsuite/models/intermediate/int_netsuite__transaction_and_reporting_periods.sql", "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "netsuite"}, "compiled_sql": "with accounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= CURRENT_TIMESTAMP() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.netsuite.int_netsuite__transactions_with_converted_amounts": {"raw_sql": "with transaction_lines_w_accounting_period as (\n select * \n from {{ ref('int_netsuite__transaction_lines_w_accounting_period') }}\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from {{ ref('int_netsuite__accountxperiod_exchange_rate_map') }}\n), \n\ntransaction_and_reporting_periods as (\n select * \n from {{ ref('int_netsuite__transaction_and_reporting_periods') }}\n), \n\naccounts as (\n select * \n from {{ ref('stg_netsuite__accounts') }}\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "model.netsuite.int_netsuite__transaction_and_reporting_periods", "model.netsuite_source.stg_netsuite__accounts"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "netsuite_source_integration_tests_netsuite", "fqn": ["netsuite", "intermediate", "int_netsuite__transactions_with_converted_amounts"], "unique_id": "model.netsuite.int_netsuite__transactions_with_converted_amounts", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "intermediate/int_netsuite__transactions_with_converted_amounts.sql", "original_file_path": "models/intermediate/int_netsuite__transactions_with_converted_amounts.sql", "name": "int_netsuite__transactions_with_converted_amounts", "alias": "int_netsuite__transactions_with_converted_amounts", "checksum": {"name": "sha256", "checksum": "62dd7d1452f62028ed7038c76d25dea6144601e77886d05ce85dcef72950c441"}, "tags": [], "refs": [["int_netsuite__transaction_lines_w_accounting_period"], ["int_netsuite__accountxperiod_exchange_rate_map"], ["int_netsuite__transaction_and_reporting_periods"], ["stg_netsuite__accounts"]], "sources": [], "description": "(Step 4/4) Now that we have the exchange rates and the unconverted amounts, the next step is to calculate the converted total. Additionally, we add in a couple of extra fields that will help us in our final balance sheet and income statement queries.\n", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "models/netsuite.yml", "build_path": "target/compiled/netsuite/models/intermediate/int_netsuite__transactions_with_converted_amounts.sql", "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "netsuite"}, "compiled_sql": "with __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n), \n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n), __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_books as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\n), \n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\nconsolidated_exchange_rates as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n), __dbt__CTE__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= CURRENT_TIMESTAMP() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n),transaction_lines_w_accounting_period as (\n select * \n from __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__CTE__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "sql": " __dbt__CTE__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transactions`\n), \n\ntransaction_lines as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__transaction_lines`\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n)"}, {"id": "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "sql": " __dbt__CTE__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounts`\n), \n\naccounting_books as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_books`\n), \n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\nconsolidated_exchange_rates as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__consolidated_exchange_rates`\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n)"}, {"id": "model.netsuite.int_netsuite__transaction_and_reporting_periods", "sql": " __dbt__CTE__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__accounting_periods`\n),\n\nsubsidiaries as (\n select * \n from `dbt-package-testing`.`netsuite_source_integration_tests_stg_netsuite`.`stg_netsuite__subsidiaries`\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= CURRENT_TIMESTAMP() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n)"}], "relation_name": null}}, "sources": {"source.netsuite_source.netsuite.accounting_books": {"fqn": ["netsuite_source", "netsuite", "accounting_books"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.accounting_books", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "accounting_books", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "accounting_books", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all accounting books set up in Netsuite.", "columns": {"accounting_book_id": {"name": "accounting_book_id", "description": "The unique identifier of the accounting book.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_primary": {"name": "is_primary", "description": "Boolean indicating whether it is a primary accounting book.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`accounting_books`"}, "source.netsuite_source.netsuite.accounting_periods": {"fqn": ["netsuite_source", "netsuite", "accounting_periods"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.accounting_periods", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "accounting_periods", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "accounting_periods", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all accounting periods, including monthly, quarterly and yearly.", "columns": {"accounting_period_id": {"name": "accounting_period_id", "description": "The unique identifier of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_id": {"name": "year_id", "description": "The year id the accounting period is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fiscal_calendar_id": {"name": "fiscal_calendar_id", "description": "The fiscal calendar id the accounting period is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quarter": {"name": "quarter", "description": "The quarter which the accounting period takes place in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "starting": {"name": "starting", "description": "The timestamp indicating the start of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ending": {"name": "ending", "description": "The timestamp indicating the end of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_0": {"name": "year_0", "description": "Value indicating whether the accounting period is in it's initial year.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_adjustment": {"name": "is_adjustment", "description": "Value indicating whether the accounting period is an adjustment (either yes or no).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Value indicating whether the accounting period is closed (either yes or no).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`accounting_periods`"}, "source.netsuite_source.netsuite.accounts": {"fqn": ["netsuite_source", "netsuite", "accounts"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "accounts", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "accounts", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table that provides a complete listing of every account in the accounting system.", "columns": {"account_id": {"name": "account_id", "description": "The unique identifier associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The accounts associated parent account id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type_name": {"name": "type_name", "description": "The name of the type of the account (ie. Bank, Equity, Income, Expense).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accountingnumber": {"name": "accountingnumber", "description": "The account number associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "general_rate_type": {"name": "general_rate_type", "description": "The general rate type of the account (Current, Historical, Average).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_leftside": {"name": "is_leftside", "description": "Value indicating whether the account is on the leftside (debit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_balancesheet": {"name": "is_balancesheet", "description": "Value indicating whether the account is a balance sheet account.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`accounts`"}, "source.netsuite_source.netsuite.classes": {"fqn": ["netsuite_source", "netsuite", "classes"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.classes", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "classes", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "classes", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all classes set up in Netsuite.", "columns": {"class_id": {"name": "class_id", "description": "The unique identifier of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`classes`"}, "source.netsuite_source.netsuite.consolidated_exchange_rates": {"fqn": ["netsuite_source", "netsuite", "consolidated_exchange_rates"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.consolidated_exchange_rates", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "consolidated_exchange_rates", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "consolidated_exchange_rates", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing average, historical and current exchange rates for all accounting periods.", "columns": {"accounting_book_id": {"name": "accounting_book_id", "description": "The accounting book the consolidated exchange rate is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_id": {"name": "accounting_period_id", "description": "The accounting period the consolidated exchange rate is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "average_rate": {"name": "average_rate", "description": "The consolidated exchange rates average rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "current_rate": {"name": "current_rate", "description": "The consolidated exchange rates current rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "historical_rate": {"name": "historical_rate", "description": "The consolidated exchange rates historical rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_subsidiary_id": {"name": "from_subsidiary_id", "description": "The subsidiary id which the consolidated exchange rate is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_subsidiary_id": {"name": "to_subsidiary_id", "description": "THe subsidiary id which the consolidated exchange rate is for.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`consolidated_exchange_rates`"}, "source.netsuite_source.netsuite.currencies": {"fqn": ["netsuite_source", "netsuite", "currencies"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.currencies", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "currencies", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "currencies", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "The names and symbols for all currencies set up in Netsuite.", "columns": {"currency_id": {"name": "currency_id", "description": "The unique identifier of the currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "symbol": {"name": "symbol", "description": "The currency's three letter symbol (ie. USD, EUR, CAD).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`currencies`"}, "source.netsuite_source.netsuite.customers": {"fqn": ["netsuite_source", "netsuite", "customers"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.customers", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "customers", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "customers", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all customer information.", "columns": {"customer_id": {"name": "customer_id", "description": "The unique identifier of the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "companyname": {"name": "companyname", "description": "The name of the company.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zipcode": {"name": "zipcode", "description": "The zipcode of the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The country where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_first_order": {"name": "date_first_order", "description": "The timestamp of the customers first order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`customers`"}, "source.netsuite_source.netsuite.departments": {"fqn": ["netsuite_source", "netsuite", "departments"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.departments", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "departments", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "departments", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all departments set up in Netsuite.", "columns": {"department_id": {"name": "department_id", "description": "The unique identifier of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The department's full name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`departments`"}, "source.netsuite_source.netsuite.expense_accounts": {"fqn": ["netsuite_source", "netsuite", "expense_accounts"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.expense_accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "expense_accounts", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "expense_accounts", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all expense accounts.", "columns": {"expense_account_id": {"name": "expense_account_id", "description": "The unique identifier of the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The expense account's associated parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "The account number associated with the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`expense_accounts`"}, "source.netsuite_source.netsuite.income_accounts": {"fqn": ["netsuite_source", "netsuite", "income_accounts"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.income_accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "income_accounts", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "income_accounts", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all income accounts.", "columns": {"income_account_id": {"name": "income_account_id", "description": "The unique identifier of the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The income account's associated parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "The account number associated with the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`income_accounts`"}, "source.netsuite_source.netsuite.items": {"fqn": ["netsuite_source", "netsuite", "items"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.items", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "items", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "items", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing information about the items created in Netsuite.", "columns": {"item_id": {"name": "item_id", "description": "The unique identifier of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type_name": {"name": "type_name", "description": "The type of the item (ie. Markup, Service, Discount).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "salesdescription": {"name": "salesdescription", "description": "The items sales description.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`items`"}, "source.netsuite_source.netsuite.locations": {"fqn": ["netsuite_source", "netsuite", "locations"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.locations", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "locations", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "locations", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all locations, including store, warehouse and office locations.", "columns": {"location_id": {"name": "location_id", "description": "The unique identifier of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The location's name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The location's city.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The location's country.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`locations`"}, "source.netsuite_source.netsuite.subsidiaries": {"fqn": ["netsuite_source", "netsuite", "subsidiaries"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.subsidiaries", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "subsidiaries", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "subsidiaries", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all subsidiaries.", "columns": {"subsidiary_id": {"name": "subsidiary_id", "description": "The unique identifier of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fiscal_calendar_id": {"name": "fiscal_calendar_id", "description": "The fiscal calendar id associated with the fiscal calendar the subsidiary is on.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The parent subsidiary id which the subsidiary is under.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`subsidiaries`"}, "source.netsuite_source.netsuite.transaction_lines": {"fqn": ["netsuite_source", "netsuite", "transaction_lines"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.transaction_lines", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "transaction_lines", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "transaction_lines", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "A table detailing all transaction lines for all transactions.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The transaction id which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_line_id": {"name": "transaction_line_id", "description": "The unique identifier of the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subsidiary_id": {"name": "subsidiary_id", "description": "The subsidiary id of the subsidiary which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The account id of the account linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company_id": {"name": "company_id", "description": "The company id of the company linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_id": {"name": "item_id", "description": "The item id of the item which is included in the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "non_posting_line": {"name": "non_posting_line", "description": "Value indicating whether the transaction line is a non posting line (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_id": {"name": "class_id", "description": "The class id of the class which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The location id of the location which the transaction line took place.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_id": {"name": "department_id", "description": "The department id of the department linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "memo": {"name": "memo", "description": "The memo attached to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`transaction_lines`"}, "source.netsuite_source.netsuite.transactions": {"fqn": ["netsuite_source", "netsuite", "transactions"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.transactions", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "transactions", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "transactions", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "A table detailing all transactions.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The unique identifier of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction (ie. Paid In Full, Open, Cancelled).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trandate": {"name": "trandate", "description": "The timestamp of the transaction date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_id": {"name": "currency_id", "description": "The currency id of the currency used in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_id": {"name": "accounting_period_id", "description": "The accounting period id of the accounting period which the transaction took place in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "The timestamp of the transaction due date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_type": {"name": "transaction_type", "description": "The transaction type (ie. Bill, Check, Deposit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_intercompany": {"name": "is_intercompany", "description": "Value indicating whether the transaction is intercompany (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_advanced_intercompany": {"name": "is_advanced_intercompany", "description": "Value indicating whether the transaction is an advanced intercompany journal entry (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`transactions`"}, "source.netsuite_source.netsuite.vendor_types": {"fqn": ["netsuite_source", "netsuite", "vendor_types"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.vendor_types", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "vendor_types", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "vendor_types", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "A table detailing all the various types of vendors.", "columns": {"vendor_type_id": {"name": "vendor_type_id", "description": "The unique identifier of the vendor type", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the vendor type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`vendor_types`"}, "source.netsuite_source.netsuite.vendors": {"fqn": ["netsuite_source", "netsuite", "vendors"], "database": "dbt-package-testing", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.vendors", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "vendors", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "vendors", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "A table detailing all vendor information.", "columns": {"vendor_id": {"name": "vendor_id", "description": "The unique identifier of the vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_type_id": {"name": "vendor_type_id", "description": "The vendor type the vendor is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "companyname": {"name": "companyname", "description": "The vendor's company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "The timestamp of the date the vendor was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`netsuite`.`vendors`"}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\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_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, sql) -%}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set raw_cluster_by = config.get('cluster_by', none) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {{ partition_by(partition_config) }}\n {{ cluster_by(raw_cluster_by) }}\n {{ bigquery_table_options(config, model, temporary) }}\n as (\n {{ sql }}\n );\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__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\n create or replace view {{ relation }}\n {{ bigquery_table_options(config, model, temporary=false) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_schema", "macro_sql": "{% macro bigquery__create_schema(relation) -%}\n {{ adapter.create_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.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_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() -%}\n CURRENT_TIMESTAMP()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__snapshot_string_as_time", "macro_sql": "{% macro bigquery__snapshot_string_as_time(timestamp) -%}\n {%- set result = 'TIMESTAMP(\"' ~ timestamp ~ '\")' -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do 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_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.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_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\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_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view(run_outside_transaction_hooks=False) %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\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_bigquery.make_date_partitioned_table": {"unique_id": "macro.dbt_bigquery.make_date_partitioned_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "make_date_partitioned_table", "macro_sql": "{% macro make_date_partitioned_table(model, relation, dates, should_create, verbose=False) %}\n\n {% if should_create %}\n {{ adapter.make_date_partitioned_table(relation) }}\n {% endif %}\n\n {% for date in dates %}\n {% set date = (date | string) %}\n {% if verbose %}\n {% set table_start_time = modules.datetime.datetime.now().strftime(\"%H:%M:%S\") %}\n {{ log(table_start_time ~ ' | -> Running for day ' ~ date, info=True) }}\n {% endif %}\n\n {% set fixed_sql = model['compiled_sql'] | replace('[DBT__PARTITION_DATE]', date) %}\n {% set _ = adapter.execute_model(model, 'table', fixed_sql, decorator=date) %}\n {% endfor %}\n\n {% set num_days = dates | length %}\n {% if num_days == 1 %}\n {% set result_str = 'CREATED 1 PARTITION' %}\n {% else %}\n {% set result_str = 'CREATED ' ~ num_days ~ ' PARTITIONS' %}\n {% endif %}\n\n {{ store_result('main', response=result_str) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n {%- set verbose = config.get('verbose', False) -%}\n\n {# partitions: iterate over each partition, running a separate query in a for-loop #}\n {%- set partitions = config.get('partitions') -%}\n\n {% if partitions %}\n {% if partitions is number or partitions is string %}\n {% set partitions = [(partitions | string)] %}\n {% endif %}\n\n {% if partitions is not iterable %}\n {{ exceptions.raise_compiler_error(\"Provided `partitions` configuration is not a list. Got: \" ~ partitions, model) }}\n {% endif %}\n {% endif %}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n Since dbt uses WRITE_TRUNCATE mode for tables, we only need to drop this thing\n if it is not a table. If it _is_ already a table, then we can overwrite it without downtime\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {% if partitions %}\n {# Create the dp-table if 1. it does not exist or 2. it existed, but we just dropped it #}\n {%- set should_create = (old_relation is none or exists_not_as_table) -%}\n {{ make_date_partitioned_table(model, target_relation, partitions, should_create, verbose) }}\n {% else %}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\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_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {# there should be exactly one ref or exactly one source #}\n {% set destination = this.incorporate(type='table') %}\n\n {% set dependency_type = none %}\n {% if (model.refs | length) == 1 and (model.sources | length) == 0 %}\n {% set dependency_type = 'ref' %}\n {% elif (model.refs | length) == 0 and (model.sources | length) == 1 %}\n {% set dependency_type = 'source' %}\n {% else %}\n {% set msg %}\n Expected exactly one ref or exactly one source, instead got {{ model.refs | length }} models and {{ model.sources | length }} sources.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n\n {% if dependency_type == 'ref' %}\n {% set src = ref(*model.refs[0]) %}\n {% else %}\n {% set src = source(*model.sources[0]) %}\n {% endif %}\n\n {%- set result_str = adapter.copy_table(\n src,\n destination,\n config.get('copy_materialization', 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_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', 'insert_overwrite'\n {%- endset %}\n {% if strategy not in ['merge', 'insert_overwrite'] %}\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_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n declare _dbt_max_partition {{ partition_by.data_type }};\n\n set _dbt_max_partition = (\n select max({{ partition_by.field }}) from {{ this }}\n );\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\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_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {{ run_hooks(pre_hooks) }}\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 {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% else %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation,\n target_relation,\n sql,\n unique_key,\n partition_by,\n partitions,\n dest_columns) %}\n\n {% else %}\n {#-- wrap sql in parens to make it a subquery --#}\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\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_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n ;\n{% endmacro %}", "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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/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 \"invalidate_hard_deletes\": invalidate_hard_deletes\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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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['compiled_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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \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 (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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['compiled_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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ 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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch(\"handle_existing_table\", packages=['dbt'])(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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('generate_database_name')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('get_catalog')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('list_schemas')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('list_relations_without_caching')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__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_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 {% set macro = adapter.dispatch('test_relationships') %}\n {{ macro(model, to, field, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__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_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 {% set macro = adapter.dispatch('test_not_null') %}\n {{ macro(model, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__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_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 {% set macro = adapter.dispatch('test_unique') %}\n {{ macro(model, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__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.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 {% set macro = adapter.dispatch('test_accepted_values') %}\n {{ macro(model, values, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', packages = dbt_utils._get_utils_namespaces())()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', packages = dbt_utils._get_utils_namespaces()) (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', packages = dbt_utils._get_utils_namespaces())(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.alternative_concat": {"unique_id": "macro.dbt_utils.alternative_concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "alternative_concat", "macro_sql": "{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__concat": {"unique_id": "macro.dbt_utils.redshift__concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "redshift__concat", "macro_sql": "{% macro redshift__concat(fields) %}\n {{ dbt_utils.alternative_concat(fields) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__concat": {"unique_id": "macro.dbt_utils.snowflake__concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "snowflake__concat", "macro_sql": "{% macro snowflake__concat(fields) %}\n {{ dbt_utils.alternative_concat(fields) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', packages = dbt_utils._get_utils_namespaces()) (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', packages = dbt_utils._get_utils_namespaces())(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', packages = dbt_utils._get_utils_namespaces())()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', packages = dbt_utils._get_utils_namespaces()) (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', packages = dbt_utils._get_utils_namespaces())(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', packages = dbt_utils._get_utils_namespaces()) (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', packages = dbt_utils._get_utils_namespaces()) (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', packages = dbt_utils._get_utils_namespaces()) (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__cast_bool_to_text": {"unique_id": "macro.dbt_utils.default__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__cast_bool_to_text": {"unique_id": "macro.dbt_utils.redshift__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "redshift__cast_bool_to_text", "macro_sql": "{% macro redshift__cast_bool_to_text(field) %}\n case\n when {{ field }} is true then 'true'\n when {{ field }} is false then 'false'\n end::text\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\t\n {%- set error_message = '\n Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \\\n Use `adapter.quote` instead. The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {{ return(adapter.dispatch('identifier', packages = dbt_utils._get_utils_namespaces()) (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\t\n \"{{ value }}\"\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\t\n `{{ value }}`\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', packages = dbt_utils._get_utils_namespaces()) (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', packages = dbt_utils._get_utils_namespaces()) (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ return(adapter.dispatch('current_timestamp', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() -%}\n {{ return(adapter.dispatch('current_timestamp_in_utc', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.default__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.snowflake__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.postgres__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', packages = dbt_utils._get_utils_namespaces()) (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils._get_utils_namespaces": {"unique_id": "macro.dbt_utils._get_utils_namespaces", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_get_utils_namespaces.sql", "original_file_path": "macros/cross_db_utils/_get_utils_namespaces.sql", "name": "_get_utils_namespaces", "macro_sql": "{% macro _get_utils_namespaces() %}\n {% set override_namespaces = var('dbt_utils_dispatch_list', []) %}\n {% do return(override_namespaces + ['dbt_utils']) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', packages = dbt_utils._get_utils_namespaces()) (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd('month', '3', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', packages = dbt_utils._get_utils_namespaces()) (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', packages = dbt_utils._get_utils_namespaces()) (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "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{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_is_ephemeral.sql", "original_file_path": "macros/cross_db_utils/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n {{ return(adapter.dispatch('get_period_boundaries', packages = dbt_utils._get_utils_namespaces())(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_boundaries", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n {{ return(adapter.dispatch('get_period_sql', packages = dbt_utils._get_utils_namespaces())(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_sql", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.materialization_insert_by_period_default": {"unique_id": "macro.dbt_utils.materialization_insert_by_period_default", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "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 result = load_result('main-' ~ i) %}\n {% if 'response' in result.keys() %} {# added in v0.19.0 #}\n {% set rows_inserted = result['response']['rows_affected'] %}\n {% else %} {# older versions #}\n {% set rows_inserted = result['status'].split(\" \")[2] | int %}\n {% endif %}\n \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('main', status_string) -%}\n -- no-op\n {%- endcall %}\n\n -- Return the relations created in this materialization\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_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/logger/pretty_log_format.sql", "original_file_path": "macros/logger/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', packages = dbt_utils._get_utils_namespaces())(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/logger/pretty_log_format.sql", "original_file_path": "macros/logger/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/logger/pretty_time.sql", "original_file_path": "macros/logger/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', packages = dbt_utils._get_utils_namespaces())(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/logger/pretty_time.sql", "original_file_path": "macros/logger/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/logger/log_info.sql", "original_file_path": "macros/logger/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', packages = dbt_utils._get_utils_namespaces())(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/logger/log_info.sql", "original_file_path": "macros/logger/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', packages = dbt_utils._get_utils_namespaces())(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', packages = dbt_utils._get_utils_namespaces())(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', packages = dbt_utils._get_utils_namespaces())(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% macro test_fewer_rows_than(model) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', packages = dbt_utils._get_utils_namespaces())(model, combination_of_columns, quote_columns, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model) %}\n\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\n\nwith a as (\n\n select count(*) as count_ourmodel from {{ model }}\n\n),\nb as (\n\n select count(*) as count_comparisonmodel from {{ compare_model }}\n\n),\ncounts as (\n\n select\n (select count_ourmodel from a) as count_model_with_fewer_rows,\n (select count_comparisonmodel from b) as count_model_with_more_rows\n\n),\nfinal as (\n\n select\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_model_with_fewer_rows > count_model_with_more_rows then (count_model_with_fewer_rows - count_model_with_more_rows)\n -- fail the test if they are the same number\n when count_model = count_comparison then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect row_count_delta from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% macro test_equal_rowcount(model) %}\n {{ return(adapter.dispatch('test_equal_rowcount', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% macro test_relationships_where(model, to, field) %}\n {{ return(adapter.dispatch('test_relationships_where', packages = dbt_utils._get_utils_namespaces())(model, to, field, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n{% set from_condition = kwargs.get('from_condition', \"1=1\") %}\n{% set to_condition = kwargs.get('to_condition', \"1=1\") %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "test_recency", "macro_sql": "{% macro test_recency(model, datepart, interval) %}\n {{ return(adapter.dispatch('test_recency', packages = dbt_utils._get_utils_namespaces())(model, datepart, interval, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% macro test_not_constant(model) %}\n {{ return(adapter.dispatch('test_not_constant', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__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 {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count(distinct {{ column_name }}) as filler_column\n\n from {{ model }}\n\n having count(distinct {{ column_name }}) = 1\n\n ) validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% macro test_accepted_range(model, min_value = none, max_value = none, inclusive = true, where = \"true\") %}\n\n{%- set column_name = kwargs.get('column_name', kwargs.get('field')) -%}\n\nwith meet_condition as(\n select {{ column_name }} \n from {{ model }}\n where {{ where }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where \n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2 \n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }} \n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% macro test_not_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 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)\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_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "test_unique_where", "macro_sql": "{% macro test_unique_where(model) %}\r\n {{ return(adapter.dispatch('test_unique_where', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "default__test_unique_where", "macro_sql": "{% macro default__test_unique_where(model) %}\r\n\r\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\r\n{% set where = kwargs.get('where', kwargs.get('arg')) %}\r\n\r\nselect count(*)\r\nfrom (\r\n\r\n select\r\n {{ column_name }}\r\n\r\n from {{ model }}\r\n where {{ column_name }} is not null\r\n {% if where %} and {{ where }} {% endif %}\r\n group by {{ column_name }}\r\n having count(*) > 1\r\n\r\n) validation_errors\r\n\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% macro test_at_least_one(model) %}\n {{ return(adapter.dispatch('test_at_least_one', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\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_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% macro test_unique_combination_of_columns(model, quote_columns = false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', packages = dbt_utils._get_utils_namespaces())(model, quote_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, quote_columns = false) %}\n\n{%- set columns = kwargs.get('combination_of_columns', kwargs.get('arg')) %}\n\n{% if not quote_columns %}\n {%- set column_list=columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect count(*)\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% macro test_cardinality_equality(model, to, field) %}\n\n {{ return(adapter.dispatch('test_cardinality_equality', packages = dbt_utils._get_utils_namespaces())(model, to, field, **kwargs)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, to, field) %}\n\n{# T-SQL doesn't let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\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 {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% macro test_expression_is_true(model, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', packages = dbt_utils._get_utils_namespaces())(model, condition, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, condition) %}\n\n{% set expression = kwargs.get('expression', kwargs.get('arg')) %}\n{% set column_name = kwargs.get('column_name') %}\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 {% if column_name is none %}\n where not({{ expression }})\n {%- else %}\n where not({{ column_name }} {{ expression }})\n {%- endif %}\n\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% macro test_sequential_values(model, column_name, interval=1, datepart=None) %}\n\n {{ return(adapter.dispatch('test_sequential_values', packages=dbt_utils._get_utils_namespaces())(model, column_name, interval, datepart, **kwargs)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval, datepart) %}\n\nwith windowed as (\n\n select\n {{ column_name }},\n lag({{ column_name }}) over (\n order by {{ column_name }}\n ) as previous_{{ column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, 'previous_' + column_name) }} as {{ dbt_utils.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = previous_{{ column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect\n count(*)\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "test_not_null_where", "macro_sql": "{% macro test_not_null_where(model) %}\r\n {{ return(adapter.dispatch('test_not_null_where', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_not_null_where": {"unique_id": "macro.dbt_utils.default__test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "default__test_not_null_where", "macro_sql": "{% macro default__test_not_null_where(model) %}\r\n\r\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\r\n{% set where = kwargs.get('where', kwargs.get('arg')) %}\r\n\r\nselect count(*)\r\nfrom {{ model }}\r\nwhere {{ column_name }} is null\r\n{% if where %} and {{ where }} {% endif %}\r\n\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "test_equality", "macro_sql": "{% macro test_equality(model) %}\n {{ return(adapter.dispatch('test_equality', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__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\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n{%- set compare_columns = kwargs.get('compare_columns', None) -%}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% macro test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', packages = dbt_utils._get_utils_namespaces())(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }},\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 {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect count(*) from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', packages = dbt_utils._get_utils_namespaces())(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', packages = dbt_utils._get_utils_namespaces())(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', packages = dbt_utils._get_utils_namespaces())(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', packages = dbt_utils._get_utils_namespaces())(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', packages = dbt_utils._get_utils_namespaces())(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', packages = dbt_utils._get_utils_namespaces())(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', packages = dbt_utils._get_utils_namespaces())(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', packages = dbt_utils._get_utils_namespaces())(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[]) -%}\n {{ return(adapter.dispatch('star', packages = dbt_utils._get_utils_namespaces())(from, relation_alias, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(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\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 -%}{{ adapter.quote(col)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "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 {{ return(adapter.dispatch('unpivot', packages = dbt_utils._get_utils_namespaces())(relation, cast_to, exclude, remove, field_name, value_name, table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if table %}\n {%- set error_message = '\n Warning: the `unpivot` macro no longer accepts a `table` parameter. \\\n This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead. \\\n The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\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 {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n 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( {% if col.data_type == 'boolean' %}\n {{ dbt_utils.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n {{ return(adapter.dispatch('union_relations', packages = dbt_utils._get_utils_namespaces())(relations, column_override, include, exclude, source_column_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column 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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', packages = dbt_utils._get_utils_namespaces())(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', packages = dbt_utils._get_utils_namespaces())(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- if varargs|length >= 1 or field_list is string %}\n\n{%- set error_message = '\nWarning: the `surrogate_key` macro now takes a single list argument instead of \\\nmultiple string arguments. Support for multiple string arguments will be \\\ndeprecated in a future release of dbt-utils. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{# first argument is not included in varargs, so add first element to field_list_xf #}\n{%- set field_list_xf = [field_list] -%}\n\n{%- for field in varargs %}\n{%- set _ = field_list_xf.append(field) -%}\n{%- endfor -%}\n\n{%- else -%}\n\n{# if using list, just set field_list_xf as field_list #}\n{%- set field_list_xf = field_list -%}\n\n{%- endif -%}\n\n\n{%- set fields = [] -%}\n\n{%- for field in field_list_xf -%}\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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add() -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('safe_add', packages = dbt_utils._get_utils_namespaces())(*varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', packages = dbt_utils._get_utils_namespaces())(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', packages = dbt_utils._get_utils_namespaces())\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n case table_type\n when 'BASE TABLE' then 'table'\n else lower(table_type)\n end as table_type\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, max_records=none, default=none) -%}\n {{ return(adapter.dispatch('get_column_values', packages = dbt_utils._get_utils_namespaces())(table, column, max_records, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "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 distinct=False) %}\n {{ return(adapter.dispatch('pivot', packages = dbt_utils._get_utils_namespaces())(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for v in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', packages = dbt_utils._get_utils_namespaces())(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', packages = dbt_utils._get_utils_namespaces())(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(pow((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n pow((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(pow(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n pow(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_expense_accounts_columns": {"unique_id": "macro.netsuite_source.get_expense_accounts_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_expense_accounts_columns.sql", "original_file_path": "macros/get_expense_accounts_columns.sql", "name": "get_expense_accounts_columns", "macro_sql": "{% macro get_expense_accounts_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"account_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"comments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"current_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"desription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"expense_account_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_including_child_subs\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_summary\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"legal_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_accounts_columns": {"unique_id": "macro.netsuite_source.get_accounts_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_accounts_columns.sql", "original_file_path": "macros/get_accounts_columns.sql", "name": "get_accounts_columns", "macro_sql": "{% macro get_accounts_columns() %}\n\n{% set columns = [\n {\"name\": \"account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"accountnumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"general_rate_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_balancesheet\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_leftside\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"type_name\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_classes_columns": {"unique_id": "macro.netsuite_source.get_classes_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_classes_columns.sql", "original_file_path": "macros/get_classes_columns.sql", "name": "get_classes_columns", "macro_sql": "{% macro get_classes_columns() %}\n\n{% set columns = [\n {\"name\": \"class_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_items_columns": {"unique_id": "macro.netsuite_source.get_items_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_items_columns.sql", "original_file_path": "macros/get_items_columns.sql", "name": "get_items_columns", "macro_sql": "{% macro get_items_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"allow_drop_ship\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"alt_demand_source_item_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"asset_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"atp_lead_time\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"atp_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"available_to_partners\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"avatax_taxcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"averagecost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"backward_consumption_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"bill_com_last_updated_by_impo\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bill_exch_rate_var_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"bill_price_variance_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"bill_qty_variance_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"build_sub_assemblies\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"class_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"code_of_supply_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"commodity_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"consumption_unit_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"cost_0\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"cost_category\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"cost_estimate_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"costing_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"country_of_manufacture\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_plan_on_event_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"created\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"current_on_order_count\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"custreturn_variance_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_of_last_transaction\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"default_return_cost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"deferred_expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"deferred_revenue_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"demand_source\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"demand_time_fence\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"department_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"deposit\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"displayname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"distribution_category\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"distribution_network\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"dropship_expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"effective_bom_control_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"featureddescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"featureditem\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fixed_lot_size\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"forward_consumption_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"fraud_risk\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fx_adjustment_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"gain_loss_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"handling_cost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"hazmat\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hazmat_hazard_class\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hazmat_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hazmat_item_units\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hazmat_item_units_qty\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"hazmat_packing_group\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hazmat_shipping_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"include_child_subsidiaries\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"income_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"interco_expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"interco_income_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"invt_count_classification\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"invt_count_interval\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"is_cont_rev_handling\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_enforce_min_qty_internally\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_hold_rev_rec\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_moss\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_phantom\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_special_order_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isonline\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"istaxable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"item_defined_cost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"item_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"item_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"item_image\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"item_revenue_category\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"item_term_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"last_cogs_correction\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"last_invt_count_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"last_purchase_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"lot_numbered_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lot_sizing_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"manufacturer\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"manufacturing_charge_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"match_bill_to_receipt\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"matrix_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"maximum_quantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"minimum_quantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"mpn\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"nature_of_transaction_codes_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"next_invt_count_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"ng_asset_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"ns_lead_time\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"offersupport\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"onspecial\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"overhead_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"payment_method_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"periodic_lot_size_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"periodic_lot_size_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"pref_purchase_tax_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"pref_sale_tax_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"pref_stock_level\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"prices_include_tax\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"pricing_group_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"print_sub_items\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"prod_price_var_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"prod_qty_var_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"prompt_payment_discount_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"purchase_price_var_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchase_unit_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchasedescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"purchaseorderamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"quantityavailable\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"quantitybackordered\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"quantityonhand\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"reorder_multiple\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"reorderpoint\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"replenishment_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"resalable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reschedule_in_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"reschedule_out_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"rev_rec_forecast_rule_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"rev_rec_rule_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"revenue_allocation_group\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"round_up_as_component\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"safety_stock_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"safety_stock_level\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"sale_unit_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"salesdescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"salesforce_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"salesprice\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"scrap_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"serialized_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shippingcost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"special_work_order_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"specialsdescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"stock_unit_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"storedescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"storedetaileddescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"storedisplayname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subtype\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"supplementary_unit__abberviat\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"supplementary_unit_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"supply_time_fence\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"supply_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_item_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"totalvalue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transferprice\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"type_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"type_of_goods_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"udf1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"udf2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"un_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unbuild_variance_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"units_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"upc_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_component_yield\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vendorname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendreturn_variance_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vsoe_deferral\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vsoe_delivered\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vsoe_discount\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vsoe_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"weight\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"weight_in_user_defined_unit\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"weight_unit_index\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"wip_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"wip_cost_variance_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"work_order_lead_time\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_transaction_lines_columns": {"unique_id": "macro.netsuite_source.get_transaction_lines_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_transaction_lines_columns.sql", "original_file_path": "macros/get_transaction_lines_columns.sql", "name": "get_transaction_lines_columns", "macro_sql": "{% macro get_transaction_lines_columns() %}\n\n{% set columns = [\n {\"name\": \"account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"class_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"company_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"department_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"item_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"memo\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"non_posting_line\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transaction_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transaction_line_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_vendors_columns": {"unique_id": "macro.netsuite_source.get_vendors_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_vendors_columns.sql", "original_file_path": "macros/get_vendors_columns.sql", "name": "get_vendors_columns", "macro_sql": "{% macro get_vendors_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"account_owner\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accountnumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accounts_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"altemail\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"altphone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"annual_revenue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"assess_use_tax_on_billavatax\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"auto_renewals\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"auto_send_statements\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bill_com_customer_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bill_com_last_updated_by_impo\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bill_com_shortname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bill_com_vendor_info_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"bill_com_vendor_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billaddress\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_class_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"brn\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"comments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"companyname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"creditlimit\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"currency_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"dic\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_bill_payment_vouchers\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_cash_sales\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_credit_notes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_invoices\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_item_fulfilments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_purchase_orders\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_quotes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_sales_orders\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_statements\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"employee_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"exemption_certificate_no\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"fax\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"home_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hris_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ico\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id_number_in_the_country_of_r\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id_type_in_the_country_of_r_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"in_transit_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"incoterm\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"industry_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"invoice_via_procurement_syste\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"invoicing_details\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is1099eligible\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_partner\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_person\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isemailhtml\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isemailpdf\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"labor_cost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"last_sales_activity\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"line1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line3\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"loginaccess\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lsa_link\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lsa_link_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"mobile_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"msa_effective_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"no__of_employees\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"openbalance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"openbalance_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"payables_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"payment_terms_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"prepayment_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"printoncheckas\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"purchaseorderamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchases_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"receiptamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"represents_subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"restrict_access_to_expensify\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"salesforce_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipaddress\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subsidiary\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_contact_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_contact_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_contact_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_contact_middle_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxidnum\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"time_approver_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transactions_need_approval\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"uen\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unbilled_orders\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"unbilled_orders_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vat_registration_no\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vendor_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"zipcode\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_accounting_books_columns": {"unique_id": "macro.netsuite_source.get_accounting_books_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_accounting_books_columns.sql", "original_file_path": "macros/get_accounting_books_columns.sql", "name": "get_accounting_books_columns", "macro_sql": "{% macro get_accounting_books_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accounting_book_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accounting_book_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"accounting_book_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"base_book_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_created\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"effective_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"form_template_component_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"form_template_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"is_adjustment_only\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_arrangement_level_reclass\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_consolidated\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_contingent_revenue_handling\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_include_child_subsidiaries\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_primary\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_two_step_revenue_allocation\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unbilled_receivable_grouping\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_departments_columns": {"unique_id": "macro.netsuite_source.get_departments_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_departments_columns.sql", "original_file_path": "macros/get_departments_columns.sql", "name": "get_departments_columns", "macro_sql": "{% macro get_departments_columns() %}\n\n{% set columns = [\n {\"name\": \"department_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_transactions_columns": {"unique_id": "macro.netsuite_source.get_transactions_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_transactions_columns.sql", "original_file_path": "macros/get_transactions_columns.sql", "name": "get_transactions_columns", "macro_sql": "{% macro get_transactions_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"accounting_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"currency_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"due_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"is_advanced_intercompany\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_intercompany\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"trandate\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"transaction_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transaction_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_accounting_periods_columns": {"unique_id": "macro.netsuite_source.get_accounting_periods_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_accounting_periods_columns.sql", "original_file_path": "macros/get_accounting_periods_columns.sql", "name": "get_accounting_periods_columns", "macro_sql": "{% macro get_accounting_periods_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_id2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accounting_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"closed\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_accounts_payable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_accounts_receivable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_all\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_on\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"closed_payroll\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"ending\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"fiscal_calendar_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"fivetran_index\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_adjustment\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locked_accounts_payable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locked_accounts_receivable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locked_all\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locked_payroll\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"quarter\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"starting\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"year_0\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"year_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_consolidated_exchange_rates_columns": {"unique_id": "macro.netsuite_source.get_consolidated_exchange_rates_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_consolidated_exchange_rates_columns.sql", "original_file_path": "macros/get_consolidated_exchange_rates_columns.sql", "name": "get_consolidated_exchange_rates_columns", "macro_sql": "{% macro get_consolidated_exchange_rates_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accounting_book_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"accounting_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"average_budget_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"average_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consolidated_exchange_rate_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"current_budget_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"current_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"from_subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"historical_budget_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"historical_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"to_subsidiary_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_income_accounts_columns": {"unique_id": "macro.netsuite_source.get_income_accounts_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_income_accounts_columns.sql", "original_file_path": "macros/get_income_accounts_columns.sql", "name": "get_income_accounts_columns", "macro_sql": "{% macro get_income_accounts_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"account_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"comments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"current_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"desription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"income_account_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"income_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"is_including_child_subs\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_summary\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"legal_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_customers_columns": {"unique_id": "macro.netsuite_source.get_customers_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_customers_columns.sql", "original_file_path": "macros/get_customers_columns.sql", "name": "get_customers_columns", "macro_sql": "{% macro get_customers_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"account_owner\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accountnumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accounts_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"alcohol_recipient_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"allow_task_time_for_allocation\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"altemail\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"alternate_contact_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"altphone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"amount_complete\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"annual_revenue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"assess_use_tax_on_billavatax\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"auto_renewals\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"auto_send_statements\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bill_com_customer_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bill_com_last_updated_by_impo\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bill_com_shortname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bill_com_vendor_info_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"bill_com_vendor_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billaddress\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_rate_card_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"billing_schedule_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"billing_schedule_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_transaction_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"brn\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"calculated_end\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"category_0\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"comments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"companyname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"consol_days_overdue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_deposit_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_deposit_balance_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_openbalance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_openbalance_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_unbilled_orders\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_unbilled_orders_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"converted_to_contact_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"converted_to_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"cost_estimate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"credithold\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"creditlimit\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"currency_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"customer_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customer_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"customer_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_calculated_start\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_closed\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_convsersion\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_first_order\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_first_sale\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_gross_lead\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_order\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_sale\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_lead\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_prospect\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_scheduled_end\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"days_overdue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"default_order_priority\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"default_receivables_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"deposit_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"deposit_balance_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"dic\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_bill_payment_vouchers\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_cash_sales\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_credit_notes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_invoices\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_item_fulfilments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_purchase_orders\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_quotes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_sales_orders\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_statements\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"employee_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"exemption_certificate_no\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"expected_close\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"fax\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"first_sale_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"first_visit\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"firstname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"forecast_based_on_allocations\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"forecast_charge_run_on_demand\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"home_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hris_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ico\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id_number_in_the_country_of_r\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id_type_in_the_country_of_r_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"industry_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"invoice_via_procurement_syste\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"invoicing_details\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_exempt_time\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_explicit_conversion\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_job\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_limit_time_to_assignees\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_partner\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_person\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_productive_time\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_project_completely_billed\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_source_item_from_brc\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_utilized_time\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isemailhtml\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isemailpdf\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"istaxable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"job_end\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"job_start\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"job_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"labor_budget_from_allocations\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"language_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"last_sale_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"last_sales_activity\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"last_visit\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"lastname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lead_source_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"line1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line3\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"loginaccess\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lsa_link\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lsa_link_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"middlename\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"mobile_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"msa_effective_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"multiple_price_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"no__of_employees\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"openbalance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"openbalance_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"partner_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"payment_terms_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"primary_contact_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"print_on_check_as\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"probability\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"project_expense_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"project_manager_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"projected_end\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"purchases_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"referrer\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reminderdays\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"renewal\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"represents_subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"resalenumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"restrict_access_to_expensify\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"rev_rec_forecast_rule_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"rev_rec_forecast_template\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"revenue_estimate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"sales_rep_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"sales_territory_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"salesforce_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"salutation\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"scheduling_method_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ship_complete\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipaddress\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status_descr\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status_probability\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"status_read_only\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_contact_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_contact_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_contact_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_contact_middle_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_item_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"third_party_acct\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"third_party_carrier\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"third_party_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"third_party_zip_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"time_approval_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"top_level_parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transactions_need_approval\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"uen\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unbilled_orders\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"unbilled_orders_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_calculated_billing_budget\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_calculated_cost_budget\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_percent_complete_override\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vat_reg_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vat_registration_no\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"web_lead\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"zipcode\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_locations_columns": {"unique_id": "macro.netsuite_source.get_locations_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_locations_columns.sql", "original_file_path": "macros/get_locations_columns.sql", "name": "get_locations_columns", "macro_sql": "{% macro get_locations_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"address_one\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"address_three\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"address_two\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"addressee\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"attention\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bill_com_last_updated_by_impo\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"branch_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inventory_available\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inventory_available_web_store\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_include_in_supply_planning\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"pick_up\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_address_one\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_address_two\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_zipcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"returnaddress\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tran_num_prefix\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_bins\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"zipcode\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_vendor_types_columns": {"unique_id": "macro.netsuite_source.get_vendor_types_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_vendor_types_columns.sql", "original_file_path": "macros/get_vendor_types_columns.sql", "name": "get_vendor_types_columns", "macro_sql": "{% macro get_vendor_types_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vendor_type_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_type_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_subsidiaries_columns": {"unique_id": "macro.netsuite_source.get_subsidiaries_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_subsidiaries_columns.sql", "original_file_path": "macros/get_subsidiaries_columns.sql", "name": "get_subsidiaries_columns", "macro_sql": "{% macro get_subsidiaries_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"address1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"address2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"base_currency_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"branch_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"brn\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"edition\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"federal_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fiscal_calendar_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_elimination\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_moss\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive_bool\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"legal_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"moss_nexus_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"return_address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_address1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_address2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_zipcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_zipcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state_tax_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subnav__searchable_subsidiary\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"subsidiary_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"taxonomy_reference_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tran_num_prefix\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"uen\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"zipcode\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.netsuite_source.get_currencies_columns": {"unique_id": "macro.netsuite_source.get_currencies_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_currencies_columns.sql", "original_file_path": "macros/get_currencies_columns.sql", "name": "get_currencies_columns", "macro_sql": "{% macro get_currencies_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"currency_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"is_inactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"precision_0\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"symbol\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', packages = fivetran_utils._get_utils_namespaces()) (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', packages = fivetran_utils._get_utils_namespaces()) (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', packages = fivetran_utils._get_utils_namespaces()) (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', packages = fivetran_utils._get_utils_namespaces()) (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('datediff', packages = fivetran_utils._get_utils_namespaces())(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.postgres__datediff": {"unique_id": "macro.fivetran_utils.postgres__datediff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.generate_columns_macro": {"unique_id": "macro.fivetran_utils.generate_columns_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/generate_columns_macro.sql", "original_file_path": "macros/generate_columns_macro.sql", "name": "generate_columns_macro", "macro_sql": "{% macro generate_columns_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set columns = get_columns_for_macro(table_name, schema_name, database_name) %}\n\n{% set jinja_macro=[] %}\n\n{% do jinja_macro.append('{% macro get_' ~ table_name ~ '_columns() %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% set columns = [') %}\n\n{% for col in columns %}\n{% do jinja_macro.append(' ' ~ col ~ (',' if not loop.last)) %}\n{% endfor %}\n\n{% do jinja_macro.append('] %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{{ return(columns) }}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% endmacro %}') %}\n\n{% if execute %}\n\n {% set joined = jinja_macro | join ('\\n') %}\n {{ log(joined, info=True) }}\n {% do return(joined) %}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', packages = fivetran_utils._get_utils_namespaces()) (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias }) if column.alias else base_columns.append({ \"name\": column.name }) %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.staging_models_automation": {"unique_id": "macro.fivetran_utils.staging_models_automation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/staging_models_automation.sql", "original_file_path": "macros/staging_models_automation.sql", "name": "staging_models_automation", "macro_sql": "{% macro staging_models_automation(package, source_schema, source_database, tables) %}\n\n{% set package = \"\"~ package ~\"\" %}\n{% set source_schema = \"\"~ source_schema ~\"\" %}\n{% set source_database = \"\"~ source_database ~\"\" %}\n\n{% set zsh_command = \"source dbt_modules/fivetran_utils/columns_setup.sh '../dbt_\"\"\"~ package ~\"\"\"_source' stg_\"\"\"~ package ~\"\"\" \"\"\"~ source_database ~\"\"\" \"\"\"~ source_schema ~\"\"\" \" %}\n\n{% for t in tables %}\n {% if t != tables[-1] %}\n {% set help_command = zsh_command + t + \" && \\n\" %}\n\n {% else %}\n {% set help_command = zsh_command + t %}\n\n {% endif %}\n {{ log(help_command, info=True) }}\n\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_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 {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.snowflake__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.snowflake__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "snowflake__get_columns_for_macro", "macro_sql": "{% macro snowflake__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'text' then 'dbt_utils.type_string()' \n when lower(data_type) = 'boolean' then '\"boolean\"'\n when lower(data_type) = 'number' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float' then 'dbt_utils.type_float()' \n when lower(data_type) = 'date' then '\"date\"'\n end,\n '}')\nfrom {{ database_name }}.information_schema.columns\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.bigquery__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.bigquery__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "bigquery__get_columns_for_macro", "macro_sql": "{% macro bigquery__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'string' then 'dbt_utils.type_string()' \n when lower(data_type) = 'bool' then '\"boolean\"'\n when lower(data_type) = 'numeric' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float64' then 'dbt_utils.type_float()' \n when lower(data_type) = 'int64' then 'dbt_utils.type_int()' \n when lower(data_type) = 'date' then '\"date\"' \n when lower(data_type) = 'datetime' then '\"datetime\"' \n end,\n '}')\nfrom `{{ database_name }}`.{{ schema_name }}.INFORMATION_SCHEMA.COLUMNS\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.get_columns_for_macro": {"unique_id": "macro.fivetran_utils.get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "get_columns_for_macro", "macro_sql": "{% macro get_columns_for_macro(table_name, schema_name, database_name) -%}\n {{ return(adapter.dispatch('get_columns_for_macro')(table_name, schema_name, database_name)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', packages = fivetran_utils._get_utils_namespaces()) (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.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\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.name == source.name %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ 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.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', packages = fivetran_utils._get_utils_namespaces()) (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt_utils.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', packages = fivetran_utils._get_utils_namespaces()) (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils._get_utils_namespaces": {"unique_id": "macro.fivetran_utils._get_utils_namespaces", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/_get_utils_namespaces.sql", "original_file_path": "macros/_get_utils_namespaces.sql", "name": "_get_utils_namespaces", "macro_sql": "{% macro _get_utils_namespaces() %}\n {% set override_namespaces = var('fivetran_utils_dispatch_list', []) %}\n {% do return(override_namespaces + ['dbt_utils', 'fivetran_utils']) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', packages = fivetran_utils._get_utils_namespaces()) (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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."}}, "exposures": {}, "selectors": {}, "disabled": [], "parent_map": {"seed.netsuite_integration_tests.accounting_books_data": [], "seed.netsuite_integration_tests.vendors_data": [], "seed.netsuite_integration_tests.classes_data": [], "seed.netsuite_integration_tests.locations_data": [], "seed.netsuite_integration_tests.consolidated_exchange_rates_data": [], "seed.netsuite_integration_tests.customers_data": [], "seed.netsuite_integration_tests.accounts_data": [], "seed.netsuite_integration_tests.subsidiaries_data": [], "seed.netsuite_integration_tests.currencies_data": [], "seed.netsuite_integration_tests.income_accounts_data": [], "seed.netsuite_integration_tests.expense_accounts_data": [], "seed.netsuite_integration_tests.departments_data": [], "seed.netsuite_integration_tests.vendor_types_data": [], "seed.netsuite_integration_tests.items_data": [], "seed.netsuite_integration_tests.transactions_data": [], "seed.netsuite_integration_tests.transaction_lines_data": [], "seed.netsuite_integration_tests.accounting_periods_data": [], "model.netsuite_source.stg_netsuite__transactions": ["model.netsuite_source.stg_netsuite__transactions_tmp", "model.netsuite_source.stg_netsuite__transactions_tmp"], "model.netsuite_source.stg_netsuite__customers": ["model.netsuite_source.stg_netsuite__customers_tmp", "model.netsuite_source.stg_netsuite__customers_tmp"], "model.netsuite_source.stg_netsuite__accounting_books": ["model.netsuite_source.stg_netsuite__accounting_books_tmp", "model.netsuite_source.stg_netsuite__accounting_books_tmp"], "model.netsuite_source.stg_netsuite__consolidated_exchange_rates": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp", "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp"], "model.netsuite_source.stg_netsuite__transaction_lines": ["model.netsuite_source.stg_netsuite__transaction_lines_tmp", "model.netsuite_source.stg_netsuite__transaction_lines_tmp"], "model.netsuite_source.stg_netsuite__income_accounts": ["model.netsuite_source.stg_netsuite__income_accounts_tmp", "model.netsuite_source.stg_netsuite__income_accounts_tmp"], "model.netsuite_source.stg_netsuite__expense_accounts": ["model.netsuite_source.stg_netsuite__expense_accounts_tmp", "model.netsuite_source.stg_netsuite__expense_accounts_tmp"], "model.netsuite_source.stg_netsuite__vendors": ["model.netsuite_source.stg_netsuite__vendors_tmp", "model.netsuite_source.stg_netsuite__vendors_tmp"], "model.netsuite_source.stg_netsuite__classes": ["model.netsuite_source.stg_netsuite__classes_tmp", "model.netsuite_source.stg_netsuite__classes_tmp"], "model.netsuite_source.stg_netsuite__subsidiaries": ["model.netsuite_source.stg_netsuite__subsidiaries_tmp", "model.netsuite_source.stg_netsuite__subsidiaries_tmp"], "model.netsuite_source.stg_netsuite__accounts": ["model.netsuite_source.stg_netsuite__accounts_tmp", "model.netsuite_source.stg_netsuite__accounts_tmp"], "model.netsuite_source.stg_netsuite__items": ["model.netsuite_source.stg_netsuite__items_tmp", "model.netsuite_source.stg_netsuite__items_tmp"], "model.netsuite_source.stg_netsuite__locations": ["model.netsuite_source.stg_netsuite__locations_tmp", "model.netsuite_source.stg_netsuite__locations_tmp"], "model.netsuite_source.stg_netsuite__departments": ["model.netsuite_source.stg_netsuite__departments_tmp", "model.netsuite_source.stg_netsuite__departments_tmp"], "model.netsuite_source.stg_netsuite__currencies": ["model.netsuite_source.stg_netsuite__currencies_tmp", "model.netsuite_source.stg_netsuite__currencies_tmp"], "model.netsuite_source.stg_netsuite__vendor_types": ["model.netsuite_source.stg_netsuite__vendor_types_tmp", "model.netsuite_source.stg_netsuite__vendor_types_tmp"], "model.netsuite_source.stg_netsuite__accounting_periods": ["model.netsuite_source.stg_netsuite__accounting_periods_tmp", "model.netsuite_source.stg_netsuite__accounting_periods_tmp"], "model.netsuite_source.stg_netsuite__accounting_periods_tmp": ["seed.netsuite_integration_tests.accounting_periods_data"], "model.netsuite_source.stg_netsuite__accounting_books_tmp": ["seed.netsuite_integration_tests.accounting_books_data"], "model.netsuite_source.stg_netsuite__customers_tmp": ["seed.netsuite_integration_tests.customers_data"], "model.netsuite_source.stg_netsuite__transaction_lines_tmp": ["seed.netsuite_integration_tests.transaction_lines_data"], "model.netsuite_source.stg_netsuite__income_accounts_tmp": ["seed.netsuite_integration_tests.income_accounts_data"], "model.netsuite_source.stg_netsuite__accounts_tmp": ["seed.netsuite_integration_tests.accounts_data"], "model.netsuite_source.stg_netsuite__departments_tmp": ["seed.netsuite_integration_tests.departments_data"], "model.netsuite_source.stg_netsuite__currencies_tmp": ["seed.netsuite_integration_tests.currencies_data"], "model.netsuite_source.stg_netsuite__vendor_types_tmp": ["seed.netsuite_integration_tests.vendor_types_data"], "model.netsuite_source.stg_netsuite__vendors_tmp": ["seed.netsuite_integration_tests.vendors_data"], "model.netsuite_source.stg_netsuite__locations_tmp": ["seed.netsuite_integration_tests.locations_data"], "model.netsuite_source.stg_netsuite__items_tmp": ["seed.netsuite_integration_tests.items_data"], "model.netsuite_source.stg_netsuite__subsidiaries_tmp": ["seed.netsuite_integration_tests.subsidiaries_data"], "model.netsuite_source.stg_netsuite__transactions_tmp": ["seed.netsuite_integration_tests.transactions_data"], "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp": ["seed.netsuite_integration_tests.consolidated_exchange_rates_data"], "model.netsuite_source.stg_netsuite__classes_tmp": ["seed.netsuite_integration_tests.classes_data"], "model.netsuite_source.stg_netsuite__expense_accounts_tmp": ["seed.netsuite_integration_tests.expense_accounts_data"], "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id": ["model.netsuite_source.stg_netsuite__accounting_books"], "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id": ["model.netsuite_source.stg_netsuite__accounting_books"], "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id": ["model.netsuite_source.stg_netsuite__accounting_periods"], "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id": ["model.netsuite_source.stg_netsuite__accounting_periods"], "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id": ["model.netsuite_source.stg_netsuite__accounting_periods"], "test.netsuite_source.unique_stg_netsuite__accounts_account_id": ["model.netsuite_source.stg_netsuite__accounts"], "test.netsuite_source.not_null_stg_netsuite__accounts_account_id": ["model.netsuite_source.stg_netsuite__accounts"], "test.netsuite_source.unique_stg_netsuite__classes_class_id": ["model.netsuite_source.stg_netsuite__classes"], "test.netsuite_source.not_null_stg_netsuite__classes_class_id": ["model.netsuite_source.stg_netsuite__classes"], "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates"], "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates"], "test.netsuite_source.unique_stg_netsuite__currencies_currency_id": ["model.netsuite_source.stg_netsuite__currencies"], "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id": ["model.netsuite_source.stg_netsuite__currencies"], "test.netsuite_source.unique_stg_netsuite__customers_customer_id": ["model.netsuite_source.stg_netsuite__customers"], "test.netsuite_source.not_null_stg_netsuite__customers_customer_id": ["model.netsuite_source.stg_netsuite__customers"], "test.netsuite_source.unique_stg_netsuite__departments_department_id": ["model.netsuite_source.stg_netsuite__departments"], "test.netsuite_source.not_null_stg_netsuite__departments_department_id": ["model.netsuite_source.stg_netsuite__departments"], "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id": ["model.netsuite_source.stg_netsuite__expense_accounts"], "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id": ["model.netsuite_source.stg_netsuite__expense_accounts"], "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id": ["model.netsuite_source.stg_netsuite__income_accounts"], "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id": ["model.netsuite_source.stg_netsuite__income_accounts"], "test.netsuite_source.unique_stg_netsuite__items_item_id": ["model.netsuite_source.stg_netsuite__items"], "test.netsuite_source.not_null_stg_netsuite__items_item_id": ["model.netsuite_source.stg_netsuite__items"], "test.netsuite_source.unique_stg_netsuite__locations_location_id": ["model.netsuite_source.stg_netsuite__locations"], "test.netsuite_source.not_null_stg_netsuite__locations_location_id": ["model.netsuite_source.stg_netsuite__locations"], "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id": ["model.netsuite_source.stg_netsuite__subsidiaries"], "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id": ["model.netsuite_source.stg_netsuite__subsidiaries"], "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id": ["model.netsuite_source.stg_netsuite__transaction_lines"], "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id": ["model.netsuite_source.stg_netsuite__transaction_lines"], "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id": ["model.netsuite_source.stg_netsuite__transaction_lines"], "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id": ["model.netsuite_source.stg_netsuite__transactions"], "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id": ["model.netsuite_source.stg_netsuite__transactions"], "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id": ["model.netsuite_source.stg_netsuite__vendor_types"], "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id": ["model.netsuite_source.stg_netsuite__vendor_types"], "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id": ["model.netsuite_source.stg_netsuite__vendors"], "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id": ["model.netsuite_source.stg_netsuite__vendors"], "model.netsuite.netsuite__income_statement": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__classes", "model.netsuite_source.stg_netsuite__departments", "model.netsuite_source.stg_netsuite__locations", "model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__transaction_lines"], "model.netsuite.netsuite__balance_sheet": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__subsidiaries"], "model.netsuite.netsuite__transaction_details": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__currencies", "model.netsuite_source.stg_netsuite__customers", "model.netsuite_source.stg_netsuite__departments", "model.netsuite_source.stg_netsuite__expense_accounts", "model.netsuite_source.stg_netsuite__income_accounts", "model.netsuite_source.stg_netsuite__items", "model.netsuite_source.stg_netsuite__locations", "model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__transaction_lines", "model.netsuite_source.stg_netsuite__transactions", "model.netsuite_source.stg_netsuite__vendor_types", "model.netsuite_source.stg_netsuite__vendors"], "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map": ["model.netsuite_source.stg_netsuite__accounting_books", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__consolidated_exchange_rates", "model.netsuite_source.stg_netsuite__subsidiaries"], "model.netsuite.int_netsuite__transaction_lines_w_accounting_period": ["model.netsuite_source.stg_netsuite__transaction_lines", "model.netsuite_source.stg_netsuite__transactions"], "model.netsuite.int_netsuite__transaction_and_reporting_periods": ["model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__subsidiaries"], "model.netsuite.int_netsuite__transactions_with_converted_amounts": ["model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "model.netsuite.int_netsuite__transaction_and_reporting_periods", "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "model.netsuite_source.stg_netsuite__accounts"], "source.netsuite_source.netsuite.accounting_books": [], "source.netsuite_source.netsuite.accounting_periods": [], "source.netsuite_source.netsuite.accounts": [], "source.netsuite_source.netsuite.classes": [], "source.netsuite_source.netsuite.consolidated_exchange_rates": [], "source.netsuite_source.netsuite.currencies": [], "source.netsuite_source.netsuite.customers": [], "source.netsuite_source.netsuite.departments": [], "source.netsuite_source.netsuite.expense_accounts": [], "source.netsuite_source.netsuite.income_accounts": [], "source.netsuite_source.netsuite.items": [], "source.netsuite_source.netsuite.locations": [], "source.netsuite_source.netsuite.subsidiaries": [], "source.netsuite_source.netsuite.transaction_lines": [], "source.netsuite_source.netsuite.transactions": [], "source.netsuite_source.netsuite.vendor_types": [], "source.netsuite_source.netsuite.vendors": []}, "child_map": {"seed.netsuite_integration_tests.accounting_books_data": ["model.netsuite_source.stg_netsuite__accounting_books_tmp"], "seed.netsuite_integration_tests.vendors_data": ["model.netsuite_source.stg_netsuite__vendors_tmp"], "seed.netsuite_integration_tests.classes_data": ["model.netsuite_source.stg_netsuite__classes_tmp"], "seed.netsuite_integration_tests.locations_data": ["model.netsuite_source.stg_netsuite__locations_tmp"], "seed.netsuite_integration_tests.consolidated_exchange_rates_data": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp"], "seed.netsuite_integration_tests.customers_data": ["model.netsuite_source.stg_netsuite__customers_tmp"], "seed.netsuite_integration_tests.accounts_data": ["model.netsuite_source.stg_netsuite__accounts_tmp"], "seed.netsuite_integration_tests.subsidiaries_data": ["model.netsuite_source.stg_netsuite__subsidiaries_tmp"], "seed.netsuite_integration_tests.currencies_data": ["model.netsuite_source.stg_netsuite__currencies_tmp"], "seed.netsuite_integration_tests.income_accounts_data": ["model.netsuite_source.stg_netsuite__income_accounts_tmp"], "seed.netsuite_integration_tests.expense_accounts_data": ["model.netsuite_source.stg_netsuite__expense_accounts_tmp"], "seed.netsuite_integration_tests.departments_data": ["model.netsuite_source.stg_netsuite__departments_tmp"], "seed.netsuite_integration_tests.vendor_types_data": ["model.netsuite_source.stg_netsuite__vendor_types_tmp"], "seed.netsuite_integration_tests.items_data": ["model.netsuite_source.stg_netsuite__items_tmp"], "seed.netsuite_integration_tests.transactions_data": ["model.netsuite_source.stg_netsuite__transactions_tmp"], "seed.netsuite_integration_tests.transaction_lines_data": ["model.netsuite_source.stg_netsuite__transaction_lines_tmp"], "seed.netsuite_integration_tests.accounting_periods_data": ["model.netsuite_source.stg_netsuite__accounting_periods_tmp"], "model.netsuite_source.stg_netsuite__transactions": ["model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id", "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id"], "model.netsuite_source.stg_netsuite__customers": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__customers_customer_id", "test.netsuite_source.unique_stg_netsuite__customers_customer_id"], "model.netsuite_source.stg_netsuite__accounting_books": ["model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id", "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id"], "model.netsuite_source.stg_netsuite__consolidated_exchange_rates": ["model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id", "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id"], "model.netsuite_source.stg_netsuite__transaction_lines": ["model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id", "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id", "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id"], "model.netsuite_source.stg_netsuite__income_accounts": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id", "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id"], "model.netsuite_source.stg_netsuite__expense_accounts": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id", "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id"], "model.netsuite_source.stg_netsuite__vendors": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id", "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id"], "model.netsuite_source.stg_netsuite__classes": ["model.netsuite.netsuite__income_statement", "test.netsuite_source.not_null_stg_netsuite__classes_class_id", "test.netsuite_source.unique_stg_netsuite__classes_class_id"], "model.netsuite_source.stg_netsuite__subsidiaries": ["model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "model.netsuite.int_netsuite__transaction_and_reporting_periods", "model.netsuite.netsuite__balance_sheet", "model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id", "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id"], "model.netsuite_source.stg_netsuite__accounts": ["model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite.netsuite__balance_sheet", "model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__accounts_account_id", "test.netsuite_source.unique_stg_netsuite__accounts_account_id"], "model.netsuite_source.stg_netsuite__items": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__items_item_id", "test.netsuite_source.unique_stg_netsuite__items_item_id"], "model.netsuite_source.stg_netsuite__locations": ["model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__locations_location_id", "test.netsuite_source.unique_stg_netsuite__locations_location_id"], "model.netsuite_source.stg_netsuite__departments": ["model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__departments_department_id", "test.netsuite_source.unique_stg_netsuite__departments_department_id"], "model.netsuite_source.stg_netsuite__currencies": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id", "test.netsuite_source.unique_stg_netsuite__currencies_currency_id"], "model.netsuite_source.stg_netsuite__vendor_types": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id", "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id"], "model.netsuite_source.stg_netsuite__accounting_periods": ["model.netsuite.int_netsuite__transaction_and_reporting_periods", "model.netsuite.netsuite__balance_sheet", "model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id", "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id", "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id"], "model.netsuite_source.stg_netsuite__accounting_periods_tmp": ["model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__accounting_periods"], "model.netsuite_source.stg_netsuite__accounting_books_tmp": ["model.netsuite_source.stg_netsuite__accounting_books", "model.netsuite_source.stg_netsuite__accounting_books"], "model.netsuite_source.stg_netsuite__customers_tmp": ["model.netsuite_source.stg_netsuite__customers", "model.netsuite_source.stg_netsuite__customers"], "model.netsuite_source.stg_netsuite__transaction_lines_tmp": ["model.netsuite_source.stg_netsuite__transaction_lines", "model.netsuite_source.stg_netsuite__transaction_lines"], "model.netsuite_source.stg_netsuite__income_accounts_tmp": ["model.netsuite_source.stg_netsuite__income_accounts", "model.netsuite_source.stg_netsuite__income_accounts"], "model.netsuite_source.stg_netsuite__accounts_tmp": ["model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__accounts"], "model.netsuite_source.stg_netsuite__departments_tmp": ["model.netsuite_source.stg_netsuite__departments", "model.netsuite_source.stg_netsuite__departments"], "model.netsuite_source.stg_netsuite__currencies_tmp": ["model.netsuite_source.stg_netsuite__currencies", "model.netsuite_source.stg_netsuite__currencies"], "model.netsuite_source.stg_netsuite__vendor_types_tmp": ["model.netsuite_source.stg_netsuite__vendor_types", "model.netsuite_source.stg_netsuite__vendor_types"], "model.netsuite_source.stg_netsuite__vendors_tmp": ["model.netsuite_source.stg_netsuite__vendors", "model.netsuite_source.stg_netsuite__vendors"], "model.netsuite_source.stg_netsuite__locations_tmp": ["model.netsuite_source.stg_netsuite__locations", "model.netsuite_source.stg_netsuite__locations"], "model.netsuite_source.stg_netsuite__items_tmp": ["model.netsuite_source.stg_netsuite__items", "model.netsuite_source.stg_netsuite__items"], "model.netsuite_source.stg_netsuite__subsidiaries_tmp": ["model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__subsidiaries"], "model.netsuite_source.stg_netsuite__transactions_tmp": ["model.netsuite_source.stg_netsuite__transactions", "model.netsuite_source.stg_netsuite__transactions"], "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates", "model.netsuite_source.stg_netsuite__consolidated_exchange_rates"], "model.netsuite_source.stg_netsuite__classes_tmp": ["model.netsuite_source.stg_netsuite__classes", "model.netsuite_source.stg_netsuite__classes"], "model.netsuite_source.stg_netsuite__expense_accounts_tmp": ["model.netsuite_source.stg_netsuite__expense_accounts", "model.netsuite_source.stg_netsuite__expense_accounts"], "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id": [], "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id": [], "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id": [], "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id": [], "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id": [], "test.netsuite_source.unique_stg_netsuite__accounts_account_id": [], "test.netsuite_source.not_null_stg_netsuite__accounts_account_id": [], "test.netsuite_source.unique_stg_netsuite__classes_class_id": [], "test.netsuite_source.not_null_stg_netsuite__classes_class_id": [], "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id": [], "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id": [], "test.netsuite_source.unique_stg_netsuite__currencies_currency_id": [], "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id": [], "test.netsuite_source.unique_stg_netsuite__customers_customer_id": [], "test.netsuite_source.not_null_stg_netsuite__customers_customer_id": [], "test.netsuite_source.unique_stg_netsuite__departments_department_id": [], "test.netsuite_source.not_null_stg_netsuite__departments_department_id": [], "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id": [], "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id": [], "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id": [], "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id": [], "test.netsuite_source.unique_stg_netsuite__items_item_id": [], "test.netsuite_source.not_null_stg_netsuite__items_item_id": [], "test.netsuite_source.unique_stg_netsuite__locations_location_id": [], "test.netsuite_source.not_null_stg_netsuite__locations_location_id": [], "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id": [], "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id": [], "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id": [], "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id": [], "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id": [], "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id": [], "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id": [], "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id": [], "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id": [], "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id": [], "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id": [], "model.netsuite.netsuite__income_statement": [], "model.netsuite.netsuite__balance_sheet": [], "model.netsuite.netsuite__transaction_details": [], "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map": ["model.netsuite.int_netsuite__transactions_with_converted_amounts"], "model.netsuite.int_netsuite__transaction_lines_w_accounting_period": ["model.netsuite.int_netsuite__transactions_with_converted_amounts"], "model.netsuite.int_netsuite__transaction_and_reporting_periods": ["model.netsuite.int_netsuite__transactions_with_converted_amounts"], "model.netsuite.int_netsuite__transactions_with_converted_amounts": ["model.netsuite.netsuite__balance_sheet", "model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details"], "source.netsuite_source.netsuite.accounting_books": [], "source.netsuite_source.netsuite.accounting_periods": [], "source.netsuite_source.netsuite.accounts": [], "source.netsuite_source.netsuite.classes": [], "source.netsuite_source.netsuite.consolidated_exchange_rates": [], "source.netsuite_source.netsuite.currencies": [], "source.netsuite_source.netsuite.customers": [], "source.netsuite_source.netsuite.departments": [], "source.netsuite_source.netsuite.expense_accounts": [], "source.netsuite_source.netsuite.income_accounts": [], "source.netsuite_source.netsuite.items": [], "source.netsuite_source.netsuite.locations": [], "source.netsuite_source.netsuite.subsidiaries": [], "source.netsuite_source.netsuite.transaction_lines": [], "source.netsuite_source.netsuite.transactions": [], "source.netsuite_source.netsuite.vendor_types": [], "source.netsuite_source.netsuite.vendors": []}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v2.json", "dbt_version": "0.20.2", "generated_at": "2021-09-16T17:28:43.890308Z", "invocation_id": "35ac22ef-cd70-4d6c-87c7-1329e7593fa6", "env": {}, "project_id": "1288e68047c03dc418c42073e1469b09", "user_id": "57178664-37b2-4047-9572-68ec8b488cd7", "send_anonymous_usage_stats": true, "adapter_type": "postgres"}, "nodes": {"seed.netsuite_integration_tests.accounting_books_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "accounting_books_data"], "unique_id": "seed.netsuite_integration_tests.accounting_books_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "accounting_books_data.csv", "original_file_path": "data/accounting_books_data.csv", "name": "accounting_books_data", "alias": "accounting_books_data", "checksum": {"name": "sha256", "checksum": "45b73583ed0a1425f131de59b6a17b997caec17d9b0884947f27008ae81c1684"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"accounting_books_data\""}, "seed.netsuite_integration_tests.vendors_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "vendors_data"], "unique_id": "seed.netsuite_integration_tests.vendors_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "vendors_data.csv", "original_file_path": "data/vendors_data.csv", "name": "vendors_data", "alias": "vendors_data", "checksum": {"name": "sha256", "checksum": "f050ea1d5fa346fcefbe9a5792dfbe9f5aabbec17a359ab2e497be7b3e888e2d"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"vendors_data\""}, "seed.netsuite_integration_tests.classes_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "classes_data"], "unique_id": "seed.netsuite_integration_tests.classes_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "classes_data.csv", "original_file_path": "data/classes_data.csv", "name": "classes_data", "alias": "classes_data", "checksum": {"name": "sha256", "checksum": "18e8a63665925edfacbeaa443c7f6632c4489bd521df77d945ee657d398588e3"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"classes_data\""}, "seed.netsuite_integration_tests.locations_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "locations_data"], "unique_id": "seed.netsuite_integration_tests.locations_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "locations_data.csv", "original_file_path": "data/locations_data.csv", "name": "locations_data", "alias": "locations_data", "checksum": {"name": "sha256", "checksum": "8a71a79adb44cc02707a75ee10a85f03b472324a894ddc32716eeea7d533bc2f"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"locations_data\""}, "seed.netsuite_integration_tests.consolidated_exchange_rates_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "consolidated_exchange_rates_data"], "unique_id": "seed.netsuite_integration_tests.consolidated_exchange_rates_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "consolidated_exchange_rates_data.csv", "original_file_path": "data/consolidated_exchange_rates_data.csv", "name": "consolidated_exchange_rates_data", "alias": "consolidated_exchange_rates_data", "checksum": {"name": "sha256", "checksum": "b8719124e41745363f91f996b99812a9e6c98306ef24034c5efb12b64600a496"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"consolidated_exchange_rates_data\""}, "seed.netsuite_integration_tests.customers_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "customers_data"], "unique_id": "seed.netsuite_integration_tests.customers_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "customers_data.csv", "original_file_path": "data/customers_data.csv", "name": "customers_data", "alias": "customers_data", "checksum": {"name": "sha256", "checksum": "e3ce06d6edaeb9f777c340a597d8de7cfb2d3423a20a2421eae4c86264a9c93a"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"customers_data\""}, "seed.netsuite_integration_tests.accounts_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "accounts_data"], "unique_id": "seed.netsuite_integration_tests.accounts_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "accounts_data.csv", "original_file_path": "data/accounts_data.csv", "name": "accounts_data", "alias": "accounts_data", "checksum": {"name": "sha256", "checksum": "a3d24c6bf7438f0bf6e0a725565ea0bb000c6fa01b7ffbdfb1b70689f5ad515b"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"accounts_data\""}, "seed.netsuite_integration_tests.subsidiaries_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "subsidiaries_data"], "unique_id": "seed.netsuite_integration_tests.subsidiaries_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "subsidiaries_data.csv", "original_file_path": "data/subsidiaries_data.csv", "name": "subsidiaries_data", "alias": "subsidiaries_data", "checksum": {"name": "sha256", "checksum": "4dd2e8b192c4c052a847d6791b5a32da6968a3234d48b85a37ae20f7ee9445de"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"subsidiaries_data\""}, "seed.netsuite_integration_tests.currencies_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "currencies_data"], "unique_id": "seed.netsuite_integration_tests.currencies_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "currencies_data.csv", "original_file_path": "data/currencies_data.csv", "name": "currencies_data", "alias": "currencies_data", "checksum": {"name": "sha256", "checksum": "f98ba1751b715296956912fc4c2b43f58875c56740e829c045aefe1172cb2232"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"currencies_data\""}, "seed.netsuite_integration_tests.income_accounts_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "income_accounts_data"], "unique_id": "seed.netsuite_integration_tests.income_accounts_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "income_accounts_data.csv", "original_file_path": "data/income_accounts_data.csv", "name": "income_accounts_data", "alias": "income_accounts_data", "checksum": {"name": "sha256", "checksum": "53a81321736b4a42663e253050539eb48b0d179847e23f161927d29c4cbf1367"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"income_accounts_data\""}, "seed.netsuite_integration_tests.expense_accounts_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "expense_accounts_data"], "unique_id": "seed.netsuite_integration_tests.expense_accounts_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "expense_accounts_data.csv", "original_file_path": "data/expense_accounts_data.csv", "name": "expense_accounts_data", "alias": "expense_accounts_data", "checksum": {"name": "sha256", "checksum": "983ef804359afb2c0f7db8c3bb32d5eecdec8c0d9fbf502360944877dc212f9c"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"expense_accounts_data\""}, "seed.netsuite_integration_tests.departments_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "departments_data"], "unique_id": "seed.netsuite_integration_tests.departments_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "departments_data.csv", "original_file_path": "data/departments_data.csv", "name": "departments_data", "alias": "departments_data", "checksum": {"name": "sha256", "checksum": "9060203f11419c602daf8afc578035d29ef612e1e868b12fa22eaf7b37942607"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"departments_data\""}, "seed.netsuite_integration_tests.vendor_types_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "vendor_types_data"], "unique_id": "seed.netsuite_integration_tests.vendor_types_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "vendor_types_data.csv", "original_file_path": "data/vendor_types_data.csv", "name": "vendor_types_data", "alias": "vendor_types_data", "checksum": {"name": "sha256", "checksum": "2111fb5a226e9e73c187a1a1a13caa0c2d3b54bb2eedfe3287f636c049c72b64"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"vendor_types_data\""}, "seed.netsuite_integration_tests.items_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "items_data"], "unique_id": "seed.netsuite_integration_tests.items_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "items_data.csv", "original_file_path": "data/items_data.csv", "name": "items_data", "alias": "items_data", "checksum": {"name": "sha256", "checksum": "567fc2b4c8e46962f9297095017fa529544feafed31503e9fc3ed51bf60b866d"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"items_data\""}, "seed.netsuite_integration_tests.transactions_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"due_date": "timestamp"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "transactions_data"], "unique_id": "seed.netsuite_integration_tests.transactions_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "transactions_data.csv", "original_file_path": "data/transactions_data.csv", "name": "transactions_data", "alias": "transactions_data", "checksum": {"name": "sha256", "checksum": "c1d88d96de5d5e6ed310a6b008df7390a2aaf7b0d857668e0dfed259f0c704ed"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "column_types": {"due_date": "timestamp"}}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"transactions_data\""}, "seed.netsuite_integration_tests.transaction_lines_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "transaction_lines_data"], "unique_id": "seed.netsuite_integration_tests.transaction_lines_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "transaction_lines_data.csv", "original_file_path": "data/transaction_lines_data.csv", "name": "transaction_lines_data", "alias": "transaction_lines_data", "checksum": {"name": "sha256", "checksum": "6786bdf4b6e00d6243008c46d0bb69a21158ff27265690503aaa9d8b6faa01d2"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"transaction_lines_data\""}, "seed.netsuite_integration_tests.accounting_periods_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"ending": "timestamp", "starting": "timestamp", "fiscal_calendar_id": "bigint"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests", "fqn": ["netsuite_integration_tests", "accounting_periods_data"], "unique_id": "seed.netsuite_integration_tests.accounting_periods_data", "package_name": "netsuite_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests", "path": "accounting_periods_data.csv", "original_file_path": "data/accounting_periods_data.csv", "name": "accounting_periods_data", "alias": "accounting_periods_data", "checksum": {"name": "sha256", "checksum": "673c2f4c76e4cb8bbccecc7e30c0056163d39f53174013f0460a2e4e5efe6e33"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "accounting_books_data": null, "accounts_data": null, "classes_data": null, "consolidated_exchange_rates_data": null, "currencies_data": null, "customers_data": null, "departments_data": null, "expense_accounts_data": null, "income_accounts_data": null, "items_data": null, "locations_data": null, "subsidiaries_data": null, "transaction_line_data": null, "vendor_types_data": null, "vendors_data": null, "column_types": {"ending": "timestamp", "starting": "timestamp", "fiscal_calendar_id": "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"}}, "created_at": 1631813325, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests\".\"accounting_periods_data\""}, "model.netsuite_source.stg_netsuite__transactions": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__transactions_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__transactions_tmp')),\n staging_columns=get_transactions_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('transactions_pass_through_columns') %}\n ,\n {{ var('transactions_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from base\n),\n\nfinal as (\n \n select \n transaction_id,\n status,\n trandate as transaction_date,\n currency_id,\n accounting_period_id,\n due_date as due_date_at,\n transaction_type,\n is_intercompany,\n is_advanced_intercompany,\n _fivetran_deleted\n\n --The below script allows for pass through columns.\n {% if var('transactions_pass_through_columns') %}\n ,\n {{ var('transactions_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_transactions_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__transactions_tmp", "model.netsuite_source.stg_netsuite__transactions_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__transactions"], "unique_id": "model.netsuite_source.stg_netsuite__transactions", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__transactions.sql", "original_file_path": "models/stg_netsuite__transactions.sql", "name": "stg_netsuite__transactions", "alias": "stg_netsuite__transactions", "checksum": {"name": "sha256", "checksum": "0abff28b2320d70674f504b02dc967dcff81bcc0716198278bd375f2c7d3e3f7"}, "tags": [], "refs": [["stg_netsuite__transactions_tmp"], ["stg_netsuite__transactions_tmp"]], "sources": [], "description": "A table detailing all transactions.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The unique identifier of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction (ie. Paid In Full, Open, Cancelled).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_date": {"name": "transaction_date", "description": "The timestamp of the transaction date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_id": {"name": "currency_id", "description": "The currency id of the currency used in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_id": {"name": "accounting_period_id", "description": "The accounting period id of the accounting period which the transaction took place in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date_at": {"name": "due_date_at", "description": "The timestamp of the transaction due date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_type": {"name": "transaction_type", "description": "The transaction type (ie. Bill, Check, Deposit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_intercompany": {"name": "is_intercompany", "description": "Value indicating whether the transaction is intercompany (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_advanced_intercompany": {"name": "is_advanced_intercompany", "description": "Value indicating whether the transaction is an advanced intercompany journal entry (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__transactions.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n accounting_period_id\n \n as \n \n accounting_period_id\n \n, \n \n \n currency_id\n \n as \n \n currency_id\n \n, \n \n \n due_date\n \n as \n \n due_date\n \n, \n \n \n is_advanced_intercompany\n \n as \n \n is_advanced_intercompany\n \n, \n \n \n is_intercompany\n \n as \n \n is_intercompany\n \n, \n \n \n status\n \n as \n \n status\n \n, \n cast(null as \n timestamp\n) as \n \n trandate\n \n , \n \n \n transaction_id\n \n as \n \n transaction_id\n \n, \n \n \n transaction_type\n \n as \n \n transaction_type\n \n\n\n\n\n --The below script allows for pass through columns.\n \n \n from base\n),\n\nfinal as (\n \n select \n transaction_id,\n status,\n trandate as transaction_date,\n currency_id,\n accounting_period_id,\n due_date as due_date_at,\n transaction_type,\n is_intercompany,\n is_advanced_intercompany,\n _fivetran_deleted\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\""}, "model.netsuite_source.stg_netsuite__customers": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__customers_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__customers_tmp')),\n staging_columns=get_customers_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n customer_id,\n companyname as company_name,\n customer_extid as customer_external_id,\n city,\n state,\n zipcode,\n country,\n date_first_order as date_first_order_at,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_customers_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__customers_tmp", "model.netsuite_source.stg_netsuite__customers_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__customers"], "unique_id": "model.netsuite_source.stg_netsuite__customers", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__customers.sql", "original_file_path": "models/stg_netsuite__customers.sql", "name": "stg_netsuite__customers", "alias": "stg_netsuite__customers", "checksum": {"name": "sha256", "checksum": "091f0369f8ac83b51d0d4a317aac8780faed5c969543e4a20604b17e5002fcf2"}, "tags": [], "refs": [["stg_netsuite__customers_tmp"], ["stg_netsuite__customers_tmp"]], "sources": [], "description": "Table detailing all customer information.", "columns": {"customer_id": {"name": "customer_id", "description": "The unique identifier of the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company_name": {"name": "company_name", "description": "The name of the company.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_external_id": {"name": "customer_external_id", "description": "The unique identifier of the external customer reference.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zipcode": {"name": "zipcode", "description": "The zipcode of the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The country where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_first_order_at": {"name": "date_first_order_at", "description": "The timestamp of the customers first order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__customers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__customers_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n varchar\n) as \n \n account_owner\n \n , \n cast(null as \n varchar\n) as \n \n accountnumber\n \n , \n cast(null as \n varchar\n) as \n \n accounts_email\n \n , \n cast(null as \n varchar\n) as \n \n alcohol_recipient_type\n \n , \n cast(null as \n varchar\n) as \n \n allow_task_time_for_allocation\n \n , \n cast(null as \n varchar\n) as \n \n altemail\n \n , \n cast(null as \n float\n) as \n \n alternate_contact_id\n \n , \n cast(null as \n varchar\n) as \n \n altphone\n \n , \n cast(null as \n float\n) as \n \n amount_complete\n \n , \n cast(null as \n float\n) as \n \n annual_revenue\n \n , \n cast(null as \n varchar\n) as \n \n assess_use_tax_on_billavatax\n \n , \n cast(null as \n varchar\n) as \n \n auto_renewals\n \n , \n cast(null as \n varchar\n) as \n \n auto_send_statements\n \n , \n cast(null as \n varchar\n) as \n \n billaddress\n \n , \n cast(null as \n float\n) as \n \n billing_rate_card_id\n \n , \n cast(null as \n float\n) as \n \n billing_schedule_id\n \n , \n cast(null as \n varchar\n) as \n \n billing_schedule_type\n \n , \n cast(null as \n varchar\n) as \n \n billing_transaction_type\n \n , \n cast(null as \n varchar\n) as \n \n brn\n \n , \n cast(null as \n timestamp\n) as \n \n calculated_end\n \n , \n cast(null as \n varchar\n) as \n \n category_0\n \n , \n \n \n city\n \n as \n \n city\n \n, \n cast(null as \n varchar\n) as \n \n comments\n \n , \n cast(null as \n varchar\n) as \n \n companyname\n \n , \n cast(null as \n float\n) as \n \n consol_days_overdue\n \n , \n cast(null as \n float\n) as \n \n consol_deposit_balance\n \n , \n cast(null as \n float\n) as \n \n consol_deposit_balance_foreign\n \n , \n cast(null as \n float\n) as \n \n consol_openbalance\n \n , \n cast(null as \n float\n) as \n \n consol_openbalance_foreign\n \n , \n cast(null as \n float\n) as \n \n consol_unbilled_orders\n \n , \n cast(null as \n float\n) as \n \n consol_unbilled_orders_foreign\n \n , \n cast(null as \n float\n) as \n \n converted_to_contact_id\n \n , \n cast(null as \n float\n) as \n \n converted_to_id\n \n , \n cast(null as \n float\n) as \n \n cost_estimate\n \n , \n \n \n country\n \n as \n \n country\n \n, \n cast(null as \n timestamp\n) as \n \n create_date\n \n , \n cast(null as \n varchar\n) as \n \n credithold\n \n , \n cast(null as \n float\n) as \n \n creditlimit\n \n , \n cast(null as \n float\n) as \n \n currency_id\n \n , \n cast(null as \n varchar\n) as \n \n customer_extid\n \n , \n \n \n customer_id\n \n as \n \n customer_id\n \n, \n cast(null as \n float\n) as \n \n customer_type_id\n \n , \n cast(null as \n timestamp\n) as \n \n date_calculated_start\n \n , \n cast(null as \n timestamp\n) as \n \n date_closed\n \n , \n cast(null as \n timestamp\n) as \n \n date_convsersion\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n \n \n date_first_order\n \n as \n \n date_first_order\n \n, \n cast(null as \n timestamp\n) as \n \n date_first_sale\n \n , \n cast(null as \n timestamp\n) as \n \n date_gross_lead\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_order\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_sale\n \n , \n cast(null as \n timestamp\n) as \n \n date_lead\n \n , \n cast(null as \n timestamp\n) as \n \n date_prospect\n \n , \n cast(null as \n timestamp\n) as \n \n date_scheduled_end\n \n , \n cast(null as \n float\n) as \n \n days_overdue\n \n , \n cast(null as \n float\n) as \n \n default_order_priority\n \n , \n cast(null as \n float\n) as \n \n default_receivables_account_id\n \n , \n cast(null as \n float\n) as \n \n deposit_balance\n \n , \n cast(null as \n float\n) as \n \n deposit_balance_foreign\n \n , \n cast(null as \n varchar\n) as \n \n dic\n \n , \n cast(null as \n varchar\n) as \n \n email\n \n , \n cast(null as \n varchar\n) as \n \n email_cash_sales\n \n , \n cast(null as \n varchar\n) as \n \n email_credit_notes\n \n , \n cast(null as \n varchar\n) as \n \n email_invoices\n \n , \n cast(null as \n varchar\n) as \n \n email_item_fulfilments\n \n , \n cast(null as \n varchar\n) as \n \n email_purchase_orders\n \n , \n cast(null as \n varchar\n) as \n \n email_quotes\n \n , \n cast(null as \n varchar\n) as \n \n email_sales_orders\n \n , \n cast(null as \n varchar\n) as \n \n email_statements\n \n , \n cast(null as \n varchar\n) as \n \n employee_number\n \n , \n cast(null as \n varchar\n) as \n \n exemption_certificate_no\n \n , \n cast(null as \n timestamp\n) as \n \n expected_close\n \n , \n cast(null as \n varchar\n) as \n \n fax\n \n , \n cast(null as \n float\n) as \n \n first_sale_period_id\n \n , \n cast(null as \n timestamp\n) as \n \n first_visit\n \n , \n cast(null as \n varchar\n) as \n \n firstname\n \n , \n cast(null as \n varchar\n) as \n \n forecast_based_on_allocations\n \n , \n cast(null as \n varchar\n) as \n \n forecast_charge_run_on_demand\n \n , \n cast(null as \n varchar\n) as \n \n full_name\n \n , \n cast(null as \n varchar\n) as \n \n home_phone\n \n , \n cast(null as \n varchar\n) as \n \n hris_id\n \n , \n cast(null as \n varchar\n) as \n \n ico\n \n , \n cast(null as \n varchar\n) as \n \n id_number_in_the_country_of_r\n \n , \n cast(null as \n float\n) as \n \n id_type_in_the_country_of_r_id\n \n , \n cast(null as \n float\n) as \n \n industry_id\n \n , \n cast(null as \n varchar\n) as \n \n invoice_via_procurement_syste\n \n , \n cast(null as \n varchar\n) as \n \n invoicing_details\n \n , \n cast(null as \n varchar\n) as \n \n is_exempt_time\n \n , \n cast(null as \n varchar\n) as \n \n is_explicit_conversion\n \n , \n cast(null as \n varchar\n) as \n \n is_job\n \n , \n cast(null as \n varchar\n) as \n \n is_limit_time_to_assignees\n \n , \n cast(null as \n varchar\n) as \n \n is_partner\n \n , \n cast(null as \n varchar\n) as \n \n is_person\n \n , \n cast(null as \n varchar\n) as \n \n is_productive_time\n \n , \n cast(null as \n varchar\n) as \n \n is_project_completely_billed\n \n , \n cast(null as \n varchar\n) as \n \n is_source_item_from_brc\n \n , \n cast(null as \n varchar\n) as \n \n is_utilized_time\n \n , \n cast(null as \n varchar\n) as \n \n isemailhtml\n \n , \n cast(null as \n varchar\n) as \n \n isemailpdf\n \n , \n cast(null as \n varchar\n) as \n \n isinactive\n \n , \n cast(null as \n varchar\n) as \n \n istaxable\n \n , \n cast(null as \n timestamp\n) as \n \n job_end\n \n , \n cast(null as \n timestamp\n) as \n \n job_start\n \n , \n cast(null as \n float\n) as \n \n job_type_id\n \n , \n cast(null as \n varchar\n) as \n \n labor_budget_from_allocations\n \n , \n cast(null as \n varchar\n) as \n \n language_id\n \n , \n cast(null as \n timestamp\n) as \n \n last_modified_date\n \n , \n cast(null as \n float\n) as \n \n last_sale_period_id\n \n , \n cast(null as \n timestamp\n) as \n \n last_sales_activity\n \n , \n cast(null as \n timestamp\n) as \n \n last_visit\n \n , \n cast(null as \n varchar\n) as \n \n lastname\n \n , \n cast(null as \n float\n) as \n \n lead_source_id\n \n , \n cast(null as \n varchar\n) as \n \n line1\n \n , \n cast(null as \n varchar\n) as \n \n line2\n \n , \n cast(null as \n varchar\n) as \n \n line3\n \n , \n cast(null as \n varchar\n) as \n \n loginaccess\n \n , \n cast(null as \n varchar\n) as \n \n lsa_link\n \n , \n cast(null as \n varchar\n) as \n \n lsa_link_name\n \n , \n cast(null as \n varchar\n) as \n \n middlename\n \n , \n cast(null as \n varchar\n) as \n \n mobile_phone\n \n , \n cast(null as \n timestamp\n) as \n \n msa_effective_date\n \n , \n cast(null as \n float\n) as \n \n multiple_price_id\n \n , \n cast(null as \n varchar\n) as \n \n name\n \n , \n cast(null as \n float\n) as \n \n no__of_employees\n \n , \n cast(null as \n float\n) as \n \n openbalance\n \n , \n cast(null as \n float\n) as \n \n openbalance_foreign\n \n , \n cast(null as \n float\n) as \n \n parent_id\n \n , \n cast(null as \n float\n) as \n \n partner_id\n \n , \n cast(null as \n float\n) as \n \n payment_terms_id\n \n , \n cast(null as \n varchar\n) as \n \n phone\n \n , \n cast(null as \n float\n) as \n \n primary_contact_id\n \n , \n cast(null as \n varchar\n) as \n \n print_on_check_as\n \n , \n cast(null as \n float\n) as \n \n probability\n \n , \n cast(null as \n float\n) as \n \n project_expense_type_id\n \n , \n cast(null as \n float\n) as \n \n project_manager_id\n \n , \n cast(null as \n timestamp\n) as \n \n projected_end\n \n , \n cast(null as \n varchar\n) as \n \n purchases_email\n \n , \n cast(null as \n varchar\n) as \n \n referrer\n \n , \n cast(null as \n float\n) as \n \n reminderdays\n \n , \n cast(null as \n timestamp\n) as \n \n renewal\n \n , \n cast(null as \n float\n) as \n \n represents_subsidiary_id\n \n , \n cast(null as \n varchar\n) as \n \n resalenumber\n \n , \n cast(null as \n varchar\n) as \n \n restrict_access_to_expensify\n \n , \n cast(null as \n float\n) as \n \n rev_rec_forecast_rule_id\n \n , \n cast(null as \n float\n) as \n \n rev_rec_forecast_template\n \n , \n cast(null as \n float\n) as \n \n revenue_estimate\n \n , \n cast(null as \n float\n) as \n \n sales_rep_id\n \n , \n cast(null as \n float\n) as \n \n sales_territory_id\n \n , \n cast(null as \n varchar\n) as \n \n salesforce_id\n \n , \n cast(null as \n varchar\n) as \n \n salutation\n \n , \n cast(null as \n varchar\n) as \n \n scheduling_method_id\n \n , \n cast(null as \n varchar\n) as \n \n ship_complete\n \n , \n cast(null as \n varchar\n) as \n \n shipaddress\n \n , \n cast(null as \n varchar\n) as \n \n shipping_email\n \n , \n \n \n state\n \n as \n \n state\n \n, \n cast(null as \n varchar\n) as \n \n status\n \n , \n cast(null as \n varchar\n) as \n \n status_descr\n \n , \n cast(null as \n float\n) as \n \n status_probability\n \n , \n cast(null as \n varchar\n) as \n \n status_read_only\n \n , \n cast(null as \n float\n) as \n \n subsidiary_id\n \n , \n cast(null as \n varchar\n) as \n \n tax_contact_first_name\n \n , \n cast(null as \n float\n) as \n \n tax_contact_id\n \n , \n cast(null as \n varchar\n) as \n \n tax_contact_last_name\n \n , \n cast(null as \n varchar\n) as \n \n tax_contact_middle_name\n \n , \n cast(null as \n float\n) as \n \n tax_item_id\n \n , \n cast(null as \n varchar\n) as \n \n tax_number\n \n , \n cast(null as \n varchar\n) as \n \n third_party_acct\n \n , \n cast(null as \n varchar\n) as \n \n third_party_carrier\n \n , \n cast(null as \n varchar\n) as \n \n third_party_country\n \n , \n cast(null as \n varchar\n) as \n \n third_party_zip_code\n \n , \n cast(null as \n float\n) as \n \n time_approval_type_id\n \n , \n cast(null as \n float\n) as \n \n top_level_parent_id\n \n , \n cast(null as \n varchar\n) as \n \n transactions_need_approval\n \n , \n cast(null as \n varchar\n) as \n \n uen\n \n , \n cast(null as \n float\n) as \n \n unbilled_orders\n \n , \n cast(null as \n float\n) as \n \n unbilled_orders_foreign\n \n , \n cast(null as \n varchar\n) as \n \n url\n \n , \n cast(null as \n varchar\n) as \n \n use_calculated_billing_budget\n \n , \n cast(null as \n varchar\n) as \n \n use_calculated_cost_budget\n \n , \n cast(null as \n varchar\n) as \n \n use_percent_complete_override\n \n , \n cast(null as \n varchar\n) as \n \n vat_reg_number\n \n , \n cast(null as \n varchar\n) as \n \n vat_registration_no\n \n , \n cast(null as \n varchar\n) as \n \n web_lead\n \n , \n \n \n zipcode\n \n as \n \n zipcode\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n customer_id,\n companyname as company_name,\n customer_extid as customer_external_id,\n city,\n state,\n zipcode,\n country,\n date_first_order as date_first_order_at,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__customers\""}, "model.netsuite_source.stg_netsuite__accounting_books": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__accounting_books_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__accounting_books_tmp')),\n staging_columns=get_accounting_books_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n accounting_book_id,\n is_primary,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_accounting_books_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_books_tmp", "model.netsuite_source.stg_netsuite__accounting_books_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__accounting_books"], "unique_id": "model.netsuite_source.stg_netsuite__accounting_books", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__accounting_books.sql", "original_file_path": "models/stg_netsuite__accounting_books.sql", "name": "stg_netsuite__accounting_books", "alias": "stg_netsuite__accounting_books", "checksum": {"name": "sha256", "checksum": "bb8f9026875456b5d8ee10b9e2c6f9765fd58190e9127a0eda2f6d539852b311"}, "tags": [], "refs": [["stg_netsuite__accounting_books_tmp"], ["stg_netsuite__accounting_books_tmp"]], "sources": [], "description": "Table detailing all accounting books set up in Netsuite.", "columns": {"accounting_book_id": {"name": "accounting_book_id", "description": "The unique identifier of the accounting book.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_primary": {"name": "is_primary", "description": "Boolean indicating whether it is a primary accounting book.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__accounting_books.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n varchar\n) as \n \n accounting_book_extid\n \n , \n \n \n accounting_book_id\n \n as \n \n accounting_book_id\n \n, \n cast(null as \n varchar\n) as \n \n accounting_book_name\n \n , \n cast(null as \n float\n) as \n \n base_book_id\n \n , \n cast(null as \n timestamp\n) as \n \n date_created\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n float\n) as \n \n effective_period_id\n \n , \n cast(null as \n varchar\n) as \n \n form_template_component_id\n \n , \n cast(null as \n float\n) as \n \n form_template_id\n \n , \n cast(null as \n varchar\n) as \n \n is_adjustment_only\n \n , \n cast(null as \n varchar\n) as \n \n is_arrangement_level_reclass\n \n , \n cast(null as \n varchar\n) as \n \n is_consolidated\n \n , \n cast(null as \n varchar\n) as \n \n is_contingent_revenue_handling\n \n , \n cast(null as \n varchar\n) as \n \n is_include_child_subsidiaries\n \n , \n \n \n is_primary\n \n as \n \n is_primary\n \n, \n cast(null as \n varchar\n) as \n \n is_two_step_revenue_allocation\n \n , \n cast(null as \n varchar\n) as \n \n status\n \n , \n cast(null as \n varchar\n) as \n \n unbilled_receivable_grouping\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n accounting_book_id,\n is_primary,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\""}, "model.netsuite_source.stg_netsuite__consolidated_exchange_rates": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__consolidated_exchange_rates_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__consolidated_exchange_rates_tmp')),\n staging_columns=get_consolidated_exchange_rates_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n consolidated_exchange_rate_id,\n accounting_book_id,\n accounting_period_id,\n average_rate,\n current_rate,\n historical_rate,\n from_subsidiary_id,\n to_subsidiary_id,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_consolidated_exchange_rates_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp", "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__consolidated_exchange_rates"], "unique_id": "model.netsuite_source.stg_netsuite__consolidated_exchange_rates", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__consolidated_exchange_rates.sql", "original_file_path": "models/stg_netsuite__consolidated_exchange_rates.sql", "name": "stg_netsuite__consolidated_exchange_rates", "alias": "stg_netsuite__consolidated_exchange_rates", "checksum": {"name": "sha256", "checksum": "282a2b65bcc994b187413fa57d28e587d1c70f80bde273e0eca768425db007d5"}, "tags": [], "refs": [["stg_netsuite__consolidated_exchange_rates_tmp"], ["stg_netsuite__consolidated_exchange_rates_tmp"]], "sources": [], "description": "Table detailing average, historical and current exchange rates for all accounting periods.", "columns": {"consolidated_exchange_rate_id": {"name": "consolidated_exchange_rate_id", "description": "The unique identifier for the consolidated exchange rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_book_id": {"name": "accounting_book_id", "description": "The accounting book the consolidated exchange rate is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_id": {"name": "accounting_period_id", "description": "The accounting period the consolidated exchange rate is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "average_rate": {"name": "average_rate", "description": "The consolidated exchange rates average rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "current_rate": {"name": "current_rate", "description": "The consolidated exchange rates current rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "historical_rate": {"name": "historical_rate", "description": "The consolidated exchange rates historical rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_subsidiary_id": {"name": "from_subsidiary_id", "description": "The subsidiary id which the consolidated exchange rate is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_subsidiary_id": {"name": "to_subsidiary_id", "description": "THe subsidiary id which the consolidated exchange rate is for.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__consolidated_exchange_rates.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n \n \n accounting_book_id\n \n as \n \n accounting_book_id\n \n, \n \n \n accounting_period_id\n \n as \n \n accounting_period_id\n \n, \n cast(null as \n float\n) as \n \n average_budget_rate\n \n , \n \n \n average_rate\n \n as \n \n average_rate\n \n, \n \n \n consolidated_exchange_rate_id\n \n as \n \n consolidated_exchange_rate_id\n \n, \n cast(null as \n float\n) as \n \n current_budget_rate\n \n , \n \n \n current_rate\n \n as \n \n current_rate\n \n, \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n \n \n from_subsidiary_id\n \n as \n \n from_subsidiary_id\n \n, \n cast(null as \n float\n) as \n \n historical_budget_rate\n \n , \n \n \n historical_rate\n \n as \n \n historical_rate\n \n, \n \n \n to_subsidiary_id\n \n as \n \n to_subsidiary_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n consolidated_exchange_rate_id,\n accounting_book_id,\n accounting_period_id,\n average_rate,\n current_rate,\n historical_rate,\n from_subsidiary_id,\n to_subsidiary_id,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\""}, "model.netsuite_source.stg_netsuite__transaction_lines": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__transaction_lines_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__transaction_lines_tmp')),\n staging_columns=get_transaction_lines_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('transaction_lines_pass_through_columns') %}\n ,\n {{ var('transaction_lines_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from base\n),\n\nfinal as (\n \n select \n transaction_id,\n transaction_line_id,\n subsidiary_id,\n account_id,\n company_id,\n item_id,\n amount,\n non_posting_line,\n class_id,\n location_id,\n department_id,\n memo\n\n --The below script allows for pass through columns.\n {% if var('transaction_lines_pass_through_columns') %}\n ,\n {{ var('transaction_lines_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_transaction_lines_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__transaction_lines_tmp", "model.netsuite_source.stg_netsuite__transaction_lines_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__transaction_lines"], "unique_id": "model.netsuite_source.stg_netsuite__transaction_lines", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__transaction_lines.sql", "original_file_path": "models/stg_netsuite__transaction_lines.sql", "name": "stg_netsuite__transaction_lines", "alias": "stg_netsuite__transaction_lines", "checksum": {"name": "sha256", "checksum": "ea1b823803b4edb1476af0624d76af3be40121b28e3c5a13010829e7cdb3be7d"}, "tags": [], "refs": [["stg_netsuite__transaction_lines_tmp"], ["stg_netsuite__transaction_lines_tmp"]], "sources": [], "description": "A table detailing all transaction lines for all transactions.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The transaction id which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_line_id": {"name": "transaction_line_id", "description": "The unique identifier of the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subsidiary_id": {"name": "subsidiary_id", "description": "The subsidiary id of the subsidiary which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The account id of the account linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company_id": {"name": "company_id", "description": "The company id of the company linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_id": {"name": "item_id", "description": "The item id of the item which is included in the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "non_posting_line": {"name": "non_posting_line", "description": "Value indicating whether the transaction line is a non posting line (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_id": {"name": "class_id", "description": "The class id of the class which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The location id of the location which the transaction line took place.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_id": {"name": "department_id", "description": "The department id of the department linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "memo": {"name": "memo", "description": "The memo attached to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__transaction_lines.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n class_id\n \n as \n \n class_id\n \n, \n \n \n company_id\n \n as \n \n company_id\n \n, \n \n \n department_id\n \n as \n \n department_id\n \n, \n \n \n item_id\n \n as \n \n item_id\n \n, \n \n \n location_id\n \n as \n \n location_id\n \n, \n \n \n memo\n \n as \n \n memo\n \n, \n \n \n non_posting_line\n \n as \n \n non_posting_line\n \n, \n \n \n subsidiary_id\n \n as \n \n subsidiary_id\n \n, \n \n \n transaction_id\n \n as \n \n transaction_id\n \n, \n \n \n transaction_line_id\n \n as \n \n transaction_line_id\n \n\n\n\n\n --The below script allows for pass through columns.\n \n \n from base\n),\n\nfinal as (\n \n select \n transaction_id,\n transaction_line_id,\n subsidiary_id,\n account_id,\n company_id,\n item_id,\n amount,\n non_posting_line,\n class_id,\n location_id,\n department_id,\n memo\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\""}, "model.netsuite_source.stg_netsuite__income_accounts": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__income_accounts_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__income_accounts_tmp')),\n staging_columns=get_income_accounts_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n income_account_id,\n name, \n parent_id,\n account_number,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_income_accounts_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__income_accounts_tmp", "model.netsuite_source.stg_netsuite__income_accounts_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__income_accounts"], "unique_id": "model.netsuite_source.stg_netsuite__income_accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__income_accounts.sql", "original_file_path": "models/stg_netsuite__income_accounts.sql", "name": "stg_netsuite__income_accounts", "alias": "stg_netsuite__income_accounts", "checksum": {"name": "sha256", "checksum": "fa8d6ba80b7075473ae4e5a1585424589afdad650fa2c5c01ea6a8ed80dde81d"}, "tags": [], "refs": [["stg_netsuite__income_accounts_tmp"], ["stg_netsuite__income_accounts_tmp"]], "sources": [], "description": "Table detailing all income accounts.", "columns": {"income_account_id": {"name": "income_account_id", "description": "The unique identifier of the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The income account's associated parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "The account number associated with the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__income_accounts.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__income_accounts_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n \n \n account_number\n \n as \n \n account_number\n \n, \n cast(null as \n varchar\n) as \n \n comments\n \n , \n cast(null as \n float\n) as \n \n current_balance\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n varchar\n) as \n \n desription\n \n , \n cast(null as \n varchar\n) as \n \n full_name\n \n , \n cast(null as \n varchar\n) as \n \n income_account_extid\n \n , \n \n \n income_account_id\n \n as \n \n income_account_id\n \n, \n cast(null as \n varchar\n) as \n \n is_including_child_subs\n \n , \n cast(null as \n varchar\n) as \n \n is_summary\n \n , \n cast(null as \n varchar\n) as \n \n isinactive\n \n , \n cast(null as \n varchar\n) as \n \n legal_name\n \n , \n \n \n name\n \n as \n \n name\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n income_account_id,\n name, \n parent_id,\n account_number,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__income_accounts\""}, "model.netsuite_source.stg_netsuite__expense_accounts": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__expense_accounts_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__expense_accounts_tmp')),\n staging_columns=get_expense_accounts_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n expense_account_id,\n name,\n parent_id,\n account_number,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_expense_accounts_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__expense_accounts_tmp", "model.netsuite_source.stg_netsuite__expense_accounts_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__expense_accounts"], "unique_id": "model.netsuite_source.stg_netsuite__expense_accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__expense_accounts.sql", "original_file_path": "models/stg_netsuite__expense_accounts.sql", "name": "stg_netsuite__expense_accounts", "alias": "stg_netsuite__expense_accounts", "checksum": {"name": "sha256", "checksum": "a29c5c0d493672dd2f71ecef070387963ce3f836126f138c5df1964ec8f737d7"}, "tags": [], "refs": [["stg_netsuite__expense_accounts_tmp"], ["stg_netsuite__expense_accounts_tmp"]], "sources": [], "description": "Table detailing all expense accounts.", "columns": {"expense_account_id": {"name": "expense_account_id", "description": "The unique identifier of the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The expense account's associated parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "The account number associated with the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__expense_accounts.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__expense_accounts_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n \n \n account_number\n \n as \n \n account_number\n \n, \n cast(null as \n varchar\n) as \n \n comments\n \n , \n cast(null as \n float\n) as \n \n current_balance\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n varchar\n) as \n \n desription\n \n , \n cast(null as \n varchar\n) as \n \n expense_account_extid\n \n , \n \n \n expense_account_id\n \n as \n \n expense_account_id\n \n, \n cast(null as \n varchar\n) as \n \n full_name\n \n , \n cast(null as \n varchar\n) as \n \n is_including_child_subs\n \n , \n cast(null as \n varchar\n) as \n \n is_summary\n \n , \n cast(null as \n varchar\n) as \n \n isinactive\n \n , \n cast(null as \n varchar\n) as \n \n legal_name\n \n , \n \n \n name\n \n as \n \n name\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n expense_account_id,\n name,\n parent_id,\n account_number,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__expense_accounts\""}, "model.netsuite_source.stg_netsuite__vendors": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__vendors_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__vendors_tmp')),\n staging_columns=get_vendors_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n vendor_id,\n companyname as company_name,\n create_date as create_date_at,\n vendor_type_id,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_vendors_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__vendors_tmp", "model.netsuite_source.stg_netsuite__vendors_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__vendors"], "unique_id": "model.netsuite_source.stg_netsuite__vendors", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__vendors.sql", "original_file_path": "models/stg_netsuite__vendors.sql", "name": "stg_netsuite__vendors", "alias": "stg_netsuite__vendors", "checksum": {"name": "sha256", "checksum": "c9b0b1333c98e1c10776ccf679d64564e727c9f6807ed11c4e9004452d959ad1"}, "tags": [], "refs": [["stg_netsuite__vendors_tmp"], ["stg_netsuite__vendors_tmp"]], "sources": [], "description": "A table detailing all vendor information.", "columns": {"vendor_id": {"name": "vendor_id", "description": "The unique identifier of the vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_type_id": {"name": "vendor_type_id", "description": "The vendor type the vendor is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company_name": {"name": "company_name", "description": "The vendor's company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_date_at": {"name": "create_date_at", "description": "The timestamp of the date the vendor was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__vendors.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendors_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n varchar\n) as \n \n account_owner\n \n , \n cast(null as \n varchar\n) as \n \n accountnumber\n \n , \n cast(null as \n varchar\n) as \n \n accounts_email\n \n , \n cast(null as \n float\n) as \n \n annual_revenue\n \n , \n cast(null as \n varchar\n) as \n \n auto_renewals\n \n , \n cast(null as \n varchar\n) as \n \n auto_send_statements\n \n , \n cast(null as \n varchar\n) as \n \n billaddress\n \n , \n cast(null as \n float\n) as \n \n billing_class_id\n \n , \n cast(null as \n varchar\n) as \n \n city\n \n , \n cast(null as \n varchar\n) as \n \n comments\n \n , \n cast(null as \n varchar\n) as \n \n companyname\n \n , \n cast(null as \n varchar\n) as \n \n country\n \n , \n \n \n create_date\n \n as \n \n create_date\n \n, \n cast(null as \n float\n) as \n \n creditlimit\n \n , \n cast(null as \n float\n) as \n \n currency_id\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n varchar\n) as \n \n dic\n \n , \n cast(null as \n varchar\n) as \n \n email\n \n , \n cast(null as \n varchar\n) as \n \n email_bill_payment_vouchers\n \n , \n cast(null as \n varchar\n) as \n \n email_cash_sales\n \n , \n cast(null as \n varchar\n) as \n \n email_credit_notes\n \n , \n cast(null as \n varchar\n) as \n \n email_invoices\n \n , \n cast(null as \n varchar\n) as \n \n email_item_fulfilments\n \n , \n cast(null as \n varchar\n) as \n \n email_purchase_orders\n \n , \n cast(null as \n varchar\n) as \n \n email_quotes\n \n , \n cast(null as \n varchar\n) as \n \n email_sales_orders\n \n , \n cast(null as \n varchar\n) as \n \n email_statements\n \n , \n cast(null as \n varchar\n) as \n \n employee_number\n \n , \n cast(null as \n varchar\n) as \n \n exemption_certificate_no\n \n , \n cast(null as \n float\n) as \n \n expense_account_id\n \n , \n cast(null as \n varchar\n) as \n \n fax\n \n , \n cast(null as \n varchar\n) as \n \n full_name\n \n , \n cast(null as \n varchar\n) as \n \n home_phone\n \n , \n cast(null as \n varchar\n) as \n \n hris_id\n \n , \n cast(null as \n varchar\n) as \n \n ico\n \n , \n cast(null as \n varchar\n) as \n \n id_number_in_the_country_of_r\n \n , \n cast(null as \n float\n) as \n \n id_type_in_the_country_of_r_id\n \n , \n cast(null as \n float\n) as \n \n in_transit_balance\n \n , \n cast(null as \n varchar\n) as \n \n incoterm\n \n , \n cast(null as \n float\n) as \n \n industry_id\n \n , \n cast(null as \n varchar\n) as \n \n invoice_via_procurement_syste\n \n , \n cast(null as \n varchar\n) as \n \n invoicing_details\n \n , \n cast(null as \n varchar\n) as \n \n is1099eligible\n \n , \n cast(null as \n varchar\n) as \n \n is_partner\n \n , \n cast(null as \n varchar\n) as \n \n is_person\n \n , \n cast(null as \n varchar\n) as \n \n isemailhtml\n \n , \n cast(null as \n varchar\n) as \n \n isemailpdf\n \n , \n cast(null as \n varchar\n) as \n \n isinactive\n \n , \n cast(null as \n float\n) as \n \n labor_cost\n \n , \n cast(null as \n timestamp\n) as \n \n last_modified_date\n \n , \n cast(null as \n timestamp\n) as \n \n last_sales_activity\n \n , \n cast(null as \n varchar\n) as \n \n line1\n \n , \n cast(null as \n varchar\n) as \n \n line2\n \n , \n cast(null as \n varchar\n) as \n \n line3\n \n , \n cast(null as \n varchar\n) as \n \n loginaccess\n \n , \n cast(null as \n varchar\n) as \n \n lsa_link\n \n , \n cast(null as \n varchar\n) as \n \n lsa_link_name\n \n , \n cast(null as \n varchar\n) as \n \n mobile_phone\n \n , \n cast(null as \n timestamp\n) as \n \n msa_effective_date\n \n , \n cast(null as \n varchar\n) as \n \n name\n \n , \n cast(null as \n float\n) as \n \n no__of_employees\n \n , \n cast(null as \n float\n) as \n \n openbalance\n \n , \n cast(null as \n float\n) as \n \n openbalance_foreign\n \n , \n cast(null as \n float\n) as \n \n payables_account_id\n \n , \n cast(null as \n float\n) as \n \n payment_terms_id\n \n , \n cast(null as \n varchar\n) as \n \n phone\n \n , \n cast(null as \n float\n) as \n \n prepayment_balance\n \n , \n cast(null as \n varchar\n) as \n \n printoncheckas\n \n , \n cast(null as \n float\n) as \n \n purchaseorderamount\n \n , \n cast(null as \n float\n) as \n \n purchaseorderquantity\n \n , \n cast(null as \n float\n) as \n \n purchaseorderquantitydiff\n \n , \n cast(null as \n varchar\n) as \n \n purchases_email\n \n , \n cast(null as \n float\n) as \n \n receiptamount\n \n , \n cast(null as \n float\n) as \n \n receiptquantity\n \n , \n cast(null as \n float\n) as \n \n receiptquantitydiff\n \n , \n cast(null as \n float\n) as \n \n represents_subsidiary_id\n \n , \n cast(null as \n varchar\n) as \n \n restrict_access_to_expensify\n \n , \n cast(null as \n varchar\n) as \n \n salesforce_id\n \n , \n cast(null as \n varchar\n) as \n \n shipaddress\n \n , \n cast(null as \n varchar\n) as \n \n shipping_email\n \n , \n cast(null as \n varchar\n) as \n \n state\n \n , \n cast(null as \n float\n) as \n \n subsidiary\n \n , \n cast(null as \n varchar\n) as \n \n tax_contact_first_name\n \n , \n cast(null as \n float\n) as \n \n tax_contact_id\n \n , \n cast(null as \n varchar\n) as \n \n tax_contact_last_name\n \n , \n cast(null as \n varchar\n) as \n \n tax_contact_middle_name\n \n , \n cast(null as \n varchar\n) as \n \n tax_number\n \n , \n cast(null as \n varchar\n) as \n \n taxidnum\n \n , \n cast(null as \n float\n) as \n \n time_approver_id\n \n , \n cast(null as \n varchar\n) as \n \n transactions_need_approval\n \n , \n cast(null as \n varchar\n) as \n \n uen\n \n , \n cast(null as \n float\n) as \n \n unbilled_orders\n \n , \n cast(null as \n float\n) as \n \n unbilled_orders_foreign\n \n , \n cast(null as \n varchar\n) as \n \n url\n \n , \n cast(null as \n varchar\n) as \n \n vat_registration_no\n \n , \n cast(null as \n varchar\n) as \n \n vendor_extid\n \n , \n \n \n vendor_id\n \n as \n \n vendor_id\n \n, \n \n \n vendor_type_id\n \n as \n \n vendor_type_id\n \n, \n cast(null as \n varchar\n) as \n \n zipcode\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n vendor_id,\n companyname as company_name,\n create_date as create_date_at,\n vendor_type_id,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendors\""}, "model.netsuite_source.stg_netsuite__classes": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__classes_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__classes_tmp')),\n staging_columns=get_classes_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('classes_pass_through_columns') %}\n ,\n {{ var('classes_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from base\n),\n\nfinal as (\n \n select \n class_id,\n full_name,\n _fivetran_deleted\n\n --The below script allows for pass through columns.\n {% if var('classes_pass_through_columns') %}\n ,\n {{ var('classes_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_classes_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__classes_tmp", "model.netsuite_source.stg_netsuite__classes_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__classes"], "unique_id": "model.netsuite_source.stg_netsuite__classes", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__classes.sql", "original_file_path": "models/stg_netsuite__classes.sql", "name": "stg_netsuite__classes", "alias": "stg_netsuite__classes", "checksum": {"name": "sha256", "checksum": "18fa2abb56525418764b4862f927d7af2f765b74659ed4adb42476b378a6035a"}, "tags": [], "refs": [["stg_netsuite__classes_tmp"], ["stg_netsuite__classes_tmp"]], "sources": [], "description": "Table detailing all classes set up in Netsuite.", "columns": {"class_id": {"name": "class_id", "description": "The unique identifier of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__classes.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__classes_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n \n \n class_id\n \n as \n \n class_id\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n\n\n\n\n --The below script allows for pass through columns.\n \n \n from base\n),\n\nfinal as (\n \n select \n class_id,\n full_name,\n _fivetran_deleted\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__classes\""}, "model.netsuite_source.stg_netsuite__subsidiaries": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__subsidiaries_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__subsidiaries_tmp')),\n staging_columns=get_subsidiaries_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n subsidiary_id,\n fiscal_calendar_id,\n full_name,\n name,\n parent_id,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_subsidiaries_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__subsidiaries_tmp", "model.netsuite_source.stg_netsuite__subsidiaries_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__subsidiaries"], "unique_id": "model.netsuite_source.stg_netsuite__subsidiaries", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__subsidiaries.sql", "original_file_path": "models/stg_netsuite__subsidiaries.sql", "name": "stg_netsuite__subsidiaries", "alias": "stg_netsuite__subsidiaries", "checksum": {"name": "sha256", "checksum": "0a875a3d1d8146b715b7edae8b16fc248073cc71a39991927244d0180aefe13c"}, "tags": [], "refs": [["stg_netsuite__subsidiaries_tmp"], ["stg_netsuite__subsidiaries_tmp"]], "sources": [], "description": "Table detailing all subsidiaries.", "columns": {"subsidiary_id": {"name": "subsidiary_id", "description": "The unique identifier of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fiscal_calendar_id": {"name": "fiscal_calendar_id", "description": "The fiscal calendar id associated with the fiscal calendar the subsidiary is on.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The parent subsidiary id which the subsidiary is under.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__subsidiaries.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n varchar\n) as \n \n address\n \n , \n cast(null as \n varchar\n) as \n \n address1\n \n , \n cast(null as \n varchar\n) as \n \n address2\n \n , \n cast(null as \n float\n) as \n \n base_currency_id\n \n , \n cast(null as \n varchar\n) as \n \n branch_id\n \n , \n cast(null as \n varchar\n) as \n \n brn\n \n , \n cast(null as \n varchar\n) as \n \n city\n \n , \n cast(null as \n varchar\n) as \n \n country\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n varchar\n) as \n \n edition\n \n , \n cast(null as \n varchar\n) as \n \n federal_number\n \n , \n \n \n fiscal_calendar_id\n \n as \n \n fiscal_calendar_id\n \n, \n cast(null as \n varchar\n) as \n \n full_name\n \n , \n cast(null as \n varchar\n) as \n \n is_elimination\n \n , \n cast(null as \n varchar\n) as \n \n is_moss\n \n , \n cast(null as \n varchar\n) as \n \n isinactive\n \n , \n cast(null as \n varchar\n) as \n \n isinactive_bool\n \n , \n cast(null as \n varchar\n) as \n \n legal_name\n \n , \n cast(null as \n float\n) as \n \n moss_nexus_id\n \n , \n \n \n name\n \n as \n \n name\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n cast(null as \n float\n) as \n \n purchaseorderamount\n \n , \n cast(null as \n float\n) as \n \n purchaseorderquantity\n \n , \n cast(null as \n float\n) as \n \n purchaseorderquantitydiff\n \n , \n cast(null as \n float\n) as \n \n receiptamount\n \n , \n cast(null as \n float\n) as \n \n receiptquantity\n \n , \n cast(null as \n float\n) as \n \n receiptquantitydiff\n \n , \n cast(null as \n varchar\n) as \n \n return_address\n \n , \n cast(null as \n varchar\n) as \n \n return_address1\n \n , \n cast(null as \n varchar\n) as \n \n return_address2\n \n , \n cast(null as \n varchar\n) as \n \n return_city\n \n , \n cast(null as \n varchar\n) as \n \n return_country\n \n , \n cast(null as \n varchar\n) as \n \n return_state\n \n , \n cast(null as \n varchar\n) as \n \n return_zipcode\n \n , \n cast(null as \n varchar\n) as \n \n shipping_address\n \n , \n cast(null as \n varchar\n) as \n \n shipping_address1\n \n , \n cast(null as \n varchar\n) as \n \n shipping_address2\n \n , \n cast(null as \n varchar\n) as \n \n shipping_city\n \n , \n cast(null as \n varchar\n) as \n \n shipping_country\n \n , \n cast(null as \n varchar\n) as \n \n shipping_state\n \n , \n cast(null as \n varchar\n) as \n \n shipping_zipcode\n \n , \n cast(null as \n varchar\n) as \n \n state\n \n , \n cast(null as \n varchar\n) as \n \n state_tax_number\n \n , \n cast(null as \n float\n) as \n \n subnav__searchable_subsidiary\n \n , \n cast(null as \n varchar\n) as \n \n subsidiary_extid\n \n , \n \n \n subsidiary_id\n \n as \n \n subsidiary_id\n \n, \n cast(null as \n float\n) as \n \n taxonomy_reference_id\n \n , \n cast(null as \n varchar\n) as \n \n tran_num_prefix\n \n , \n cast(null as \n varchar\n) as \n \n uen\n \n , \n cast(null as \n varchar\n) as \n \n url\n \n , \n cast(null as \n varchar\n) as \n \n zipcode\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n subsidiary_id,\n fiscal_calendar_id,\n full_name,\n name,\n parent_id,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\""}, "model.netsuite_source.stg_netsuite__accounts": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__accounts_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__accounts_tmp')),\n staging_columns=get_accounts_columns()\n )\n }}\n --The below script allows for pass through columns.\n {% if var('accounts_pass_through_columns') %}\n ,\n {{ var('accounts_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from base\n),\n\nfinal as (\n \n select \n account_id,\n parent_id,\n name,\n type_name,\n accountnumber as account_number,\n general_rate_type,\n is_leftside,\n is_balancesheet,\n _fivetran_deleted\n\n --The below script allows for pass through columns.\n {% if var('accounts_pass_through_columns') %}\n ,\n {{ var('accounts_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_accounts_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__accounts_tmp", "model.netsuite_source.stg_netsuite__accounts_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__accounts"], "unique_id": "model.netsuite_source.stg_netsuite__accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__accounts.sql", "original_file_path": "models/stg_netsuite__accounts.sql", "name": "stg_netsuite__accounts", "alias": "stg_netsuite__accounts", "checksum": {"name": "sha256", "checksum": "66cd557b41400d1de8092ae1e97523215baa098d1f11e06cacac77168bc449ff"}, "tags": [], "refs": [["stg_netsuite__accounts_tmp"], ["stg_netsuite__accounts_tmp"]], "sources": [], "description": "Table that provides a complete listing of every account in the accounting system.", "columns": {"account_id": {"name": "account_id", "description": "The unique identifier associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The accounts associated parent account id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type_name": {"name": "type_name", "description": "The name of the type of the account (ie. Bank, Equity, Income, Expense).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "The account number associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "general_rate_type": {"name": "general_rate_type", "description": "The general rate type of the account (Current, Historical, Average).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_leftside": {"name": "is_leftside", "description": "Value indicating whether the account is on the leftside (debit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_balancesheet": {"name": "is_balancesheet", "description": "Value indicating whether the account is a balance sheet account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__accounts.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n \n \n account_id\n \n as \n \n account_id\n \n, \n cast(null as \n varchar\n) as \n \n accountnumber\n \n , \n \n \n general_rate_type\n \n as \n \n general_rate_type\n \n, \n \n \n is_balancesheet\n \n as \n \n is_balancesheet\n \n, \n \n \n is_leftside\n \n as \n \n is_leftside\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n type_name\n \n as \n \n type_name\n \n\n\n\n --The below script allows for pass through columns.\n \n \n from base\n),\n\nfinal as (\n \n select \n account_id,\n parent_id,\n name,\n type_name,\n accountnumber as account_number,\n general_rate_type,\n is_leftside,\n is_balancesheet,\n _fivetran_deleted\n\n --The below script allows for pass through columns.\n \n \n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\""}, "model.netsuite_source.stg_netsuite__items": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__items_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__items_tmp')),\n staging_columns=get_items_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n item_id,\n name,\n type_name,\n salesdescription as sales_description,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_items_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__items_tmp", "model.netsuite_source.stg_netsuite__items_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__items"], "unique_id": "model.netsuite_source.stg_netsuite__items", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__items.sql", "original_file_path": "models/stg_netsuite__items.sql", "name": "stg_netsuite__items", "alias": "stg_netsuite__items", "checksum": {"name": "sha256", "checksum": "03c29d5f6442ef3aab29f5efca66f4d055338320d710d18cec89c6280c60cccd"}, "tags": [], "refs": [["stg_netsuite__items_tmp"], ["stg_netsuite__items_tmp"]], "sources": [], "description": "Table detailing information about the items created in Netsuite.", "columns": {"item_id": {"name": "item_id", "description": "The unique identifier of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type_name": {"name": "type_name", "description": "The type of the item (ie. Markup, Service, Discount).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sales_description": {"name": "sales_description", "description": "The items sales description.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__items.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__items_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n varchar\n) as \n \n allow_drop_ship\n \n , \n cast(null as \n float\n) as \n \n alt_demand_source_item_id\n \n , \n cast(null as \n float\n) as \n \n asset_account_id\n \n , \n cast(null as \n float\n) as \n \n atp_lead_time\n \n , \n cast(null as \n varchar\n) as \n \n atp_method\n \n , \n cast(null as \n varchar\n) as \n \n available_to_partners\n \n , \n cast(null as \n varchar\n) as \n \n avatax_taxcode\n \n , \n cast(null as \n float\n) as \n \n averagecost\n \n , \n cast(null as \n float\n) as \n \n backward_consumption_days\n \n , \n cast(null as \n varchar\n) as \n \n build_sub_assemblies\n \n , \n cast(null as \n float\n) as \n \n class_id\n \n , \n cast(null as \n float\n) as \n \n code_of_supply_id\n \n , \n cast(null as \n varchar\n) as \n \n commodity_code\n \n , \n cast(null as \n float\n) as \n \n consumption_unit_id\n \n , \n cast(null as \n float\n) as \n \n cost_0\n \n , \n cast(null as \n varchar\n) as \n \n cost_category\n \n , \n cast(null as \n varchar\n) as \n \n cost_estimate_type\n \n , \n cast(null as \n varchar\n) as \n \n costing_method\n \n , \n cast(null as \n varchar\n) as \n \n country_of_manufacture\n \n , \n cast(null as \n varchar\n) as \n \n create_plan_on_event_type\n \n , \n cast(null as \n timestamp\n) as \n \n created\n \n , \n cast(null as \n float\n) as \n \n current_on_order_count\n \n , \n cast(null as \n float\n) as \n \n custreturn_variance_account_id\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n timestamp\n) as \n \n date_of_last_transaction\n \n , \n cast(null as \n float\n) as \n \n default_return_cost\n \n , \n cast(null as \n float\n) as \n \n deferred_expense_account_id\n \n , \n cast(null as \n float\n) as \n \n deferred_revenue_account_id\n \n , \n cast(null as \n varchar\n) as \n \n demand_source\n \n , \n cast(null as \n float\n) as \n \n demand_time_fence\n \n , \n cast(null as \n float\n) as \n \n department_id\n \n , \n cast(null as \n varchar\n) as \n \n deposit\n \n , \n cast(null as \n varchar\n) as \n \n displayname\n \n , \n cast(null as \n varchar\n) as \n \n distribution_category\n \n , \n cast(null as \n varchar\n) as \n \n distribution_network\n \n , \n cast(null as \n float\n) as \n \n dropship_expense_account_id\n \n , \n cast(null as \n varchar\n) as \n \n effective_bom_control_type\n \n , \n cast(null as \n float\n) as \n \n expense_account_id\n \n , \n cast(null as \n varchar\n) as \n \n featureddescription\n \n , \n cast(null as \n varchar\n) as \n \n featureditem\n \n , \n cast(null as \n float\n) as \n \n fixed_lot_size\n \n , \n cast(null as \n float\n) as \n \n forward_consumption_days\n \n , \n cast(null as \n varchar\n) as \n \n fraud_risk\n \n , \n cast(null as \n varchar\n) as \n \n full_name\n \n , \n cast(null as \n float\n) as \n \n fx_adjustment_account_id\n \n , \n cast(null as \n float\n) as \n \n gain_loss_account_id\n \n , \n cast(null as \n float\n) as \n \n handling_cost\n \n , \n cast(null as \n varchar\n) as \n \n hazmat\n \n , \n cast(null as \n varchar\n) as \n \n hazmat_hazard_class\n \n , \n cast(null as \n varchar\n) as \n \n hazmat_id\n \n , \n cast(null as \n varchar\n) as \n \n hazmat_item_units\n \n , \n cast(null as \n float\n) as \n \n hazmat_item_units_qty\n \n , \n cast(null as \n varchar\n) as \n \n hazmat_packing_group\n \n , \n cast(null as \n varchar\n) as \n \n hazmat_shipping_name\n \n , \n cast(null as \n varchar\n) as \n \n include_child_subsidiaries\n \n , \n cast(null as \n float\n) as \n \n income_account_id\n \n , \n cast(null as \n float\n) as \n \n interco_expense_account_id\n \n , \n cast(null as \n float\n) as \n \n interco_income_account_id\n \n , \n cast(null as \n float\n) as \n \n invt_count_classification\n \n , \n cast(null as \n float\n) as \n \n invt_count_interval\n \n , \n cast(null as \n varchar\n) as \n \n is_cont_rev_handling\n \n , \n cast(null as \n varchar\n) as \n \n is_enforce_min_qty_internally\n \n , \n cast(null as \n varchar\n) as \n \n is_hold_rev_rec\n \n , \n cast(null as \n varchar\n) as \n \n is_moss\n \n , \n cast(null as \n varchar\n) as \n \n is_phantom\n \n , \n cast(null as \n varchar\n) as \n \n is_special_order_item\n \n , \n cast(null as \n varchar\n) as \n \n isinactive\n \n , \n cast(null as \n varchar\n) as \n \n isonline\n \n , \n cast(null as \n varchar\n) as \n \n istaxable\n \n , \n cast(null as \n float\n) as \n \n item_defined_cost\n \n , \n cast(null as \n varchar\n) as \n \n item_extid\n \n , \n \n \n item_id\n \n as \n \n item_id\n \n, \n cast(null as \n float\n) as \n \n item_image\n \n , \n cast(null as \n varchar\n) as \n \n item_revenue_category\n \n , \n cast(null as \n float\n) as \n \n item_term_id\n \n , \n cast(null as \n timestamp\n) as \n \n last_cogs_correction\n \n , \n cast(null as \n timestamp\n) as \n \n last_invt_count_date\n \n , \n cast(null as \n float\n) as \n \n last_purchase_price\n \n , \n cast(null as \n float\n) as \n \n location_id\n \n , \n cast(null as \n varchar\n) as \n \n lot_numbered_item\n \n , \n cast(null as \n varchar\n) as \n \n lot_sizing_method\n \n , \n cast(null as \n varchar\n) as \n \n manufacturer\n \n , \n cast(null as \n varchar\n) as \n \n manufacturing_charge_item\n \n , \n cast(null as \n varchar\n) as \n \n match_bill_to_receipt\n \n , \n cast(null as \n varchar\n) as \n \n matrix_type\n \n , \n cast(null as \n float\n) as \n \n maximum_quantity\n \n , \n cast(null as \n float\n) as \n \n minimum_quantity\n \n , \n cast(null as \n timestamp\n) as \n \n modified\n \n , \n cast(null as \n varchar\n) as \n \n mpn\n \n , \n \n \n name\n \n as \n \n name\n \n, \n cast(null as \n float\n) as \n \n nature_of_transaction_codes_id\n \n , \n cast(null as \n timestamp\n) as \n \n next_invt_count_date\n \n , \n cast(null as \n float\n) as \n \n ng_asset_type_id\n \n , \n cast(null as \n float\n) as \n \n ns_lead_time\n \n , \n cast(null as \n varchar\n) as \n \n offersupport\n \n , \n cast(null as \n varchar\n) as \n \n onspecial\n \n , \n cast(null as \n varchar\n) as \n \n overhead_type\n \n , \n cast(null as \n float\n) as \n \n parent_id\n \n , \n cast(null as \n float\n) as \n \n payment_method_id\n \n , \n cast(null as \n float\n) as \n \n periodic_lot_size_days\n \n , \n cast(null as \n varchar\n) as \n \n periodic_lot_size_type\n \n , \n cast(null as \n float\n) as \n \n pref_purchase_tax_id\n \n , \n cast(null as \n float\n) as \n \n pref_sale_tax_id\n \n , \n cast(null as \n float\n) as \n \n pref_stock_level\n \n , \n cast(null as \n varchar\n) as \n \n prices_include_tax\n \n , \n cast(null as \n float\n) as \n \n pricing_group_id\n \n , \n cast(null as \n varchar\n) as \n \n print_sub_items\n \n , \n cast(null as \n float\n) as \n \n prod_price_var_account_id\n \n , \n cast(null as \n float\n) as \n \n prod_qty_var_account_id\n \n , \n cast(null as \n varchar\n) as \n \n prompt_payment_discount_item\n \n , \n cast(null as \n float\n) as \n \n purchase_price_var_account_id\n \n , \n cast(null as \n float\n) as \n \n purchase_unit_id\n \n , \n cast(null as \n varchar\n) as \n \n purchasedescription\n \n , \n cast(null as \n float\n) as \n \n purchaseorderamount\n \n , \n cast(null as \n float\n) as \n \n purchaseorderquantity\n \n , \n cast(null as \n float\n) as \n \n purchaseorderquantitydiff\n \n , \n cast(null as \n float\n) as \n \n quantityavailable\n \n , \n cast(null as \n float\n) as \n \n quantitybackordered\n \n , \n cast(null as \n float\n) as \n \n quantityonhand\n \n , \n cast(null as \n float\n) as \n \n receiptamount\n \n , \n cast(null as \n float\n) as \n \n receiptquantity\n \n , \n cast(null as \n float\n) as \n \n receiptquantitydiff\n \n , \n cast(null as \n float\n) as \n \n reorder_multiple\n \n , \n cast(null as \n float\n) as \n \n reorderpoint\n \n , \n cast(null as \n varchar\n) as \n \n replenishment_method\n \n , \n cast(null as \n varchar\n) as \n \n resalable\n \n , \n cast(null as \n float\n) as \n \n reschedule_in_days\n \n , \n cast(null as \n float\n) as \n \n reschedule_out_days\n \n , \n cast(null as \n float\n) as \n \n rev_rec_forecast_rule_id\n \n , \n cast(null as \n float\n) as \n \n rev_rec_rule_id\n \n , \n cast(null as \n varchar\n) as \n \n revenue_allocation_group\n \n , \n cast(null as \n varchar\n) as \n \n round_up_as_component\n \n , \n cast(null as \n float\n) as \n \n safety_stock_days\n \n , \n cast(null as \n float\n) as \n \n safety_stock_level\n \n , \n cast(null as \n float\n) as \n \n sale_unit_id\n \n , \n cast(null as \n varchar\n) as \n \n salesdescription\n \n , \n cast(null as \n varchar\n) as \n \n salesforce_id\n \n , \n cast(null as \n varchar\n) as \n \n salesprice\n \n , \n cast(null as \n float\n) as \n \n scrap_account_id\n \n , \n cast(null as \n varchar\n) as \n \n serialized_item\n \n , \n cast(null as \n float\n) as \n \n shippingcost\n \n , \n cast(null as \n varchar\n) as \n \n special_work_order_item\n \n , \n cast(null as \n varchar\n) as \n \n specialsdescription\n \n , \n cast(null as \n float\n) as \n \n stock_unit_id\n \n , \n cast(null as \n varchar\n) as \n \n storedescription\n \n , \n cast(null as \n varchar\n) as \n \n storedetaileddescription\n \n , \n cast(null as \n varchar\n) as \n \n storedisplayname\n \n , \n cast(null as \n varchar\n) as \n \n subtype\n \n , \n cast(null as \n varchar\n) as \n \n supplementary_unit__abberviat\n \n , \n cast(null as \n float\n) as \n \n supplementary_unit_id\n \n , \n cast(null as \n float\n) as \n \n supply_time_fence\n \n , \n cast(null as \n varchar\n) as \n \n supply_type\n \n , \n cast(null as \n float\n) as \n \n tax_item_id\n \n , \n cast(null as \n float\n) as \n \n totalvalue\n \n , \n cast(null as \n float\n) as \n \n transferprice\n \n , \n \n \n type_name\n \n as \n \n type_name\n \n, \n cast(null as \n float\n) as \n \n type_of_goods_id\n \n , \n cast(null as \n varchar\n) as \n \n udf1\n \n , \n cast(null as \n varchar\n) as \n \n udf2\n \n , \n cast(null as \n varchar\n) as \n \n un_number\n \n , \n cast(null as \n float\n) as \n \n unbuild_variance_account_id\n \n , \n cast(null as \n float\n) as \n \n units_type_id\n \n , \n cast(null as \n varchar\n) as \n \n upc_code\n \n , \n cast(null as \n varchar\n) as \n \n use_component_yield\n \n , \n cast(null as \n float\n) as \n \n vendor_id\n \n , \n cast(null as \n varchar\n) as \n \n vendorname\n \n , \n cast(null as \n float\n) as \n \n vendreturn_variance_account_id\n \n , \n cast(null as \n varchar\n) as \n \n vsoe_deferral\n \n , \n cast(null as \n varchar\n) as \n \n vsoe_delivered\n \n , \n cast(null as \n varchar\n) as \n \n vsoe_discount\n \n , \n cast(null as \n float\n) as \n \n vsoe_price\n \n , \n cast(null as \n float\n) as \n \n weight\n \n , \n cast(null as \n float\n) as \n \n weight_in_user_defined_unit\n \n , \n cast(null as \n float\n) as \n \n weight_unit_index\n \n , \n cast(null as \n float\n) as \n \n wip_account_id\n \n , \n cast(null as \n float\n) as \n \n wip_cost_variance_account_id\n \n , \n cast(null as \n float\n) as \n \n work_order_lead_time\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n item_id,\n name,\n type_name,\n salesdescription as sales_description,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__items\""}, "model.netsuite_source.stg_netsuite__locations": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__locations_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__locations_tmp')),\n staging_columns=get_locations_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n location_id,\n name,\n full_name,\n city,\n country,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_locations_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__locations_tmp", "model.netsuite_source.stg_netsuite__locations_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__locations"], "unique_id": "model.netsuite_source.stg_netsuite__locations", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__locations.sql", "original_file_path": "models/stg_netsuite__locations.sql", "name": "stg_netsuite__locations", "alias": "stg_netsuite__locations", "checksum": {"name": "sha256", "checksum": "0ef4cbc6abd3e08d3dd36e705e8b7cc83f70d4dbf1c220ed5d0b5c99ec4a96ef"}, "tags": [], "refs": [["stg_netsuite__locations_tmp"], ["stg_netsuite__locations_tmp"]], "sources": [], "description": "Table detailing all locations, including store, warehouse and office locations.", "columns": {"location_id": {"name": "location_id", "description": "The unique identifier of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The location's name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The location's city.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The location's country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__locations.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__locations_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n varchar\n) as \n \n address\n \n , \n cast(null as \n varchar\n) as \n \n address_one\n \n , \n cast(null as \n varchar\n) as \n \n address_three\n \n , \n cast(null as \n varchar\n) as \n \n address_two\n \n , \n cast(null as \n varchar\n) as \n \n addressee\n \n , \n cast(null as \n varchar\n) as \n \n attention\n \n , \n cast(null as \n varchar\n) as \n \n branch_id\n \n , \n \n \n city\n \n as \n \n city\n \n, \n \n \n country\n \n as \n \n country\n \n, \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n \n \n full_name\n \n as \n \n full_name\n \n, \n cast(null as \n varchar\n) as \n \n inventory_available\n \n , \n cast(null as \n varchar\n) as \n \n inventory_available_web_store\n \n , \n cast(null as \n varchar\n) as \n \n is_include_in_supply_planning\n \n , \n cast(null as \n varchar\n) as \n \n isinactive\n \n , \n cast(null as \n varchar\n) as \n \n location_extid\n \n , \n \n \n location_id\n \n as \n \n location_id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n cast(null as \n float\n) as \n \n parent_id\n \n , \n cast(null as \n varchar\n) as \n \n phone\n \n , \n cast(null as \n varchar\n) as \n \n pick_up\n \n , \n cast(null as \n varchar\n) as \n \n return_address_one\n \n , \n cast(null as \n varchar\n) as \n \n return_address_two\n \n , \n cast(null as \n varchar\n) as \n \n return_city\n \n , \n cast(null as \n varchar\n) as \n \n return_country\n \n , \n cast(null as \n varchar\n) as \n \n return_state\n \n , \n cast(null as \n varchar\n) as \n \n return_zipcode\n \n , \n cast(null as \n varchar\n) as \n \n returnaddress\n \n , \n cast(null as \n varchar\n) as \n \n state\n \n , \n cast(null as \n varchar\n) as \n \n tran_num_prefix\n \n , \n cast(null as \n varchar\n) as \n \n use_bins\n \n , \n cast(null as \n varchar\n) as \n \n zipcode\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n location_id,\n name,\n full_name,\n city,\n country,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__locations\""}, "model.netsuite_source.stg_netsuite__departments": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__departments_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__departments_tmp')),\n staging_columns=get_departments_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('departments_pass_through_columns') %}\n ,\n {{ var('departments_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n \n from base\n),\n\nfinal as (\n \n select \n department_id,\n name,\n full_name,\n _fivetran_deleted\n\n --The below script allows for pass through columns.\n {% if var('departments_pass_through_columns') %}\n ,\n {{ var('departments_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_departments_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__departments_tmp", "model.netsuite_source.stg_netsuite__departments_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__departments"], "unique_id": "model.netsuite_source.stg_netsuite__departments", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__departments.sql", "original_file_path": "models/stg_netsuite__departments.sql", "name": "stg_netsuite__departments", "alias": "stg_netsuite__departments", "checksum": {"name": "sha256", "checksum": "bf0f3510e995f6053932cba38f6a53d5a15d82d960f5b1dcd26b6ed55cabe9fe"}, "tags": [], "refs": [["stg_netsuite__departments_tmp"], ["stg_netsuite__departments_tmp"]], "sources": [], "description": "Table detailing all departments set up in Netsuite.", "columns": {"department_id": {"name": "department_id", "description": "The unique identifier of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The department's full name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__departments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__departments_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n \n \n department_id\n \n as \n \n department_id\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n\n --The below script allows for pass through columns.\n \n \n from base\n),\n\nfinal as (\n \n select \n department_id,\n name,\n full_name,\n _fivetran_deleted\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__departments\""}, "model.netsuite_source.stg_netsuite__currencies": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__currencies_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__currencies_tmp')),\n staging_columns=get_currencies_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n currency_id,\n name,\n symbol,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_currencies_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__currencies_tmp", "model.netsuite_source.stg_netsuite__currencies_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__currencies"], "unique_id": "model.netsuite_source.stg_netsuite__currencies", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__currencies.sql", "original_file_path": "models/stg_netsuite__currencies.sql", "name": "stg_netsuite__currencies", "alias": "stg_netsuite__currencies", "checksum": {"name": "sha256", "checksum": "2a8203a626c5ad01369ddf566febe965a68f7c263f08f58da002125d3eff80c9"}, "tags": [], "refs": [["stg_netsuite__currencies_tmp"], ["stg_netsuite__currencies_tmp"]], "sources": [], "description": "The names and symbols for all currencies set up in Netsuite.", "columns": {"currency_id": {"name": "currency_id", "description": "The unique identifier of the currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "symbol": {"name": "symbol", "description": "The currency's three letter symbol (ie. USD, EUR, CAD).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__currencies.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__currencies_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n varchar\n) as \n \n currency_extid\n \n , \n \n \n currency_id\n \n as \n \n currency_id\n \n, \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n cast(null as \n varchar\n) as \n \n is_inactive\n \n , \n \n \n name\n \n as \n \n name\n \n, \n cast(null as \n float\n) as \n \n precision_0\n \n , \n \n \n symbol\n \n as \n \n symbol\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n currency_id,\n name,\n symbol,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__currencies\""}, "model.netsuite_source.stg_netsuite__vendor_types": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__vendor_types_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__vendor_types_tmp')),\n staging_columns=get_vendor_types_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n vendor_type_id,\n name,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_vendor_types_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__vendor_types_tmp", "model.netsuite_source.stg_netsuite__vendor_types_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__vendor_types"], "unique_id": "model.netsuite_source.stg_netsuite__vendor_types", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__vendor_types.sql", "original_file_path": "models/stg_netsuite__vendor_types.sql", "name": "stg_netsuite__vendor_types", "alias": "stg_netsuite__vendor_types", "checksum": {"name": "sha256", "checksum": "bb93e7ec1ad3c8c6851804dd6dae4f234462ceecdcd5782f2966cd5b6b48cdcd"}, "tags": [], "refs": [["stg_netsuite__vendor_types_tmp"], ["stg_netsuite__vendor_types_tmp"]], "sources": [], "description": "A table detailing all the various types of vendors.", "columns": {"vendor_type_id": {"name": "vendor_type_id", "description": "The unique identifier of the vendor type", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the vendor type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__vendor_types.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendor_types_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n varchar\n) as \n \n isinactive\n \n , \n \n \n name\n \n as \n \n name\n \n, \n cast(null as \n float\n) as \n \n parent_id\n \n , \n cast(null as \n varchar\n) as \n \n vendor_type_extid\n \n , \n \n \n vendor_type_id\n \n as \n \n vendor_type_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n vendor_type_id,\n name,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendor_types\""}, "model.netsuite_source.stg_netsuite__accounting_periods": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_netsuite__accounting_periods_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__accounting_periods_tmp')),\n staging_columns=get_accounting_periods_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n accounting_period_id,\n name,\n full_name,\n fiscal_calendar_id,\n year_id,\n starting as starting_at,\n ending as ending_at,\n quarter,\n year_0,\n is_adjustment,\n closed,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.netsuite_source.get_accounting_periods_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_periods_tmp", "model.netsuite_source.stg_netsuite__accounting_periods_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "stg_netsuite__accounting_periods"], "unique_id": "model.netsuite_source.stg_netsuite__accounting_periods", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "stg_netsuite__accounting_periods.sql", "original_file_path": "models/stg_netsuite__accounting_periods.sql", "name": "stg_netsuite__accounting_periods", "alias": "stg_netsuite__accounting_periods", "checksum": {"name": "sha256", "checksum": "d8819d996c46083b3f4ac899eaea079c313aa6835f283be7e479b54bcce07ea6"}, "tags": [], "refs": [["stg_netsuite__accounting_periods_tmp"], ["stg_netsuite__accounting_periods_tmp"]], "sources": [], "description": "Table detailing all accounting periods, including monthly, quarterly and yearly.", "columns": {"accounting_period_id": {"name": "accounting_period_id", "description": "The unique identifier of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_id": {"name": "year_id", "description": "The year id the accounting period is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fiscal_calendar_id": {"name": "fiscal_calendar_id", "description": "The fiscal calendar id the accounting period is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quarter": {"name": "quarter", "description": "The quarter which the accounting period takes place in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "starting_at": {"name": "starting_at", "description": "The timestamp indicating the start of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ending_at": {"name": "ending_at", "description": "The timestamp indicating the end of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_0": {"name": "year_0", "description": "Value indicating whether the accounting period is in it's initial year.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_adjustment": {"name": "is_adjustment", "description": "Value indicating whether the accounting period is an adjustment (either yes or no).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Value indicating whether the accounting period is closed (either yes or no).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite_source://models/stg_netsuite.yml", "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite__accounting_periods.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "with base as (\n\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_salesforce_source/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n\n \n cast(null as boolean) as \n \n _fivetran_deleted\n \n , \n cast(null as \n varchar\n) as \n \n _fivetran_id\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n \n \n accounting_period_id\n \n as \n \n accounting_period_id\n \n, \n \n \n closed\n \n as \n \n closed\n \n, \n cast(null as \n varchar\n) as \n \n closed_accounts_payable\n \n , \n cast(null as \n varchar\n) as \n \n closed_accounts_receivable\n \n , \n cast(null as \n varchar\n) as \n \n closed_all\n \n , \n cast(null as \n timestamp\n) as \n \n closed_on\n \n , \n cast(null as \n varchar\n) as \n \n closed_payroll\n \n , \n cast(null as \n timestamp\n) as \n \n date_deleted\n \n , \n cast(null as \n timestamp\n) as \n \n date_last_modified\n \n , \n \n \n ending\n \n as \n \n ending\n \n, \n \n \n fiscal_calendar_id\n \n as \n \n fiscal_calendar_id\n \n, \n cast(null as \n varchar\n) as \n \n fivetran_index\n \n , \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n is_adjustment\n \n as \n \n is_adjustment\n \n, \n cast(null as \n varchar\n) as \n \n isinactive\n \n , \n cast(null as \n varchar\n) as \n \n locked_accounts_payable\n \n , \n cast(null as \n varchar\n) as \n \n locked_accounts_receivable\n \n , \n cast(null as \n varchar\n) as \n \n locked_all\n \n , \n cast(null as \n varchar\n) as \n \n locked_payroll\n \n , \n \n \n name\n \n as \n \n name\n \n, \n cast(null as \n float\n) as \n \n parent_id\n \n , \n \n \n quarter\n \n as \n \n quarter\n \n, \n \n \n starting\n \n as \n \n starting\n \n, \n \n \n year_0\n \n as \n \n year_0\n \n, \n \n \n year_id\n \n as \n \n year_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n accounting_period_id,\n name,\n full_name,\n fiscal_calendar_id,\n year_id,\n starting as starting_at,\n ending as ending_at,\n quarter,\n year_0,\n is_adjustment,\n closed,\n _fivetran_deleted\n\n from fields\n)\n\nselect * \nfrom final\nwhere not coalesce(_fivetran_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\""}, "model.netsuite_source.stg_netsuite__accounting_periods_tmp": {"raw_sql": "select * \nfrom {{ var('accounting_periods') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.accounting_periods_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__accounting_periods_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__accounting_periods_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__accounting_periods_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__accounting_periods_tmp.sql", "name": "stg_netsuite__accounting_periods_tmp", "alias": "stg_netsuite__accounting_periods_tmp", "checksum": {"name": "sha256", "checksum": "37b0fc99f88a139849589336915b535b93f80881d4cdc8f4aeb512bca1e5e2b5"}, "tags": [], "refs": [["accounting_periods_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__accounting_periods_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"accounting_periods_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods_tmp\""}, "model.netsuite_source.stg_netsuite__accounting_books_tmp": {"raw_sql": "select * \nfrom {{ var('accounting_books') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.accounting_books_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__accounting_books_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__accounting_books_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__accounting_books_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__accounting_books_tmp.sql", "name": "stg_netsuite__accounting_books_tmp", "alias": "stg_netsuite__accounting_books_tmp", "checksum": {"name": "sha256", "checksum": "672ae882498c5a60f42fc501a2efa14c7719dff1e12dd5259532a760662e7f7a"}, "tags": [], "refs": [["accounting_books_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__accounting_books_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"accounting_books_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books_tmp\""}, "model.netsuite_source.stg_netsuite__customers_tmp": {"raw_sql": "select * \nfrom {{ var('customers') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.customers_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__customers_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__customers_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__customers_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__customers_tmp.sql", "name": "stg_netsuite__customers_tmp", "alias": "stg_netsuite__customers_tmp", "checksum": {"name": "sha256", "checksum": "7a6da414265f879ac1179c3fa8b35cdc92d579e8cbeb14ee7f8176acea94717f"}, "tags": [], "refs": [["customers_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__customers_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"customers_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__customers_tmp\""}, "model.netsuite_source.stg_netsuite__transaction_lines_tmp": {"raw_sql": "select * \nfrom {{ var('transaction_lines') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.transaction_lines_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__transaction_lines_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__transaction_lines_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__transaction_lines_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__transaction_lines_tmp.sql", "name": "stg_netsuite__transaction_lines_tmp", "alias": "stg_netsuite__transaction_lines_tmp", "checksum": {"name": "sha256", "checksum": "b234f02f54dad882aa03d5ecf2c57b682e1e725b508818e007185b445b1c5377"}, "tags": [], "refs": [["transaction_lines_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__transaction_lines_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"transaction_lines_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines_tmp\""}, "model.netsuite_source.stg_netsuite__income_accounts_tmp": {"raw_sql": "select * \nfrom {{ var('income_accounts') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.income_accounts_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__income_accounts_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__income_accounts_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__income_accounts_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__income_accounts_tmp.sql", "name": "stg_netsuite__income_accounts_tmp", "alias": "stg_netsuite__income_accounts_tmp", "checksum": {"name": "sha256", "checksum": "1e0b69d8de773531b477ea6e967b81d8c5af275f261913be4ac73a24d156a44d"}, "tags": [], "refs": [["income_accounts_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__income_accounts_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"income_accounts_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__income_accounts_tmp\""}, "model.netsuite_source.stg_netsuite__accounts_tmp": {"raw_sql": "select * \nfrom {{ var('accounts') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.accounts_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__accounts_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__accounts_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__accounts_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__accounts_tmp.sql", "name": "stg_netsuite__accounts_tmp", "alias": "stg_netsuite__accounts_tmp", "checksum": {"name": "sha256", "checksum": "2c146b1084dc499ea18c9a5e1c94c73f50fd209b32c059786845b9bdd7f2f67e"}, "tags": [], "refs": [["accounts_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__accounts_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"accounts_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts_tmp\""}, "model.netsuite_source.stg_netsuite__departments_tmp": {"raw_sql": "select * \nfrom {{ var('departments') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.departments_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__departments_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__departments_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__departments_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__departments_tmp.sql", "name": "stg_netsuite__departments_tmp", "alias": "stg_netsuite__departments_tmp", "checksum": {"name": "sha256", "checksum": "12b870e18e2f73deee6df6f03c32c6a83aa242b739ef48b2e3659bb0cb02ed9c"}, "tags": [], "refs": [["departments_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__departments_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"departments_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__departments_tmp\""}, "model.netsuite_source.stg_netsuite__currencies_tmp": {"raw_sql": "select * \nfrom {{ var('currencies') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.currencies_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__currencies_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__currencies_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__currencies_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__currencies_tmp.sql", "name": "stg_netsuite__currencies_tmp", "alias": "stg_netsuite__currencies_tmp", "checksum": {"name": "sha256", "checksum": "f70a591c58fbaa98b45518cec8895145244bc4425fe3b52806a211cc1642fa30"}, "tags": [], "refs": [["currencies_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__currencies_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"currencies_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__currencies_tmp\""}, "model.netsuite_source.stg_netsuite__vendor_types_tmp": {"raw_sql": "select * \nfrom {{ var('vendor_types') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.vendor_types_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__vendor_types_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__vendor_types_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__vendor_types_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__vendor_types_tmp.sql", "name": "stg_netsuite__vendor_types_tmp", "alias": "stg_netsuite__vendor_types_tmp", "checksum": {"name": "sha256", "checksum": "09da7c1581904eb447cc86f19e9c2ea570cba759362b66a292bff57f451a20f2"}, "tags": [], "refs": [["vendor_types_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__vendor_types_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"vendor_types_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendor_types_tmp\""}, "model.netsuite_source.stg_netsuite__vendors_tmp": {"raw_sql": "select * \nfrom {{ var('vendors') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.vendors_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__vendors_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__vendors_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__vendors_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__vendors_tmp.sql", "name": "stg_netsuite__vendors_tmp", "alias": "stg_netsuite__vendors_tmp", "checksum": {"name": "sha256", "checksum": "a28390b43a916d9bfd2a9cc0da58469bf4360460474c5b3bbd999afd05efdc0d"}, "tags": [], "refs": [["vendors_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__vendors_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"vendors_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendors_tmp\""}, "model.netsuite_source.stg_netsuite__locations_tmp": {"raw_sql": "select * \nfrom {{ var('locations') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.locations_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__locations_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__locations_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__locations_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__locations_tmp.sql", "name": "stg_netsuite__locations_tmp", "alias": "stg_netsuite__locations_tmp", "checksum": {"name": "sha256", "checksum": "df2534bac90e3709f081742c3bb995e4062955cc495bed1e1975c52b234c525c"}, "tags": [], "refs": [["locations_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__locations_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"locations_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__locations_tmp\""}, "model.netsuite_source.stg_netsuite__items_tmp": {"raw_sql": "select * \nfrom {{ var('items') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.items_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__items_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__items_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__items_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__items_tmp.sql", "name": "stg_netsuite__items_tmp", "alias": "stg_netsuite__items_tmp", "checksum": {"name": "sha256", "checksum": "b161cb5499b4e7b91fc1ec3dc6e0b8f776f37a9d9070369b45465d099cc477aa"}, "tags": [], "refs": [["items_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__items_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"items_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__items_tmp\""}, "model.netsuite_source.stg_netsuite__subsidiaries_tmp": {"raw_sql": "select * \nfrom {{ var('subsidiaries') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.subsidiaries_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__subsidiaries_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__subsidiaries_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__subsidiaries_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__subsidiaries_tmp.sql", "name": "stg_netsuite__subsidiaries_tmp", "alias": "stg_netsuite__subsidiaries_tmp", "checksum": {"name": "sha256", "checksum": "d8cef2bf2319a75db711f6964af07f8ee054a083766cdcaa76a5e4a9a25c3783"}, "tags": [], "refs": [["subsidiaries_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__subsidiaries_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"subsidiaries_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries_tmp\""}, "model.netsuite_source.stg_netsuite__transactions_tmp": {"raw_sql": "select * \nfrom {{ var('transactions') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.transactions_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__transactions_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__transactions_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__transactions_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__transactions_tmp.sql", "name": "stg_netsuite__transactions_tmp", "alias": "stg_netsuite__transactions_tmp", "checksum": {"name": "sha256", "checksum": "d729b8447fa068f1941f3f7d9ae9a4d0c5445b86c869a367effcd25b64b73188"}, "tags": [], "refs": [["transactions_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__transactions_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"transactions_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions_tmp\""}, "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp": {"raw_sql": "select * \nfrom {{ var('consolidated_exchange_rates') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.consolidated_exchange_rates_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__consolidated_exchange_rates_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__consolidated_exchange_rates_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__consolidated_exchange_rates_tmp.sql", "name": "stg_netsuite__consolidated_exchange_rates_tmp", "alias": "stg_netsuite__consolidated_exchange_rates_tmp", "checksum": {"name": "sha256", "checksum": "2d75d2f524a0c79e3c3f28b80f2d32b5c0a2d0bc2966b3d0d4ebfdb846fb33e8"}, "tags": [], "refs": [["consolidated_exchange_rates_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__consolidated_exchange_rates_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"consolidated_exchange_rates_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates_tmp\""}, "model.netsuite_source.stg_netsuite__classes_tmp": {"raw_sql": "select * \nfrom {{ var('classes') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.classes_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__classes_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__classes_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__classes_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__classes_tmp.sql", "name": "stg_netsuite__classes_tmp", "alias": "stg_netsuite__classes_tmp", "checksum": {"name": "sha256", "checksum": "a25075f79a52054372de86e51c39bba108aee19cd3ae09cdf2dae1bbc3c98ecb"}, "tags": [], "refs": [["classes_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__classes_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"classes_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__classes_tmp\""}, "model.netsuite_source.stg_netsuite__expense_accounts_tmp": {"raw_sql": "select * \nfrom {{ var('expense_accounts') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.netsuite_integration_tests.expense_accounts_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_stg_netsuite", "fqn": ["netsuite_source", "tmp", "stg_netsuite__expense_accounts_tmp"], "unique_id": "model.netsuite_source.stg_netsuite__expense_accounts_tmp", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "tmp/stg_netsuite__expense_accounts_tmp.sql", "original_file_path": "models/tmp/stg_netsuite__expense_accounts_tmp.sql", "name": "stg_netsuite__expense_accounts_tmp", "alias": "stg_netsuite__expense_accounts_tmp", "checksum": {"name": "sha256", "checksum": "7072d825bb0dcceb497e3d644b38bfdc2d4a32f846bb4e19736da29689268f68"}, "tags": [], "refs": [["expense_accounts_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/tmp/stg_netsuite__expense_accounts_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_netsuite"}, "created_at": 1631813326, "compiled_sql": "select * \nfrom \"postgres\".\"netsuite_integration_tests\".\"expense_accounts_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__expense_accounts_tmp\""}, "model.netsuite.netsuite__income_statement": {"raw_sql": "with transactions_with_converted_amounts as (\n select * \n from {{ ref('int_netsuite__transactions_with_converted_amounts') }}\n), \n\n--Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n{% if var('income_statement_transaction_detail_columns') != []%}\ntransaction_details as (\n select * \n from {{ ref('netsuite__transaction_details') }}\n), \n{% endif %}\n\naccounts as (\n select * \n from {{ var('accounts') }}\n), \n\naccounting_periods as (\n select * \n from {{ var('accounting_periods') }}\n),\n\nsubsidiaries as (\n select * \n from {{ var('subsidiaries') }}\n),\n\ntransaction_lines as (\n select * \n from {{ var('transaction_lines') }}\n),\n\nclasses as (\n select * \n from {{ var('classes') }}\n),\n\nlocations as (\n select * \n from {{ var('locations') }}\n),\n\ndepartments as (\n select * \n from {{ var('departments') }}\n),\n\nincome_statement as (\n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n accounts.name as account_name,\n accounts.type_name as account_type_name,\n accounts.account_id as account_id,\n accounts.account_number,\n subsidiaries.subsidiary_id,\n subsidiaries.full_name as subsidiary_full_name,\n subsidiaries.name as subsidiary_name,\n\n --The below script allows for accounts table pass through columns.\n {% if var('accounts_pass_through_columns') %}\n\n accounts.{{ var('accounts_pass_through_columns') | join (\", accounts.\")}} ,\n\n {% endif %}\n\n {{ dbt_utils.concat(['accounts.account_number',\"'-'\", 'accounts.name']) }} as account_number_and_name,\n classes.full_name as class_full_name,\n\n --The below script allows for classes table pass through columns.\n {% if var('classes_pass_through_columns') %}\n \n classes.{{ var('classes_pass_through_columns') | join (\", classes.\")}} ,\n\n {% endif %}\n\n locations.full_name as location_full_name,\n departments.full_name as department_full_name,\n\n --The below script allows for departments table pass through columns.\n {% if var('departments_pass_through_columns') %}\n \n departments.{{ var('departments_pass_through_columns') | join (\", departments.\")}} ,\n\n {% endif %}\n\n -converted_amount_using_transaction_accounting_period as converted_amount,\n transactions_with_converted_amounts.account_category as account_category,\n case when lower(accounts.type_name) = 'income' then 1\n when lower(accounts.type_name) = 'cost of goods sold' then 2\n when lower(accounts.type_name) = 'expense' then 3\n when lower(accounts.type_name) = 'other income' then 4\n when lower(accounts.type_name) = 'other expense' then 5\n else null\n end as income_statement_sort_helper\n\n --Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n {% if var('income_statement_transaction_detail_columns') %}\n\n , transaction_details.{{ var('income_statement_transaction_detail_columns') | join (\", transaction_details.\")}}\n\n {% endif %}\n \n \n from transactions_with_converted_amounts\n\n join transaction_lines as transaction_lines\n on transaction_lines.transaction_line_id = transactions_with_converted_amounts.transaction_line_id\n and transaction_lines.transaction_id = transactions_with_converted_amounts.transaction_id\n\n left join classes \n on classes.class_id = transaction_lines.class_id\n\n left join locations\n on locations.location_id = transaction_lines.location_id\n\n left join departments \n on departments.department_id = transaction_lines.department_id\n join accounts on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n \n join subsidiaries\n on transactions_with_converted_amounts.subsidiary_id = subsidiaries.subsidiary_id\n\n --Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n {% if var('income_statement_transaction_detail_columns') != []%}\n join transaction_details\n on transaction_details.transaction_id = transactions_with_converted_amounts.transaction_id\n and transaction_details.transaction_line_id = transactions_with_converted_amounts.transaction_line_id\n {% endif %}\n\n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and transactions_with_converted_amounts.transaction_accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n and transactions_with_converted_amounts.is_income_statement\n)\n\nselect *\nfrom income_statement", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.concat"], "nodes": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__transaction_lines", "model.netsuite_source.stg_netsuite__classes", "model.netsuite_source.stg_netsuite__locations", "model.netsuite_source.stg_netsuite__departments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_netsuite", "fqn": ["netsuite", "netsuite__income_statement"], "unique_id": "model.netsuite.netsuite__income_statement", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "netsuite__income_statement.sql", "original_file_path": "models/netsuite__income_statement.sql", "name": "netsuite__income_statement", "alias": "netsuite__income_statement", "checksum": {"name": "sha256", "checksum": "272bfbfcb2e8885a352f9b179ab8a0dfea4fe0a8ced8fc21cf6e41ddb5bd9e73"}, "tags": [], "refs": [["int_netsuite__transactions_with_converted_amounts"], ["stg_netsuite__accounts"], ["stg_netsuite__accounting_periods"], ["stg_netsuite__subsidiaries"], ["stg_netsuite__transaction_lines"], ["stg_netsuite__classes"], ["stg_netsuite__locations"], ["stg_netsuite__departments"]], "sources": [], "description": "The income statement query uses the transactions_with_converted_amount transformation to recreate all lines necessary for the income statement. It also joins in class, department and location information for enhanced reporting. \n", "columns": {"accounting_period_id": {"name": "accounting_period_id", "description": "The unique identifier of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_ending": {"name": "accounting_period_ending", "description": "End date of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_full_name": {"name": "accounting_period_full_name", "description": "Accounting periods full name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_name": {"name": "accounting_period_name", "description": "Name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_adjustment": {"name": "is_accounting_period_adjustment", "description": "Yes/No field, indicating whether or not the selecting accounting period is an adjustment period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_closed": {"name": "is_accounting_period_closed", "description": "Yes/No field, indicating whether or not the selecting accounting period is closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_type_name": {"name": "account_type_name", "description": "The accounts type name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The unique identifier of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number_and_name": {"name": "account_number_and_name", "description": "Concatenation of account number and account name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_full_name": {"name": "class_full_name", "description": "Full name of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_full_name": {"name": "location_full_name", "description": "Full name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_full_name": {"name": "department_full_name", "description": "Full name of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "converted_amount": {"name": "converted_amount", "description": "Transaction amount, converted into the primary subsidiary's default currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_category": {"name": "account_category", "description": "Category of the account. Options include Asset, Liability, Equity, Expense or Income.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "income_statement_sort_helper": {"name": "income_statement_sort_helper", "description": "Helper column for sorting income statement records.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subsidiary_id": {"name": "subsidiary_id", "description": "The unique identifier of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subsidiary_full_name": {"name": "subsidiary_full_name", "description": "The full name of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subsidiary_name": {"name": "subsidiary_name", "description": "Name of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite://models/netsuite.yml", "compiled_path": "target/compiled/netsuite/models/netsuite__income_statement.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "netsuite"}, "created_at": 1631813326, "compiled_sql": "with __dbt__cte__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\n), \n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n), __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_books as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\n), \n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\nconsolidated_exchange_rates as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n), __dbt__cte__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= now() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n), __dbt__cte__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__cte__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__cte__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n),transactions_with_converted_amounts as (\n select * \n from __dbt__cte__int_netsuite__transactions_with_converted_amounts\n), \n\n--Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n\n\naccounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\nclasses as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__classes\"\n),\n\nlocations as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__locations\"\n),\n\ndepartments as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__departments\"\n),\n\nincome_statement as (\n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n accounts.name as account_name,\n accounts.type_name as account_type_name,\n accounts.account_id as account_id,\n accounts.account_number,\n subsidiaries.subsidiary_id,\n subsidiaries.full_name as subsidiary_full_name,\n subsidiaries.name as subsidiary_name,\n\n --The below script allows for accounts table pass through columns.\n \n\n accounts.account_number || '-' || accounts.name as account_number_and_name,\n classes.full_name as class_full_name,\n\n --The below script allows for classes table pass through columns.\n \n\n locations.full_name as location_full_name,\n departments.full_name as department_full_name,\n\n --The below script allows for departments table pass through columns.\n \n\n -converted_amount_using_transaction_accounting_period as converted_amount,\n transactions_with_converted_amounts.account_category as account_category,\n case when lower(accounts.type_name) = 'income' then 1\n when lower(accounts.type_name) = 'cost of goods sold' then 2\n when lower(accounts.type_name) = 'expense' then 3\n when lower(accounts.type_name) = 'other income' then 4\n when lower(accounts.type_name) = 'other expense' then 5\n else null\n end as income_statement_sort_helper\n\n --Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n \n \n \n from transactions_with_converted_amounts\n\n join transaction_lines as transaction_lines\n on transaction_lines.transaction_line_id = transactions_with_converted_amounts.transaction_line_id\n and transaction_lines.transaction_id = transactions_with_converted_amounts.transaction_id\n\n left join classes \n on classes.class_id = transaction_lines.class_id\n\n left join locations\n on locations.location_id = transaction_lines.location_id\n\n left join departments \n on departments.department_id = transaction_lines.department_id\n join accounts on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n \n join subsidiaries\n on transactions_with_converted_amounts.subsidiary_id = subsidiaries.subsidiary_id\n\n --Below is only used if income statement transaction detail columns are specified dbt_project.yml file.\n \n\n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and transactions_with_converted_amounts.transaction_accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n and transactions_with_converted_amounts.is_income_statement\n)\n\nselect *\nfrom income_statement", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "sql": " __dbt__cte__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\n), \n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n)"}, {"id": "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "sql": " __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_books as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\n), \n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\nconsolidated_exchange_rates as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n)"}, {"id": "model.netsuite.int_netsuite__transaction_and_reporting_periods", "sql": " __dbt__cte__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= now() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n)"}, {"id": "model.netsuite.int_netsuite__transactions_with_converted_amounts", "sql": " __dbt__cte__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__cte__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__cte__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n)"}], "relation_name": "\"postgres\".\"netsuite_integration_tests_netsuite\".\"netsuite__income_statement\""}, "model.netsuite.netsuite__balance_sheet": {"raw_sql": "with transactions_with_converted_amounts as (\n select * \n from {{ref('int_netsuite__transactions_with_converted_amounts')}}\n), \n\n--Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n{% if var('balance_sheet_transaction_detail_columns') != []%}\ntransaction_details as (\n select * \n from {{ ref('netsuite__transaction_details') }}\n), \n{% endif %}\n\naccounts as (\n select * \n from {{ var('accounts') }}\n), \n\naccounting_periods as (\n select * \n from {{ var('accounting_periods') }}\n), \n\nsubsidiaries as (\n select * \n from {{ var('subsidiaries') }}\n),\n\nbalance_sheet as ( \n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n transactions_with_converted_amounts.account_category as account_category,\n case\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 'Net Income'\n when lower(accounts.is_balancesheet) = 'f' then 'Retained Earnings'\n else accounts.name\n end as account_name,\n case\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 'Net Income'\n when lower(accounts.is_balancesheet) = 'f' then 'Retained Earnings'\n else accounts.type_name\n end as account_type_name,\n case\n when lower(accounts.is_balancesheet) = 'f' then null\n else accounts.account_id\n end as account_id,\n case\n when lower(accounts.is_balancesheet) = 'f' then null\n else accounts.account_number\n end as account_number,\n \n --The below script allows for accounts table pass through columns.\n {% if var('accounts_pass_through_columns') %}\n \n accounts.{{ var('accounts_pass_through_columns') | join (\", accounts.\")}} ,\n\n {% endif %}\n\n case\n when lower(accounts.is_balancesheet) = 'f' or lower(transactions_with_converted_amounts.account_category) = 'equity' then -converted_amount_using_transaction_accounting_period\n when lower(accounts.is_leftside) = 'f' then -converted_amount_using_reporting_month\n when lower(accounts.is_leftside) = 't' then converted_amount_using_reporting_month\n else 0\n end as converted_amount,\n \n case\n when lower(accounts.type_name) = 'bank' then 1\n when lower(accounts.type_name) = 'accounts receivable' then 2\n when lower(accounts.type_name) = 'unbilled receivable' then 3\n when lower(accounts.type_name) = 'other current asset' then 4\n when lower(accounts.type_name) = 'fixed asset' then 5\n when lower(accounts.type_name) = 'other asset' then 6\n when lower(accounts.type_name) = 'deferred expense' then 7\n when lower(accounts.type_name) = 'accounts payable' then 8\n when lower(accounts.type_name) = 'credit card' then 9\n when lower(accounts.type_name) = 'other current liability' then 10\n when lower(accounts.type_name) = 'long term liability' then 11\n when lower(accounts.type_name) = 'deferred revenue' then 12\n when lower(accounts.type_name) = 'equity' then 13\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 15\n when lower(accounts.is_balancesheet) = 'f' then 14\n else null\n end as balance_sheet_sort_helper\n \n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n {% if var('balance_sheet_transaction_detail_columns') %}\n \n , transaction_details.{{ var('balance_sheet_transaction_detail_columns') | join (\", transaction_details.\")}}\n\n {% endif %}\n\n from transactions_with_converted_amounts\n \n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n {% if var('balance_sheet_transaction_detail_columns') != []%}\n join transaction_details\n on transaction_details.transaction_id = transactions_with_converted_amounts.transaction_id\n and transaction_details.transaction_line_id = transactions_with_converted_amounts.transaction_line_id\n {% endif %}\n\n\n join accounts \n on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n\n join accounting_periods as transaction_accounting_periods \n on transaction_accounting_periods.accounting_period_id = transactions_with_converted_amounts.transaction_accounting_period_id\n\n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and transaction_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and (lower(accounts.is_balancesheet) = 't'\n or transactions_with_converted_amounts.is_income_statement)\n\n union all\n\n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n 'Equity' as account_category,\n 'Cumulative Translation Adjustment' as account_name,\n 'Cumulative Translation Adjustment' as account_type_name,\n null as account_id,\n null as account_number,\n\n --The below script allows for accounts table pass through columns.\n {% if var('accounts_pass_through_columns') %}\n\n null as {{ var('accounts_pass_through_columns') | join (\", null as \")}} ,\n\n {% endif %}\n\n case\n when lower(account_category) = 'equity' or is_income_statement then converted_amount_using_transaction_accounting_period\n else converted_amount_using_reporting_month\n end as converted_amount,\n 16 as balance_sheet_sort_helper\n\n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n {% if var('balance_sheet_transaction_detail_columns') %}\n\n , transaction_details.{{ var('balance_sheet_transaction_detail_columns') | join (\", transaction_details.\")}}\n\n {% endif %}\n\n from transactions_with_converted_amounts\n\n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n {% if var('balance_sheet_transaction_detail_columns') != []%}\n join transaction_details\n on transaction_details.transaction_id = transactions_with_converted_amounts.transaction_id\n and transaction_details.transaction_line_id = transactions_with_converted_amounts.transaction_line_id\n {% endif %}\n\n join accounts\n on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n \n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and (lower(accounts.is_balancesheet) = 't'\n or transactions_with_converted_amounts.is_income_statement)\n)\n\nselect *\nfrom balance_sheet", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__subsidiaries"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_netsuite", "fqn": ["netsuite", "netsuite__balance_sheet"], "unique_id": "model.netsuite.netsuite__balance_sheet", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "netsuite__balance_sheet.sql", "original_file_path": "models/netsuite__balance_sheet.sql", "name": "netsuite__balance_sheet", "alias": "netsuite__balance_sheet", "checksum": {"name": "sha256", "checksum": "af15e3ccb326a807a0e89aa9265b8df9cda47fefd0a39bc01d8035c00a789e22"}, "tags": [], "refs": [["int_netsuite__transactions_with_converted_amounts"], ["stg_netsuite__accounts"], ["stg_netsuite__accounting_periods"], ["stg_netsuite__subsidiaries"]], "sources": [], "description": "The balance sheet query uses the transactions_with_converted_amount transformation to recreate all lines necessary for the balance sheet. Transactions that are not balance sheet transactions are categorized as either Retained Earnings or Net Income. The Cumulative Translation Adjustment total, which in most cases does not have transactions associated with it, is calculated manually in the second part of the query.\n", "columns": {"accounting_period_id": {"name": "accounting_period_id", "description": "The unique identifier of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_ending": {"name": "accounting_period_ending", "description": "End date of the accounting period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_full_name": {"name": "accounting_period_full_name", "description": "Accounting periods full name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_name": {"name": "accounting_period_name", "description": "Name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_adjustment": {"name": "is_accounting_period_adjustment", "description": "Yes/No field, indicating whether or not the selecting accounting period is an adjustment period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_closed": {"name": "is_accounting_period_closed", "description": "Yes/No field, indicating whether or not the selecting accounting period is closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_category": {"name": "account_category", "description": "Category of the account. Options include Asset, Liability, Equity, Expense or Income.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_type_name": {"name": "account_type_name", "description": "The accounts type name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The unique identifier of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "converted_amount": {"name": "converted_amount", "description": "Transaction amount, converted into the primary subsidiary's default currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "balance_sheet_sort_helper": {"name": "balance_sheet_sort_helper", "description": "Helper column for sorting balance sheet records.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite://models/netsuite.yml", "compiled_path": "target/compiled/netsuite/models/netsuite__balance_sheet.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "netsuite"}, "created_at": 1631813326, "compiled_sql": "with __dbt__cte__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\n), \n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n), __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_books as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\n), \n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\nconsolidated_exchange_rates as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n), __dbt__cte__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= now() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n), __dbt__cte__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__cte__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__cte__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n),transactions_with_converted_amounts as (\n select * \n from __dbt__cte__int_netsuite__transactions_with_converted_amounts\n), \n\n--Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n\n\naccounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n), \n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\nbalance_sheet as ( \n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n transactions_with_converted_amounts.account_category as account_category,\n case\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 'Net Income'\n when lower(accounts.is_balancesheet) = 'f' then 'Retained Earnings'\n else accounts.name\n end as account_name,\n case\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 'Net Income'\n when lower(accounts.is_balancesheet) = 'f' then 'Retained Earnings'\n else accounts.type_name\n end as account_type_name,\n case\n when lower(accounts.is_balancesheet) = 'f' then null\n else accounts.account_id\n end as account_id,\n case\n when lower(accounts.is_balancesheet) = 'f' then null\n else accounts.account_number\n end as account_number,\n \n --The below script allows for accounts table pass through columns.\n \n\n case\n when lower(accounts.is_balancesheet) = 'f' or lower(transactions_with_converted_amounts.account_category) = 'equity' then -converted_amount_using_transaction_accounting_period\n when lower(accounts.is_leftside) = 'f' then -converted_amount_using_reporting_month\n when lower(accounts.is_leftside) = 't' then converted_amount_using_reporting_month\n else 0\n end as converted_amount,\n \n case\n when lower(accounts.type_name) = 'bank' then 1\n when lower(accounts.type_name) = 'accounts receivable' then 2\n when lower(accounts.type_name) = 'unbilled receivable' then 3\n when lower(accounts.type_name) = 'other current asset' then 4\n when lower(accounts.type_name) = 'fixed asset' then 5\n when lower(accounts.type_name) = 'other asset' then 6\n when lower(accounts.type_name) = 'deferred expense' then 7\n when lower(accounts.type_name) = 'accounts payable' then 8\n when lower(accounts.type_name) = 'credit card' then 9\n when lower(accounts.type_name) = 'other current liability' then 10\n when lower(accounts.type_name) = 'long term liability' then 11\n when lower(accounts.type_name) = 'deferred revenue' then 12\n when lower(accounts.type_name) = 'equity' then 13\n when (lower(accounts.is_balancesheet) = 'f' and reporting_accounting_periods.year_id = transaction_accounting_periods.year_id) then 15\n when lower(accounts.is_balancesheet) = 'f' then 14\n else null\n end as balance_sheet_sort_helper\n \n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n \n\n from transactions_with_converted_amounts\n \n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n \n\n\n join accounts \n on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n\n join accounting_periods as transaction_accounting_periods \n on transaction_accounting_periods.accounting_period_id = transactions_with_converted_amounts.transaction_accounting_period_id\n\n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and transaction_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and (lower(accounts.is_balancesheet) = 't'\n or transactions_with_converted_amounts.is_income_statement)\n\n union all\n\n select\n reporting_accounting_periods.accounting_period_id as accounting_period_id,\n reporting_accounting_periods.ending_at as accounting_period_ending,\n reporting_accounting_periods.full_name as accounting_period_full_name,\n reporting_accounting_periods.name as accounting_period_name,\n lower(reporting_accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(reporting_accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n 'Equity' as account_category,\n 'Cumulative Translation Adjustment' as account_name,\n 'Cumulative Translation Adjustment' as account_type_name,\n null as account_id,\n null as account_number,\n\n --The below script allows for accounts table pass through columns.\n \n\n case\n when lower(account_category) = 'equity' or is_income_statement then converted_amount_using_transaction_accounting_period\n else converted_amount_using_reporting_month\n end as converted_amount,\n 16 as balance_sheet_sort_helper\n\n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n \n\n from transactions_with_converted_amounts\n\n --Below is only used if balance sheet transaction detail columns are specified dbt_project.yml file.\n \n\n join accounts\n on accounts.account_id = transactions_with_converted_amounts.account_id\n\n join accounting_periods as reporting_accounting_periods \n on reporting_accounting_periods.accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n \n where reporting_accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null)\n and (lower(accounts.is_balancesheet) = 't'\n or transactions_with_converted_amounts.is_income_statement)\n)\n\nselect *\nfrom balance_sheet", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "sql": " __dbt__cte__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\n), \n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n)"}, {"id": "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "sql": " __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_books as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\n), \n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\nconsolidated_exchange_rates as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n)"}, {"id": "model.netsuite.int_netsuite__transaction_and_reporting_periods", "sql": " __dbt__cte__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= now() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n)"}, {"id": "model.netsuite.int_netsuite__transactions_with_converted_amounts", "sql": " __dbt__cte__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__cte__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__cte__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n)"}], "relation_name": "\"postgres\".\"netsuite_integration_tests_netsuite\".\"netsuite__balance_sheet\""}, "model.netsuite.netsuite__transaction_details": {"raw_sql": "with transactions_with_converted_amounts as (\n select * \n from {{ref('int_netsuite__transactions_with_converted_amounts')}}\n),\n\naccounts as (\n select * \n from {{ var('accounts') }}\n),\n\naccounting_periods as (\n select * \n from {{ var('accounting_periods') }}\n),\n\nsubsidiaries as (\n select * \n from {{ var('subsidiaries') }}\n),\n\ntransaction_lines as (\n select * \n from {{ var('transaction_lines') }}\n),\n\ntransactions as (\n select * \n from {{ var('transactions') }}\n),\n\nincome_accounts as (\n select * \n from {{ var('income_accounts') }}\n),\n\nexpense_accounts as (\n select * \n from {{ var('expense_accounts') }}\n),\n\ncustomers as (\n select * \n from {{ var('customers') }}\n),\n\nitems as (\n select * \n from {{ var('items') }}\n),\n\nlocations as (\n select * \n from {{ var('locations') }}\n),\n\nvendors as (\n select * \n from {{ var('vendors') }}\n),\n\nvendor_types as (\n select * \n from {{ var('vendor_types') }}\n),\n\ndepartments as (\n select * \n from {{ var('departments') }}\n),\n\ncurrencies as (\n select * \n from {{ var('currencies') }}\n),\n\nclasses as (\n select *\n from {{ var('classes') }}\n),\n\ntransaction_details as (\n select\n transaction_lines.transaction_line_id,\n transaction_lines.memo as transaction_memo,\n lower(transaction_lines.non_posting_line) = 'yes' as is_transaction_non_posting,\n transactions.transaction_id,\n transactions.status as transaction_status,\n transactions.transaction_date,\n transactions.due_date_at as transaction_due_date,\n transactions.transaction_type as transaction_type,\n (lower(transactions.is_advanced_intercompany) = 'yes' or lower(transactions.is_intercompany) = 'yes') as is_transaction_intercompany,\n\n --The below script allows for transactions table pass through columns.\n {% if var('transactions_pass_through_columns') %}\n\n transactions.{{ var('transactions_pass_through_columns') | join (\", transactions.\")}} ,\n\n {% endif %}\n\n --The below script allows for transaction lines table pass through columns.\n {% if var('transaction_lines_pass_through_columns') %}\n \n transaction_lines.{{ var('transaction_lines_pass_through_columns') | join (\", transaction_lines.\")}} ,\n\n {% endif %}\n\n accounting_periods.ending_at as accounting_period_ending,\n accounting_periods.full_name as accounting_period_full_name,\n accounting_periods.name as accounting_period_name,\n lower(accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n accounts.name as account_name,\n accounts.type_name as account_type_name,\n accounts.account_id as account_id,\n accounts.account_number,\n\n --The below script allows for accounts table pass through columns.\n {% if var('accounts_pass_through_columns') %}\n \n accounts.{{ var('accounts_pass_through_columns') | join (\", accounts.\")}} ,\n\n {% endif %}\n\n lower(accounts.is_leftside) = 't' as is_account_leftside,\n lower(accounts.type_name) like 'accounts payable%' as is_accounts_payable,\n lower(accounts.type_name) like 'accounts receivable%' as is_accounts_receivable,\n lower(accounts.name) like '%intercompany%' as is_account_intercompany,\n coalesce(parent_account.name, accounts.name) as parent_account_name,\n income_accounts.income_account_id is not null as is_income_account,\n expense_accounts.expense_account_id is not null as is_expense_account,\n customers.company_name,\n customers.city as customer_city,\n customers.state as customer_state,\n customers.zipcode as customer_zipcode,\n customers.country as customer_country,\n customers.date_first_order_at as customer_date_first_order,\n customers.customer_external_id,\n classes.full_name as class_full_name,\n items.name as item_name,\n items.type_name as item_type_name,\n items.sales_description,\n locations.name as location_name,\n locations.city as location_city,\n locations.country as location_country,\n vendor_types.name as vendor_type_name,\n vendors.company_name as vendor_name,\n vendors.create_date_at as vendor_create_date,\n currencies.name as currency_name,\n currencies.symbol as currency_symbol,\n departments.name as department_name,\n\n --The below script allows for departments table pass through columns.\n {% if var('departments_pass_through_columns') %}\n \n departments.{{ var('departments_pass_through_columns') | join (\", departments.\")}} ,\n\n {% endif %}\n\n subsidiaries.name as subsidiary_name,\n case\n when lower(accounts.type_name) = 'income' or lower(accounts.type_name) = 'other income' then -converted_amount_using_transaction_accounting_period\n else converted_amount_using_transaction_accounting_period\n end as converted_amount,\n case\n when lower(accounts.type_name) = 'income' or lower(accounts.type_name) = 'other income' then -transaction_lines.amount\n else transaction_lines.amount\n end as transaction_amount\n from transaction_lines\n\n join transactions\n on transactions.transaction_id = transaction_lines.transaction_id\n\n left join transactions_with_converted_amounts as transactions_with_converted_amounts\n on transactions_with_converted_amounts.transaction_line_id = transaction_lines.transaction_line_id\n and transactions_with_converted_amounts.transaction_id = transaction_lines.transaction_id\n and transactions_with_converted_amounts.transaction_accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n\n left join accounts \n on accounts.account_id = transaction_lines.account_id\n\n left join accounts as parent_account \n on parent_account.account_id = accounts.parent_id\n\n left join accounting_periods \n on accounting_periods.accounting_period_id = transactions.accounting_period_id\n left join income_accounts \n on income_accounts.income_account_id = accounts.account_id\n\n left join expense_accounts \n on expense_accounts.expense_account_id = accounts.account_id\n\n left join customers \n on customers.customer_id = transaction_lines.company_id\n \n left join classes\n on classes.class_id = transaction_lines.class_id\n\n left join items \n on items.item_id = transaction_lines.item_id\n\n left join locations \n on locations.location_id = transaction_lines.location_id\n\n left join vendors \n on vendors.vendor_id = transaction_lines.company_id\n\n left join vendor_types \n on vendor_types.vendor_type_id = vendors.vendor_type_id\n\n left join currencies \n on currencies.currency_id = transactions.currency_id\n\n left join departments \n on departments.department_id = transaction_lines.department_id\n\n join subsidiaries \n on subsidiaries.subsidiary_id = transaction_lines.subsidiary_id\n \n where (accounting_periods.fiscal_calendar_id is null\n or accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null))\n)\n\nselect *\nfrom transaction_details", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__transaction_lines", "model.netsuite_source.stg_netsuite__transactions", "model.netsuite_source.stg_netsuite__income_accounts", "model.netsuite_source.stg_netsuite__expense_accounts", "model.netsuite_source.stg_netsuite__customers", "model.netsuite_source.stg_netsuite__items", "model.netsuite_source.stg_netsuite__locations", "model.netsuite_source.stg_netsuite__vendors", "model.netsuite_source.stg_netsuite__vendor_types", "model.netsuite_source.stg_netsuite__departments", "model.netsuite_source.stg_netsuite__currencies", "model.netsuite_source.stg_netsuite__classes"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_netsuite", "fqn": ["netsuite", "netsuite__transaction_details"], "unique_id": "model.netsuite.netsuite__transaction_details", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "netsuite__transaction_details.sql", "original_file_path": "models/netsuite__transaction_details.sql", "name": "netsuite__transaction_details", "alias": "netsuite__transaction_details", "checksum": {"name": "sha256", "checksum": "aece04f1aedbf6f670ca9a0a225f3127eaa6a24300eab561a5a906a35eac5b94"}, "tags": [], "refs": [["int_netsuite__transactions_with_converted_amounts"], ["stg_netsuite__accounts"], ["stg_netsuite__accounting_periods"], ["stg_netsuite__subsidiaries"], ["stg_netsuite__transaction_lines"], ["stg_netsuite__transactions"], ["stg_netsuite__income_accounts"], ["stg_netsuite__expense_accounts"], ["stg_netsuite__customers"], ["stg_netsuite__items"], ["stg_netsuite__locations"], ["stg_netsuite__vendors"], ["stg_netsuite__vendor_types"], ["stg_netsuite__departments"], ["stg_netsuite__currencies"], ["stg_netsuite__classes"]], "sources": [], "description": "This table uses Netsuite's core table, transaction_lines, and joins a handful of other tables to add more detail to those line items. For all transactions, you are able to see the associated accounting period, account and subsidiary. Where applicable, you can also see information about the customer, location, item, vendor, and department.\n", "columns": {"transaction_line_id": {"name": "transaction_line_id", "description": "Netsuite internal transaction line ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_memo": {"name": "transaction_memo", "description": "Memo associated with the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_transaction_non_posting": {"name": "is_transaction_non_posting", "description": "Yes/No field, indicating whether or not the transaction line is non-posting.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_id": {"name": "transaction_id", "description": "Netsuite internal transaction ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_status": {"name": "transaction_status", "description": "Status of the transaction (Closed, Pending Billing, Billing, etc.).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_date": {"name": "transaction_date", "description": "Timestamp of the date which the transaction occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_due_date": {"name": "transaction_due_date", "description": "Timestamp of the date which the transaction is due.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_type": {"name": "transaction_type", "description": "Type identifier of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_transaction_intercompany": {"name": "is_transaction_intercompany", "description": "Yes/No field, indicating whether or not the transaction is an intercompany transaction or an advanced intercompany transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_ending": {"name": "accounting_period_ending", "description": "End date of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_full_name": {"name": "accounting_period_full_name", "description": "Full name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_name": {"name": "accounting_period_name", "description": "Name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_adjustment": {"name": "is_accounting_period_adjustment", "description": "Yes/No field, indicating whether or not the selecting accounting period is an adjustment period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounting_period_closed": {"name": "is_accounting_period_closed", "description": "Yes/No field, indicating whether or not the selecting accounting period is closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_type_name": {"name": "account_type_name", "description": "The accounts type name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Unique identifier of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_account_leftside": {"name": "is_account_leftside", "description": "Yes/No field indicating whether or not the account is leftside.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounts_payable": {"name": "is_accounts_payable", "description": "Yes/No field indicating whether or not the account type name includes 'accounts payable'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_accounts_receivable": {"name": "is_accounts_receivable", "description": "Yes/No field indicating whether or not the account type name includes 'accounts receivable'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_account_intercompany": {"name": "is_account_intercompany", "description": "Yes/No field indicating whether or not the account type name includes 'intercompany'.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_account_name": {"name": "parent_account_name", "description": "Name of the parent account, if parent account relationship exists. Otherwise, the name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_income_account": {"name": "is_income_account", "description": "Yes/No field indicating whether or not the account is an income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_expense_account": {"name": "is_expense_account", "description": "Yes/No field indicating whether or not the account is an expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company_name": {"name": "company_name", "description": "Name of the company.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_city": {"name": "customer_city", "description": "City where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_state": {"name": "customer_state", "description": "State where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_zipcode": {"name": "customer_zipcode", "description": "Zip Code of the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_country": {"name": "customer_country", "description": "Country where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_date_first_order": {"name": "customer_date_first_order", "description": "Date customer placed first order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_external_id": {"name": "customer_external_id", "description": "The unique identifier of the external customer reference.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_full_name": {"name": "class_full_name", "description": "Full name of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_name": {"name": "item_name", "description": "Name of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_type_name": {"name": "item_type_name", "description": "Type name of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sales_description": {"name": "sales_description", "description": "Description of the item for sales purposes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_name": {"name": "location_name", "description": "Name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_city": {"name": "location_city", "description": "City used as a location reference.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_country": {"name": "location_country", "description": "Country used as a location reference.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_type_name": {"name": "vendor_type_name", "description": "Type name of the vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_name": {"name": "vendor_name", "description": "Name of the vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_create_date": {"name": "vendor_create_date", "description": "Date vendor was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_name": {"name": "currency_name", "description": "Name of the currency used.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_symbol": {"name": "currency_symbol", "description": "Symbol used to identify the currency type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_name": {"name": "department_name", "description": "Name of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subsidiary_name": {"name": "subsidiary_name", "description": "Name of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "converted_amount": {"name": "converted_amount", "description": "Transaction amount, converted into the primary subsidiary's default currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_amount": {"name": "transaction_amount", "description": "Total amount of the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite://models/netsuite.yml", "compiled_path": "target/compiled/netsuite/models/netsuite__transaction_details.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "netsuite"}, "created_at": 1631813326, "compiled_sql": "with __dbt__cte__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\n), \n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n), __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_books as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\n), \n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\nconsolidated_exchange_rates as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n), __dbt__cte__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= now() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n), __dbt__cte__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__cte__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__cte__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n),transactions_with_converted_amounts as (\n select * \n from __dbt__cte__int_netsuite__transactions_with_converted_amounts\n),\n\naccounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n),\n\naccounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\ntransactions as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\n),\n\nincome_accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__income_accounts\"\n),\n\nexpense_accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__expense_accounts\"\n),\n\ncustomers as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__customers\"\n),\n\nitems as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__items\"\n),\n\nlocations as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__locations\"\n),\n\nvendors as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendors\"\n),\n\nvendor_types as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendor_types\"\n),\n\ndepartments as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__departments\"\n),\n\ncurrencies as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__currencies\"\n),\n\nclasses as (\n select *\n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__classes\"\n),\n\ntransaction_details as (\n select\n transaction_lines.transaction_line_id,\n transaction_lines.memo as transaction_memo,\n lower(transaction_lines.non_posting_line) = 'yes' as is_transaction_non_posting,\n transactions.transaction_id,\n transactions.status as transaction_status,\n transactions.transaction_date,\n transactions.due_date_at as transaction_due_date,\n transactions.transaction_type as transaction_type,\n (lower(transactions.is_advanced_intercompany) = 'yes' or lower(transactions.is_intercompany) = 'yes') as is_transaction_intercompany,\n\n --The below script allows for transactions table pass through columns.\n \n\n --The below script allows for transaction lines table pass through columns.\n \n\n accounting_periods.ending_at as accounting_period_ending,\n accounting_periods.full_name as accounting_period_full_name,\n accounting_periods.name as accounting_period_name,\n lower(accounting_periods.is_adjustment) = 'yes' as is_accounting_period_adjustment,\n lower(accounting_periods.closed) = 'yes' as is_accounting_period_closed,\n accounts.name as account_name,\n accounts.type_name as account_type_name,\n accounts.account_id as account_id,\n accounts.account_number,\n\n --The below script allows for accounts table pass through columns.\n \n\n lower(accounts.is_leftside) = 't' as is_account_leftside,\n lower(accounts.type_name) like 'accounts payable%' as is_accounts_payable,\n lower(accounts.type_name) like 'accounts receivable%' as is_accounts_receivable,\n lower(accounts.name) like '%intercompany%' as is_account_intercompany,\n coalesce(parent_account.name, accounts.name) as parent_account_name,\n income_accounts.income_account_id is not null as is_income_account,\n expense_accounts.expense_account_id is not null as is_expense_account,\n customers.company_name,\n customers.city as customer_city,\n customers.state as customer_state,\n customers.zipcode as customer_zipcode,\n customers.country as customer_country,\n customers.date_first_order_at as customer_date_first_order,\n customers.customer_external_id,\n classes.full_name as class_full_name,\n items.name as item_name,\n items.type_name as item_type_name,\n items.sales_description,\n locations.name as location_name,\n locations.city as location_city,\n locations.country as location_country,\n vendor_types.name as vendor_type_name,\n vendors.company_name as vendor_name,\n vendors.create_date_at as vendor_create_date,\n currencies.name as currency_name,\n currencies.symbol as currency_symbol,\n departments.name as department_name,\n\n --The below script allows for departments table pass through columns.\n \n\n subsidiaries.name as subsidiary_name,\n case\n when lower(accounts.type_name) = 'income' or lower(accounts.type_name) = 'other income' then -converted_amount_using_transaction_accounting_period\n else converted_amount_using_transaction_accounting_period\n end as converted_amount,\n case\n when lower(accounts.type_name) = 'income' or lower(accounts.type_name) = 'other income' then -transaction_lines.amount\n else transaction_lines.amount\n end as transaction_amount\n from transaction_lines\n\n join transactions\n on transactions.transaction_id = transaction_lines.transaction_id\n\n left join transactions_with_converted_amounts as transactions_with_converted_amounts\n on transactions_with_converted_amounts.transaction_line_id = transaction_lines.transaction_line_id\n and transactions_with_converted_amounts.transaction_id = transaction_lines.transaction_id\n and transactions_with_converted_amounts.transaction_accounting_period_id = transactions_with_converted_amounts.reporting_accounting_period_id\n\n left join accounts \n on accounts.account_id = transaction_lines.account_id\n\n left join accounts as parent_account \n on parent_account.account_id = accounts.parent_id\n\n left join accounting_periods \n on accounting_periods.accounting_period_id = transactions.accounting_period_id\n left join income_accounts \n on income_accounts.income_account_id = accounts.account_id\n\n left join expense_accounts \n on expense_accounts.expense_account_id = accounts.account_id\n\n left join customers \n on customers.customer_id = transaction_lines.company_id\n \n left join classes\n on classes.class_id = transaction_lines.class_id\n\n left join items \n on items.item_id = transaction_lines.item_id\n\n left join locations \n on locations.location_id = transaction_lines.location_id\n\n left join vendors \n on vendors.vendor_id = transaction_lines.company_id\n\n left join vendor_types \n on vendor_types.vendor_type_id = vendors.vendor_type_id\n\n left join currencies \n on currencies.currency_id = transactions.currency_id\n\n left join departments \n on departments.department_id = transaction_lines.department_id\n\n join subsidiaries \n on subsidiaries.subsidiary_id = transaction_lines.subsidiary_id\n \n where (accounting_periods.fiscal_calendar_id is null\n or accounting_periods.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null))\n)\n\nselect *\nfrom transaction_details", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "sql": " __dbt__cte__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\n), \n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n)"}, {"id": "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "sql": " __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_books as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\n), \n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\nconsolidated_exchange_rates as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n)"}, {"id": "model.netsuite.int_netsuite__transaction_and_reporting_periods", "sql": " __dbt__cte__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= now() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n)"}, {"id": "model.netsuite.int_netsuite__transactions_with_converted_amounts", "sql": " __dbt__cte__int_netsuite__transactions_with_converted_amounts as (\nwith transaction_lines_w_accounting_period as (\n select * \n from __dbt__cte__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__cte__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts\n)"}], "relation_name": "\"postgres\".\"netsuite_integration_tests_netsuite\".\"netsuite__transaction_details\""}, "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map": {"raw_sql": "with accounts as (\n select * \n from {{ var('accounts') }}\n), \n\naccounting_books as (\n select * \n from {{ var('accounting_books') }}\n), \n\nsubsidiaries as (\n select * \n from {{ var('subsidiaries') }}\n),\n\nconsolidated_exchange_rates as (\n select * \n from {{ var('consolidated_exchange_rates') }}\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__accounting_books", "model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__consolidated_exchange_rates"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_netsuite", "fqn": ["netsuite", "intermediate", "int_netsuite__accountxperiod_exchange_rate_map"], "unique_id": "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "intermediate/int_netsuite__accountxperiod_exchange_rate_map.sql", "original_file_path": "models/intermediate/int_netsuite__accountxperiod_exchange_rate_map.sql", "name": "int_netsuite__accountxperiod_exchange_rate_map", "alias": "int_netsuite__accountxperiod_exchange_rate_map", "checksum": {"name": "sha256", "checksum": "0f5324d3cdd13a9f2e177b0779c69e4c17d56f8df2215fbf077ed07cd31db540"}, "tags": [], "refs": [["stg_netsuite__accounts"], ["stg_netsuite__accounting_books"], ["stg_netsuite__subsidiaries"], ["stg_netsuite__consolidated_exchange_rates"]], "sources": [], "description": "(Step 1/4) In order to accurately recreate the balance sheet and income statement, it is necessary to convert all transaction amounts into the currency of the parent subsidiary. The logic gets complicated fast, mostly because of the behavior of the balance sheet. On the balance sheet, the conversion rate you use for a single transaction will differ by accounting period. For example, if a transaction took place in August, and you are generating balances for the December period, you will need to convert the August transaction using the December conversion rate.\nThe first step here is to create a mapping of all accounting periods and the respective exchange rates, by subsidiary. This is called period_exchange_rate_map\nNext, we cross join the accounts table to the period_exchange_rate_map, so we can generate a map of exchange rates, by account, accounting period, and subsidiary.\n", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite://models/netsuite.yml", "compiled_path": "target/compiled/netsuite/models/intermediate/int_netsuite__accountxperiod_exchange_rate_map.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "netsuite"}, "created_at": 1631813326, "compiled_sql": "with accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_books as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\n), \n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\nconsolidated_exchange_rates as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.netsuite.int_netsuite__transaction_lines_w_accounting_period": {"raw_sql": "with transactions as (\n select * \n from {{ var('transactions') }}\n), \n\ntransaction_lines as (\n select * \n from {{ var('transaction_lines') }}\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.netsuite_source.stg_netsuite__transactions", "model.netsuite_source.stg_netsuite__transaction_lines"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_netsuite", "fqn": ["netsuite", "intermediate", "int_netsuite__transaction_lines_w_accounting_period"], "unique_id": "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "intermediate/int_netsuite__transaction_lines_w_accounting_period.sql", "original_file_path": "models/intermediate/int_netsuite__transaction_lines_w_accounting_period.sql", "name": "int_netsuite__transaction_lines_w_accounting_period", "alias": "int_netsuite__transaction_lines_w_accounting_period", "checksum": {"name": "sha256", "checksum": "3d4a2b531a1310fa9d0bb014d33091ce203cfe320b5c04ea43cb3b878823d8cc"}, "tags": [], "refs": [["stg_netsuite__transactions"], ["stg_netsuite__transaction_lines"]], "sources": [], "description": "(Step 2/4) Next, we need to prepare a cleaned version of all transactions we need. Using the transactions and transaction_lines tables, the necessary fields are extracted, and transactions that are deleted, revenue arrangements, or non-posting transactions are filtered out. This is called transaction_lines_w_accounting_period. \n", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite://models/netsuite.yml", "compiled_path": "target/compiled/netsuite/models/intermediate/int_netsuite__transaction_lines_w_accounting_period.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "netsuite"}, "created_at": 1631813326, "compiled_sql": "with transactions as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\n), \n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.netsuite.int_netsuite__transaction_and_reporting_periods": {"raw_sql": "with accounting_periods as (\n select * \n from {{ var('accounting_periods') }}\n),\n\nsubsidiaries as (\n select * \n from {{ var('subsidiaries') }}\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= {{ current_timestamp() }} \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__subsidiaries"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_netsuite", "fqn": ["netsuite", "intermediate", "int_netsuite__transaction_and_reporting_periods"], "unique_id": "model.netsuite.int_netsuite__transaction_and_reporting_periods", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "intermediate/int_netsuite__transaction_and_reporting_periods.sql", "original_file_path": "models/intermediate/int_netsuite__transaction_and_reporting_periods.sql", "name": "int_netsuite__transaction_and_reporting_periods", "alias": "int_netsuite__transaction_and_reporting_periods", "checksum": {"name": "sha256", "checksum": "20ab908cfcb515519b8b841adcf4d0277fa2fa229d15eb85d0f3d8f762c531ba"}, "tags": [], "refs": [["stg_netsuite__accounting_periods"], ["stg_netsuite__subsidiaries"]], "sources": [], "description": "(Step 3/4) Once we have the cleaned transaction_lines_w_accounting_periods, we now need to figure out which exchange rate we should use for the currency conversion. The balance sheet complicates things, as conversion rates vary based on the reporting period. Therefore, all transactions need to be converted not only for the period in which the transaction took place in, but also all subsequent periods. transaction_and_reporting_periods creates the necessary mapping for this.\n", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite://models/netsuite.yml", "compiled_path": "target/compiled/netsuite/models/intermediate/int_netsuite__transaction_and_reporting_periods.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "netsuite"}, "created_at": 1631813326, "compiled_sql": "with accounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= now() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.netsuite.int_netsuite__transactions_with_converted_amounts": {"raw_sql": "with transaction_lines_w_accounting_period as (\n select * \n from {{ ref('int_netsuite__transaction_lines_w_accounting_period') }}\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from {{ ref('int_netsuite__accountxperiod_exchange_rate_map') }}\n), \n\ntransaction_and_reporting_periods as (\n select * \n from {{ ref('int_netsuite__transaction_and_reporting_periods') }}\n), \n\naccounts as (\n select * \n from {{ var('accounts') }}\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "model.netsuite.int_netsuite__transaction_and_reporting_periods", "model.netsuite_source.stg_netsuite__accounts"]}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "netsuite", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_netsuite", "fqn": ["netsuite", "intermediate", "int_netsuite__transactions_with_converted_amounts"], "unique_id": "model.netsuite.int_netsuite__transactions_with_converted_amounts", "package_name": "netsuite", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite", "path": "intermediate/int_netsuite__transactions_with_converted_amounts.sql", "original_file_path": "models/intermediate/int_netsuite__transactions_with_converted_amounts.sql", "name": "int_netsuite__transactions_with_converted_amounts", "alias": "int_netsuite__transactions_with_converted_amounts", "checksum": {"name": "sha256", "checksum": "7514bec273bd23c538bf995cdacaa3e019800c34bbb995f9e1a99442d6212d1f"}, "tags": [], "refs": [["int_netsuite__transaction_lines_w_accounting_period"], ["int_netsuite__accountxperiod_exchange_rate_map"], ["int_netsuite__transaction_and_reporting_periods"], ["stg_netsuite__accounts"]], "sources": [], "description": "(Step 4/4) Now that we have the exchange rates and the unconverted amounts, the next step is to calculate the converted total. Additionally, we add in a couple of extra fields that will help us in our final balance sheet and income statement queries.\n", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "netsuite://models/netsuite.yml", "compiled_path": "target/compiled/netsuite/models/intermediate/int_netsuite__transactions_with_converted_amounts.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "netsuite"}, "created_at": 1631813326, "compiled_sql": "with __dbt__cte__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\n), \n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n), __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_books as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\n), \n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\nconsolidated_exchange_rates as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n), __dbt__cte__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= now() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n),transaction_lines_w_accounting_period as (\n select * \n from __dbt__cte__int_netsuite__transaction_lines_w_accounting_period\n), \n\naccountxperiod_exchange_rate_map as (\n select * \n from __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map\n), \n\ntransaction_and_reporting_periods as (\n select * \n from __dbt__cte__int_netsuite__transaction_and_reporting_periods\n), \n\naccounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n),\n\ntransactions_in_every_calculation_period_w_exchange_rates as (\n select\n transaction_lines_w_accounting_period.*,\n reporting_accounting_period_id,\n exchange_reporting_period.exchange_rate as exchange_rate_reporting_period,\n exchange_transaction_period.exchange_rate as exchange_rate_transaction_period\n from transaction_lines_w_accounting_period\n\n join transaction_and_reporting_periods \n on transaction_and_reporting_periods.accounting_period_id = transaction_lines_w_accounting_period.transaction_accounting_period_id \n\n join accountxperiod_exchange_rate_map as exchange_reporting_period\n on exchange_reporting_period.accounting_period_id = transaction_and_reporting_periods.reporting_accounting_period_id\n and exchange_reporting_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_reporting_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n \n join accountxperiod_exchange_rate_map as exchange_transaction_period\n on exchange_transaction_period.accounting_period_id = transaction_and_reporting_periods.accounting_period_id\n and exchange_transaction_period.account_id = transaction_lines_w_accounting_period.account_id\n and exchange_transaction_period.from_subsidiary_id = transaction_lines_w_accounting_period.subsidiary_id\n), \n\ntransactions_with_converted_amounts as (\n select\n transactions_in_every_calculation_period_w_exchange_rates.*,\n unconverted_amount * exchange_rate_transaction_period as converted_amount_using_transaction_accounting_period,\n unconverted_amount * exchange_rate_reporting_period as converted_amount_using_reporting_month,\n case\n when lower(accounts.type_name) in ('income','other income','expense','other expense','other income','cost of goods sold') then true\n else false \n end as is_income_statement,\n case\n when lower(accounts.type_name) in ('accounts receivable', 'bank', 'deferred expense', 'fixed asset', 'other asset', 'other current asset', 'unbilled receivable') then 'Asset'\n when lower(accounts.type_name) in ('cost of goods sold', 'expense', 'other expense') then 'Expense'\n when lower(accounts.type_name) in ('income', 'other income') then 'Income'\n when lower(accounts.type_name) in ('accounts payable', 'credit card', 'deferred revenue', 'long term liability', 'other current liability') then 'Liability'\n when lower(accounts.type_name) in ('equity', 'retained earnings', 'net income') then 'Equity'\n else null \n end as account_category\n from transactions_in_every_calculation_period_w_exchange_rates\n\n join accounts \n on accounts.account_id = transactions_in_every_calculation_period_w_exchange_rates.account_id \n)\n\nselect * \nfrom transactions_with_converted_amounts", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "sql": " __dbt__cte__int_netsuite__transaction_lines_w_accounting_period as (\nwith transactions as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\n), \n\ntransaction_lines as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n),\n\ntransaction_lines_w_accounting_period as ( -- transaction line totals, by accounts, accounting period and subsidiary\n select\n transaction_lines.transaction_id,\n transaction_lines.transaction_line_id,\n transaction_lines.subsidiary_id,\n transaction_lines.account_id,\n transactions.accounting_period_id as transaction_accounting_period_id,\n coalesce(transaction_lines.amount, 0) as unconverted_amount\n from transaction_lines\n\n join transactions on transactions.transaction_id = transaction_lines.transaction_id\n\n where lower(transactions.transaction_type) != 'revenue arrangement'\n and lower(non_posting_line) != 'yes'\n)\n\nselect * \nfrom transaction_lines_w_accounting_period\n)"}, {"id": "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "sql": " __dbt__cte__int_netsuite__accountxperiod_exchange_rate_map as (\nwith accounts as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\n), \n\naccounting_books as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\n), \n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\nconsolidated_exchange_rates as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\n),\n\nperiod_exchange_rate_map as ( -- exchange rates used, by accounting period, to convert to parent subsidiary\n select\n consolidated_exchange_rates.accounting_period_id,\n consolidated_exchange_rates.average_rate,\n consolidated_exchange_rates.current_rate,\n consolidated_exchange_rates.historical_rate,\n consolidated_exchange_rates.from_subsidiary_id,\n consolidated_exchange_rates.to_subsidiary_id\n from consolidated_exchange_rates\n\n where consolidated_exchange_rates.to_subsidiary_id in (select subsidiary_id from subsidiaries where parent_id is null) -- constrait - only the primary subsidiary has no parent\n and consolidated_exchange_rates.accounting_book_id in (select accounting_book_id from accounting_books where lower(is_primary) = 'yes')\n), \n\naccountxperiod_exchange_rate_map as ( -- account table with exchange rate details by accounting period\n select\n period_exchange_rate_map.accounting_period_id,\n period_exchange_rate_map.from_subsidiary_id,\n period_exchange_rate_map.to_subsidiary_id,\n accounts.account_id,\n case \n when lower(accounts.general_rate_type) = 'historical' then period_exchange_rate_map.historical_rate\n when lower(accounts.general_rate_type) = 'current' then period_exchange_rate_map.current_rate\n when lower(accounts.general_rate_type) = 'average' then period_exchange_rate_map.average_rate\n else null\n end as exchange_rate\n from accounts\n \n cross join period_exchange_rate_map\n)\n\nselect * \nfrom accountxperiod_exchange_rate_map\n)"}, {"id": "model.netsuite.int_netsuite__transaction_and_reporting_periods", "sql": " __dbt__cte__int_netsuite__transaction_and_reporting_periods as (\nwith accounting_periods as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n),\n\nsubsidiaries as (\n select * \n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\n),\n\ntransaction_and_reporting_periods as ( \n select\n base.accounting_period_id as accounting_period_id,\n multiplier.accounting_period_id as reporting_accounting_period_id\n from accounting_periods as base\n\n join accounting_periods as multiplier\n on multiplier.starting_at >= base.starting_at\n and multiplier.quarter = base.quarter\n and multiplier.year_0 = base.year_0\n and multiplier.fiscal_calendar_id = base.fiscal_calendar_id\n and multiplier.starting_at <= now() \n\n where lower(base.quarter) = 'no'\n and lower(base.year_0) = 'no'\n and base.fiscal_calendar_id = (select fiscal_calendar_id from subsidiaries where parent_id is null) -- fiscal calendar will align with parent subsidiary's default calendar\n)\n\nselect * \nfrom transaction_and_reporting_periods\n)"}], "relation_name": null}, "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id.e6f9d0d945": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "accounting_book_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__accounting_books') }} where {{config.get('where')}}) stg_netsuite__accounting_books{% else %}{{ ref('stg_netsuite__accounting_books') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_books"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__accounting_books_accounting_book_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id.e6f9d0d945", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__accounting_books_accounting_book_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__accounting_books_accounting_book_id", "alias": "unique_stg_netsuite__accounting_books_accounting_book_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounting_books"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__accounting_books_accounting_book_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n accounting_book_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\nwhere accounting_book_id is not null\ngroup by accounting_book_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "accounting_book_id"}, "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id.bff848e817": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "accounting_book_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__accounting_books') }} where {{config.get('where')}}) stg_netsuite__accounting_books{% else %}{{ ref('stg_netsuite__accounting_books') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_books"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__accounting_books_accounting_book_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id.bff848e817", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__accounting_books_accounting_book_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__accounting_books_accounting_book_id", "alias": "not_null_stg_netsuite__accounting_books_accounting_book_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounting_books"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__accounting_books_accounting_book_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_books\"\nwhere accounting_book_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "accounting_book_id"}, "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id.24fe28a4c3": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "accounting_period_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__accounting_periods') }} where {{config.get('where')}}) stg_netsuite__accounting_periods{% else %}{{ ref('stg_netsuite__accounting_periods') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_periods"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__accounting_periods_accounting_period_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id.24fe28a4c3", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__accounting_periods_accounting_period_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__accounting_periods_accounting_period_id", "alias": "not_null_stg_netsuite__accounting_periods_accounting_period_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounting_periods"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__accounting_periods_accounting_period_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\nwhere accounting_period_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "accounting_period_id"}, "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id.0bbe26d8b2": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "fiscal_calendar_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__accounting_periods') }} where {{config.get('where')}}) stg_netsuite__accounting_periods{% else %}{{ ref('stg_netsuite__accounting_periods') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_periods"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__accounting_periods_fiscal_calendar_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id.0bbe26d8b2", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__accounting_periods_fiscal_calendar_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__accounting_periods_fiscal_calendar_id", "alias": "not_null_stg_netsuite__accounting_periods_fiscal_calendar_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounting_periods"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__accounting_periods_fiscal_calendar_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\nwhere fiscal_calendar_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "fiscal_calendar_id"}, "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id.9f1ba738bf": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_schema_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_1ce8525af2d081fefdb862c9ad63042d\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["accounting_period_id", "fiscal_calendar_id"], "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__accounting_periods') }} where {{config.get('where')}}) stg_netsuite__accounting_periods{% else %}{{ ref('stg_netsuite__accounting_periods') }}{% endif %}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt_utils.default__test_unique_combination_of_columns"], "nodes": ["model.netsuite_source.stg_netsuite__accounting_periods"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "dbt_utils_unique_combination_o_1ce8525af2d081fefdb862c9ad63042d", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id"], "unique_id": "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id.9f1ba738bf", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/dbt_utils_unique_combination_o_1ce8525af2d081fefdb862c9ad63042d.sql", "original_file_path": "models/stg_netsuite.yml", "name": "dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id", "alias": "dbt_utils_unique_combination_o_1ce8525af2d081fefdb862c9ad63042d", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounting_periods"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/dbt_utils_unique_combination_o_1ce8525af2d081fefdb862c9ad63042d.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_1ce8525af2d081fefdb862c9ad63042d"}, "created_at": 1631813326, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n accounting_period_id, fiscal_calendar_id\n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounting_periods\"\n group by accounting_period_id, fiscal_calendar_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null}, "test.netsuite_source.unique_stg_netsuite__accounts_account_id.3eeab2f9dd": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "account_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__accounts') }} where {{config.get('where')}}) stg_netsuite__accounts{% else %}{{ ref('stg_netsuite__accounts') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__accounts"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__accounts_account_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__accounts_account_id.3eeab2f9dd", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__accounts_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__accounts_account_id", "alias": "unique_stg_netsuite__accounts_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__accounts_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n account_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\nwhere account_id is not null\ngroup by account_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "account_id"}, "test.netsuite_source.not_null_stg_netsuite__accounts_account_id.fecc4e4cbe": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "account_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__accounts') }} where {{config.get('where')}}) stg_netsuite__accounts{% else %}{{ ref('stg_netsuite__accounts') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__accounts"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__accounts_account_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounts_account_id.fecc4e4cbe", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__accounts_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__accounts_account_id", "alias": "not_null_stg_netsuite__accounts_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__accounts_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__accounts\"\nwhere account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "account_id"}, "test.netsuite_source.unique_stg_netsuite__classes_class_id.3440d85229": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "class_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__classes') }} where {{config.get('where')}}) stg_netsuite__classes{% else %}{{ ref('stg_netsuite__classes') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__classes"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__classes_class_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__classes_class_id.3440d85229", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__classes_class_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__classes_class_id", "alias": "unique_stg_netsuite__classes_class_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__classes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__classes_class_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n class_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__classes\"\nwhere class_id is not null\ngroup by class_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "class_id"}, "test.netsuite_source.not_null_stg_netsuite__classes_class_id.ada489e5f0": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "class_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__classes') }} where {{config.get('where')}}) stg_netsuite__classes{% else %}{{ ref('stg_netsuite__classes') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__classes"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__classes_class_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__classes_class_id.ada489e5f0", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__classes_class_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__classes_class_id", "alias": "not_null_stg_netsuite__classes_class_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__classes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__classes_class_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__classes\"\nwhere class_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "class_id"}, "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.22f44c66d2": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}{{ config(alias=\"unique_stg_netsuite__consolida_2fe3f87bba0a20283ee2045219b523ee\") }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "consolidated_exchange_rate_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__consolidated_exchange_rates') }} where {{config.get('where')}}) stg_netsuite__consolidated_exchange_rates{% else %}{{ ref('stg_netsuite__consolidated_exchange_rates') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "unique_stg_netsuite__consolida_2fe3f87bba0a20283ee2045219b523ee", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.22f44c66d2", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__consolida_2fe3f87bba0a20283ee2045219b523ee.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id", "alias": "unique_stg_netsuite__consolida_2fe3f87bba0a20283ee2045219b523ee", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__consolidated_exchange_rates"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__consolida_2fe3f87bba0a20283ee2045219b523ee.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_stg_netsuite__consolida_2fe3f87bba0a20283ee2045219b523ee"}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n consolidated_exchange_rate_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\nwhere consolidated_exchange_rate_id is not null\ngroup by consolidated_exchange_rate_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "consolidated_exchange_rate_id"}, "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.80a48e540a": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}{{ config(alias=\"not_null_stg_netsuite__consoli_701f72321e6216b9c59fbdd954f93e86\") }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "consolidated_exchange_rate_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__consolidated_exchange_rates') }} where {{config.get('where')}}) stg_netsuite__consolidated_exchange_rates{% else %}{{ ref('stg_netsuite__consolidated_exchange_rates') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "not_null_stg_netsuite__consoli_701f72321e6216b9c59fbdd954f93e86", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.80a48e540a", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__consoli_701f72321e6216b9c59fbdd954f93e86.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id", "alias": "not_null_stg_netsuite__consoli_701f72321e6216b9c59fbdd954f93e86", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__consolidated_exchange_rates"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__consoli_701f72321e6216b9c59fbdd954f93e86.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_stg_netsuite__consoli_701f72321e6216b9c59fbdd954f93e86"}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__consolidated_exchange_rates\"\nwhere consolidated_exchange_rate_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "consolidated_exchange_rate_id"}, "test.netsuite_source.unique_stg_netsuite__currencies_currency_id.8cdbdc9bbe": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "currency_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__currencies') }} where {{config.get('where')}}) stg_netsuite__currencies{% else %}{{ ref('stg_netsuite__currencies') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__currencies"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__currencies_currency_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__currencies_currency_id.8cdbdc9bbe", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__currencies_currency_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__currencies_currency_id", "alias": "unique_stg_netsuite__currencies_currency_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__currencies"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__currencies_currency_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n currency_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__currencies\"\nwhere currency_id is not null\ngroup by currency_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "currency_id"}, "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id.212eca61df": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "currency_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__currencies') }} where {{config.get('where')}}) stg_netsuite__currencies{% else %}{{ ref('stg_netsuite__currencies') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__currencies"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__currencies_currency_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id.212eca61df", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__currencies_currency_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__currencies_currency_id", "alias": "not_null_stg_netsuite__currencies_currency_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__currencies"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__currencies_currency_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__currencies\"\nwhere currency_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "currency_id"}, "test.netsuite_source.unique_stg_netsuite__customers_customer_id.29356dc3c4": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__customers') }} where {{config.get('where')}}) stg_netsuite__customers{% else %}{{ ref('stg_netsuite__customers') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__customers"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__customers_customer_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__customers_customer_id.29356dc3c4", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__customers_customer_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__customers_customer_id", "alias": "unique_stg_netsuite__customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__customers_customer_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.netsuite_source.not_null_stg_netsuite__customers_customer_id.c15d024944": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__customers') }} where {{config.get('where')}}) stg_netsuite__customers{% else %}{{ ref('stg_netsuite__customers') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__customers"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__customers_customer_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__customers_customer_id.c15d024944", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__customers_customer_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__customers_customer_id", "alias": "not_null_stg_netsuite__customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__customers_customer_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.netsuite_source.unique_stg_netsuite__departments_department_id.822f26f13f": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "department_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__departments') }} where {{config.get('where')}}) stg_netsuite__departments{% else %}{{ ref('stg_netsuite__departments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__departments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__departments_department_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__departments_department_id.822f26f13f", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__departments_department_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__departments_department_id", "alias": "unique_stg_netsuite__departments_department_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__departments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__departments_department_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n department_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__departments\"\nwhere department_id is not null\ngroup by department_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "department_id"}, "test.netsuite_source.not_null_stg_netsuite__departments_department_id.67c85c30e9": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "department_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__departments') }} where {{config.get('where')}}) stg_netsuite__departments{% else %}{{ ref('stg_netsuite__departments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__departments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__departments_department_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__departments_department_id.67c85c30e9", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__departments_department_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__departments_department_id", "alias": "not_null_stg_netsuite__departments_department_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__departments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__departments_department_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__departments\"\nwhere department_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "department_id"}, "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id.3011426857": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "expense_account_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__expense_accounts') }} where {{config.get('where')}}) stg_netsuite__expense_accounts{% else %}{{ ref('stg_netsuite__expense_accounts') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__expense_accounts"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__expense_accounts_expense_account_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id.3011426857", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__expense_accounts_expense_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__expense_accounts_expense_account_id", "alias": "unique_stg_netsuite__expense_accounts_expense_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__expense_accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__expense_accounts_expense_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n expense_account_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__expense_accounts\"\nwhere expense_account_id is not null\ngroup by expense_account_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "expense_account_id"}, "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id.d681f3e292": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "expense_account_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__expense_accounts') }} where {{config.get('where')}}) stg_netsuite__expense_accounts{% else %}{{ ref('stg_netsuite__expense_accounts') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__expense_accounts"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__expense_accounts_expense_account_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id.d681f3e292", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__expense_accounts_expense_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__expense_accounts_expense_account_id", "alias": "not_null_stg_netsuite__expense_accounts_expense_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__expense_accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__expense_accounts_expense_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__expense_accounts\"\nwhere expense_account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "expense_account_id"}, "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id.8d1b288d60": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "income_account_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__income_accounts') }} where {{config.get('where')}}) stg_netsuite__income_accounts{% else %}{{ ref('stg_netsuite__income_accounts') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__income_accounts"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__income_accounts_income_account_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id.8d1b288d60", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__income_accounts_income_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__income_accounts_income_account_id", "alias": "unique_stg_netsuite__income_accounts_income_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__income_accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__income_accounts_income_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n income_account_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__income_accounts\"\nwhere income_account_id is not null\ngroup by income_account_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "income_account_id"}, "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id.d7c2f10faf": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "income_account_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__income_accounts') }} where {{config.get('where')}}) stg_netsuite__income_accounts{% else %}{{ ref('stg_netsuite__income_accounts') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__income_accounts"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__income_accounts_income_account_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id.d7c2f10faf", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__income_accounts_income_account_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__income_accounts_income_account_id", "alias": "not_null_stg_netsuite__income_accounts_income_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__income_accounts"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__income_accounts_income_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__income_accounts\"\nwhere income_account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "income_account_id"}, "test.netsuite_source.unique_stg_netsuite__items_item_id.9a63c1548b": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "item_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__items') }} where {{config.get('where')}}) stg_netsuite__items{% else %}{{ ref('stg_netsuite__items') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__items"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__items_item_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__items_item_id.9a63c1548b", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__items_item_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__items_item_id", "alias": "unique_stg_netsuite__items_item_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__items"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__items_item_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n item_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__items\"\nwhere item_id is not null\ngroup by item_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "item_id"}, "test.netsuite_source.not_null_stg_netsuite__items_item_id.bc6721fd95": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "item_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__items') }} where {{config.get('where')}}) stg_netsuite__items{% else %}{{ ref('stg_netsuite__items') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__items"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__items_item_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__items_item_id.bc6721fd95", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__items_item_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__items_item_id", "alias": "not_null_stg_netsuite__items_item_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__items"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__items_item_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__items\"\nwhere item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "item_id"}, "test.netsuite_source.unique_stg_netsuite__locations_location_id.3985418f4f": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "location_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__locations') }} where {{config.get('where')}}) stg_netsuite__locations{% else %}{{ ref('stg_netsuite__locations') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__locations"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__locations_location_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__locations_location_id.3985418f4f", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__locations_location_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__locations_location_id", "alias": "unique_stg_netsuite__locations_location_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__locations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__locations_location_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n location_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__locations\"\nwhere location_id is not null\ngroup by location_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "location_id"}, "test.netsuite_source.not_null_stg_netsuite__locations_location_id.f5399a180b": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "location_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__locations') }} where {{config.get('where')}}) stg_netsuite__locations{% else %}{{ ref('stg_netsuite__locations') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__locations"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__locations_location_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__locations_location_id.f5399a180b", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__locations_location_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__locations_location_id", "alias": "not_null_stg_netsuite__locations_location_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__locations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__locations_location_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__locations\"\nwhere location_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "location_id"}, "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id.a3d8b4994f": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "subsidiary_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__subsidiaries') }} where {{config.get('where')}}) stg_netsuite__subsidiaries{% else %}{{ ref('stg_netsuite__subsidiaries') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__subsidiaries"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__subsidiaries_subsidiary_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id.a3d8b4994f", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__subsidiaries_subsidiary_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__subsidiaries_subsidiary_id", "alias": "unique_stg_netsuite__subsidiaries_subsidiary_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__subsidiaries"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__subsidiaries_subsidiary_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n subsidiary_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\nwhere subsidiary_id is not null\ngroup by subsidiary_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "subsidiary_id"}, "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id.8fe6fa82dd": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "subsidiary_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__subsidiaries') }} where {{config.get('where')}}) stg_netsuite__subsidiaries{% else %}{{ ref('stg_netsuite__subsidiaries') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__subsidiaries"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__subsidiaries_subsidiary_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id.8fe6fa82dd", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__subsidiaries_subsidiary_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__subsidiaries_subsidiary_id", "alias": "not_null_stg_netsuite__subsidiaries_subsidiary_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__subsidiaries"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__subsidiaries_subsidiary_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__subsidiaries\"\nwhere subsidiary_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "subsidiary_id"}, "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id.04bcc30b93": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "transaction_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__transaction_lines') }} where {{config.get('where')}}) stg_netsuite__transaction_lines{% else %}{{ ref('stg_netsuite__transaction_lines') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__transaction_lines"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__transaction_lines_transaction_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id.04bcc30b93", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__transaction_lines_transaction_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__transaction_lines_transaction_id", "alias": "not_null_stg_netsuite__transaction_lines_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__transaction_lines"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__transaction_lines_transaction_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\nwhere transaction_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_id"}, "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id.d6e7dd66f9": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "transaction_line_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__transaction_lines') }} where {{config.get('where')}}) stg_netsuite__transaction_lines{% else %}{{ ref('stg_netsuite__transaction_lines') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__transaction_lines"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__transaction_lines_transaction_line_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id.d6e7dd66f9", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__transaction_lines_transaction_line_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__transaction_lines_transaction_line_id", "alias": "not_null_stg_netsuite__transaction_lines_transaction_line_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__transaction_lines"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__transaction_lines_transaction_line_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\nwhere transaction_line_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_line_id"}, "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id.ed3df2b3f3": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_schema_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e15a8751941b43ff25fc24538e6a10ad\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["transaction_id", "transaction_line_id"], "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__transaction_lines') }} where {{config.get('where')}}) stg_netsuite__transaction_lines{% else %}{{ ref('stg_netsuite__transaction_lines') }}{% endif %}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt_utils.default__test_unique_combination_of_columns"], "nodes": ["model.netsuite_source.stg_netsuite__transaction_lines"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "dbt_utils_unique_combination_o_e15a8751941b43ff25fc24538e6a10ad", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id"], "unique_id": "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id.ed3df2b3f3", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/dbt_utils_unique_combination_o_e15a8751941b43ff25fc24538e6a10ad.sql", "original_file_path": "models/stg_netsuite.yml", "name": "dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id", "alias": "dbt_utils_unique_combination_o_e15a8751941b43ff25fc24538e6a10ad", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__transaction_lines"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/dbt_utils_unique_combination_o_e15a8751941b43ff25fc24538e6a10ad.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e15a8751941b43ff25fc24538e6a10ad"}, "created_at": 1631813326, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n transaction_id, transaction_line_id\n from \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transaction_lines\"\n group by transaction_id, transaction_line_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null}, "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id.f5f919ae55": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "transaction_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__transactions') }} where {{config.get('where')}}) stg_netsuite__transactions{% else %}{{ ref('stg_netsuite__transactions') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__transactions"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__transactions_transaction_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id.f5f919ae55", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__transactions_transaction_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__transactions_transaction_id", "alias": "unique_stg_netsuite__transactions_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__transactions"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__transactions_transaction_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n transaction_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\nwhere transaction_id is not null\ngroup by transaction_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_id"}, "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id.5ffb30c533": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "transaction_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__transactions') }} where {{config.get('where')}}) stg_netsuite__transactions{% else %}{{ ref('stg_netsuite__transactions') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__transactions"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__transactions_transaction_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id.5ffb30c533", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__transactions_transaction_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__transactions_transaction_id", "alias": "not_null_stg_netsuite__transactions_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__transactions"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__transactions_transaction_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__transactions\"\nwhere transaction_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_id"}, "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id.dd1afff7b8": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "vendor_type_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__vendor_types') }} where {{config.get('where')}}) stg_netsuite__vendor_types{% else %}{{ ref('stg_netsuite__vendor_types') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__vendor_types"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__vendor_types_vendor_type_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id.dd1afff7b8", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__vendor_types_vendor_type_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__vendor_types_vendor_type_id", "alias": "unique_stg_netsuite__vendor_types_vendor_type_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__vendor_types"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__vendor_types_vendor_type_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n vendor_type_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendor_types\"\nwhere vendor_type_id is not null\ngroup by vendor_type_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "vendor_type_id"}, "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id.aa60434805": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "vendor_type_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__vendor_types') }} where {{config.get('where')}}) stg_netsuite__vendor_types{% else %}{{ ref('stg_netsuite__vendor_types') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__vendor_types"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__vendor_types_vendor_type_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id.aa60434805", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__vendor_types_vendor_type_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__vendor_types_vendor_type_id", "alias": "not_null_stg_netsuite__vendor_types_vendor_type_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__vendor_types"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__vendor_types_vendor_type_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendor_types\"\nwhere vendor_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "vendor_type_id"}, "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id.c10484ef81": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "vendor_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__vendors') }} where {{config.get('where')}}) stg_netsuite__vendors{% else %}{{ ref('stg_netsuite__vendors') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.netsuite_source.stg_netsuite__vendors"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "unique_stg_netsuite__vendors_vendor_id"], "unique_id": "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id.c10484ef81", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/unique_stg_netsuite__vendors_vendor_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "unique_stg_netsuite__vendors_vendor_id", "alias": "unique_stg_netsuite__vendors_vendor_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__vendors"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/unique_stg_netsuite__vendors_vendor_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect\n vendor_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendors\"\nwhere vendor_id is not null\ngroup by vendor_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "vendor_id"}, "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id.2902e05c60": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "vendor_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_netsuite__vendors') }} where {{config.get('where')}}) stg_netsuite__vendors{% else %}{{ ref('stg_netsuite__vendors') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.netsuite_source.stg_netsuite__vendors"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "netsuite_integration_tests_dbt_test__audit", "fqn": ["netsuite_source", "schema_test", "not_null_stg_netsuite__vendors_vendor_id"], "unique_id": "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id.2902e05c60", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "schema_test/not_null_stg_netsuite__vendors_vendor_id.sql", "original_file_path": "models/stg_netsuite.yml", "name": "not_null_stg_netsuite__vendors_vendor_id", "alias": "not_null_stg_netsuite__vendors_vendor_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_netsuite__vendors"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/netsuite_source/models/stg_netsuite.yml/schema_test/not_null_stg_netsuite__vendors_vendor_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1631813326, "compiled_sql": "\n \n \n\nselect *\nfrom \"postgres\".\"netsuite_integration_tests_stg_netsuite\".\"stg_netsuite__vendors\"\nwhere vendor_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "vendor_id"}}, "sources": {"source.netsuite_source.netsuite.accounting_books": {"fqn": ["netsuite_source", "netsuite", "accounting_books"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.accounting_books", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "accounting_books", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "accounting_books", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all accounting books set up in Netsuite.", "columns": {"accounting_book_id": {"name": "accounting_book_id", "description": "The unique identifier of the accounting book.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_primary": {"name": "is_primary", "description": "Boolean indicating whether it is a primary accounting book.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"accounting_books\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.accounting_periods": {"fqn": ["netsuite_source", "netsuite", "accounting_periods"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.accounting_periods", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "accounting_periods", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "accounting_periods", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all accounting periods, including monthly, quarterly and yearly.", "columns": {"accounting_period_id": {"name": "accounting_period_id", "description": "The unique identifier of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_id": {"name": "year_id", "description": "The year id the accounting period is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fiscal_calendar_id": {"name": "fiscal_calendar_id", "description": "The fiscal calendar id the accounting period is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quarter": {"name": "quarter", "description": "The quarter which the accounting period takes place in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "starting": {"name": "starting", "description": "The timestamp indicating the start of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ending": {"name": "ending", "description": "The timestamp indicating the end of the accounting period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_0": {"name": "year_0", "description": "Value indicating whether the accounting period is in it's initial year.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_adjustment": {"name": "is_adjustment", "description": "Value indicating whether the accounting period is an adjustment (either yes or no).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Value indicating whether the accounting period is closed (either yes or no).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"accounting_periods\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.accounts": {"fqn": ["netsuite_source", "netsuite", "accounts"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "accounts", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "accounts", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table that provides a complete listing of every account in the accounting system.", "columns": {"account_id": {"name": "account_id", "description": "The unique identifier associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The accounts associated parent account id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type_name": {"name": "type_name", "description": "The name of the type of the account (ie. Bank, Equity, Income, Expense).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accountingnumber": {"name": "accountingnumber", "description": "The account number associated with the account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "general_rate_type": {"name": "general_rate_type", "description": "The general rate type of the account (Current, Historical, Average).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_leftside": {"name": "is_leftside", "description": "Value indicating whether the account is on the leftside (debit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_balancesheet": {"name": "is_balancesheet", "description": "Value indicating whether the account is a balance sheet account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"accounts\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.classes": {"fqn": ["netsuite_source", "netsuite", "classes"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.classes", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "classes", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "classes", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all classes set up in Netsuite.", "columns": {"class_id": {"name": "class_id", "description": "The unique identifier of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the class.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"classes\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.consolidated_exchange_rates": {"fqn": ["netsuite_source", "netsuite", "consolidated_exchange_rates"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.consolidated_exchange_rates", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "consolidated_exchange_rates", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "consolidated_exchange_rates", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing average, historical and current exchange rates for all accounting periods.", "columns": {"accounting_book_id": {"name": "accounting_book_id", "description": "The accounting book the consolidated exchange rate is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_id": {"name": "accounting_period_id", "description": "The accounting period the consolidated exchange rate is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "average_rate": {"name": "average_rate", "description": "The consolidated exchange rates average rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "current_rate": {"name": "current_rate", "description": "The consolidated exchange rates current rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "historical_rate": {"name": "historical_rate", "description": "The consolidated exchange rates historical rate.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_subsidiary_id": {"name": "from_subsidiary_id", "description": "The subsidiary id which the consolidated exchange rate is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_subsidiary_id": {"name": "to_subsidiary_id", "description": "THe subsidiary id which the consolidated exchange rate is for.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"consolidated_exchange_rates\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.currencies": {"fqn": ["netsuite_source", "netsuite", "currencies"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.currencies", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "currencies", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "currencies", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "The names and symbols for all currencies set up in Netsuite.", "columns": {"currency_id": {"name": "currency_id", "description": "The unique identifier of the currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "symbol": {"name": "symbol", "description": "The currency's three letter symbol (ie. USD, EUR, CAD).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"currencies\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.customers": {"fqn": ["netsuite_source", "netsuite", "customers"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.customers", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "customers", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "customers", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all customer information.", "columns": {"customer_id": {"name": "customer_id", "description": "The unique identifier of the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "companyname": {"name": "companyname", "description": "The name of the company.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_extid": {"name": "customer_extid", "description": "The unique identifier of the external customer reference.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zipcode": {"name": "zipcode", "description": "The zipcode of the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The country where the customer is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_first_order": {"name": "date_first_order", "description": "The timestamp of the customers first order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"customers\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.departments": {"fqn": ["netsuite_source", "netsuite", "departments"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.departments", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "departments", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "departments", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all departments set up in Netsuite.", "columns": {"department_id": {"name": "department_id", "description": "The unique identifier of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the department.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The department's full name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"departments\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.expense_accounts": {"fqn": ["netsuite_source", "netsuite", "expense_accounts"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.expense_accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "expense_accounts", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "expense_accounts", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all expense accounts.", "columns": {"expense_account_id": {"name": "expense_account_id", "description": "The unique identifier of the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The expense account's associated parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "The account number associated with the expense account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"expense_accounts\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.income_accounts": {"fqn": ["netsuite_source", "netsuite", "income_accounts"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.income_accounts", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "income_accounts", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "income_accounts", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all income accounts.", "columns": {"income_account_id": {"name": "income_account_id", "description": "The unique identifier of the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The income account's associated parent account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "The account number associated with the income account.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"income_accounts\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.items": {"fqn": ["netsuite_source", "netsuite", "items"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.items", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "items", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "items", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing information about the items created in Netsuite.", "columns": {"item_id": {"name": "item_id", "description": "The unique identifier of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type_name": {"name": "type_name", "description": "The type of the item (ie. Markup, Service, Discount).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "salesdescription": {"name": "salesdescription", "description": "The items sales description.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"items\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.locations": {"fqn": ["netsuite_source", "netsuite", "locations"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.locations", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "locations", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "locations", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all locations, including store, warehouse and office locations.", "columns": {"location_id": {"name": "location_id", "description": "The unique identifier of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The location's name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The location's city.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The location's country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"locations\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.subsidiaries": {"fqn": ["netsuite_source", "netsuite", "subsidiaries"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.subsidiaries", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "subsidiaries", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "subsidiaries", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Table detailing all subsidiaries.", "columns": {"subsidiary_id": {"name": "subsidiary_id", "description": "The unique identifier of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fiscal_calendar_id": {"name": "fiscal_calendar_id", "description": "The fiscal calendar id associated with the fiscal calendar the subsidiary is on.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The full name of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the subsidiary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The parent subsidiary id which the subsidiary is under.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"subsidiaries\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.transaction_lines": {"fqn": ["netsuite_source", "netsuite", "transaction_lines"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.transaction_lines", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "transaction_lines", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "transaction_lines", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "A table detailing all transaction lines for all transactions.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The transaction id which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_line_id": {"name": "transaction_line_id", "description": "The unique identifier of the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subsidiary_id": {"name": "subsidiary_id", "description": "The subsidiary id of the subsidiary which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The account id of the account linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company_id": {"name": "company_id", "description": "The company id of the company linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_id": {"name": "item_id", "description": "The item id of the item which is included in the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "non_posting_line": {"name": "non_posting_line", "description": "Value indicating whether the transaction line is a non posting line (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_id": {"name": "class_id", "description": "The class id of the class which the transaction line is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The location id of the location which the transaction line took place.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_id": {"name": "department_id", "description": "The department id of the department linked to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "memo": {"name": "memo", "description": "The memo attached to the transaction line.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"transaction_lines\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.transactions": {"fqn": ["netsuite_source", "netsuite", "transactions"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.transactions", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "transactions", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "transactions", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "A table detailing all transactions.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The unique identifier of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction (ie. Paid In Full, Open, Cancelled).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trandate": {"name": "trandate", "description": "The timestamp of the transaction date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_id": {"name": "currency_id", "description": "The currency id of the currency used in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounting_period_id": {"name": "accounting_period_id", "description": "The accounting period id of the accounting period which the transaction took place in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "The timestamp of the transaction due date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "transaction_type": {"name": "transaction_type", "description": "The transaction type (ie. Bill, Check, Deposit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_intercompany": {"name": "is_intercompany", "description": "Value indicating whether the transaction is intercompany (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_advanced_intercompany": {"name": "is_advanced_intercompany", "description": "Value indicating whether the transaction is an advanced intercompany journal entry (either Yes or No).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"transactions\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.vendor_types": {"fqn": ["netsuite_source", "netsuite", "vendor_types"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.vendor_types", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "vendor_types", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "vendor_types", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "A table detailing all the various types of vendors.", "columns": {"vendor_type_id": {"name": "vendor_type_id", "description": "The unique identifier of the vendor type", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the vendor type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"vendor_types\"", "created_at": 1631813326}, "source.netsuite_source.netsuite.vendors": {"fqn": ["netsuite_source", "netsuite", "vendors"], "database": "postgres", "schema": "netsuite", "unique_id": "source.netsuite_source.netsuite.vendors", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "models/src_netsuite.yml", "original_file_path": "models/src_netsuite.yml", "name": "vendors", "source_name": "netsuite", "source_description": "", "loader": "fivetran", "identifier": "vendors", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "A table detailing all vendor information.", "columns": {"vendor_id": {"name": "vendor_id", "description": "The unique identifier of the vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_type_id": {"name": "vendor_type_id", "description": "The vendor type the vendor is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "companyname": {"name": "companyname", "description": "The vendor's company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "The timestamp of the date the vendor was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean created by Fivetran to indicate whether the record has been deleted.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"netsuite\".\"vendors\"", "created_at": 1631813326}}, "macros": {"macro.dbt_postgres.postgres__get_catalog": {"unique_id": "macro.dbt_postgres.postgres__get_catalog", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "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 tbl_desc.description 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 col_desc.description 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 left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres_get_relations": {"unique_id": "macro.dbt_postgres.postgres_get_relations", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__create_table_as": {"unique_id": "macro.dbt_postgres.postgres__create_table_as", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__get_create_index_sql": {"unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }});\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__create_schema": {"unique_id": "macro.dbt_postgres.postgres__create_schema", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__drop_schema": {"unique_id": "macro.dbt_postgres.postgres__drop_schema", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__information_schema_name": {"unique_id": "macro.dbt_postgres.postgres__information_schema_name", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__list_schemas": {"unique_id": "macro.dbt_postgres.postgres__list_schemas", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__check_schema_exists": {"unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__current_timestamp": {"unique_id": "macro.dbt_postgres.postgres__current_timestamp", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__snapshot_get_time": {"unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__make_temp_relation": {"unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix_length = suffix|length + dtstring|length %}\n {% set relation_max_name_length = 63 %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Temp relation suffix is too long (' ~ suffix|length ~ ' characters). Maximum length is ' ~ (relation_max_name_length - dtstring|length) ~ ' characters.') %}\n {% endif %}\n {% set tmp_identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix ~ dtstring %}\n {% do return(base_relation.incorporate(\n path={\n \"identifier\": tmp_identifier,\n \"schema\": none,\n \"database\": none\n })) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres_escape_comment": {"unique_id": "macro.dbt_postgres.postgres_escape_comment", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__alter_relation_comment": {"unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__alter_column_comment": {"unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% for column_name in column_dict %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "package_name": "dbt_postgres", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "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 in ('update'::text, 'delete'::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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "materialization_test_default", "macro_sql": "\n\n{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n \n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n \n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n \n {% do relations.append(target_relation) %}\n \n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n \n {{ adapter.commit() }}\n \n {% else %}\n\n {% set main_sql = sql %}\n \n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n \n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.column_list": {"unique_id": "macro.dbt.column_list", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.column_list_for_create_table": {"unique_id": "macro.dbt.column_list_for_create_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('snapshot_merge_sql')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n ;\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('snapshot_hash_arguments')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('snapshot_get_time')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/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 \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('snapshot_string_as_time')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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['compiled_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": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \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 = config.get('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 (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.run_query", "macro.dbt.snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('create_columns')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('post_snapshot')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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['compiled_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 {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_schema", "macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('create_csv_table')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('reset_csv_table')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('load_csv_rows')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.basic_load_csv_rows": {"unique_id": "macro.dbt.basic_load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.get_seed_column_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.basic_load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ 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 {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.incremental_upsert": {"unique_id": "macro.dbt.incremental_upsert", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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\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 tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% do adapter.drop_relation(intermediate_relation) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\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 {% if need_swap %} \n {% do adapter.rename_relation(target_relation, backup_relation) %} \n {% do adapter.rename_relation(intermediate_relation, target_relation) %} \n {% endif %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.should_full_refresh", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.incremental_upsert", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('get_merge_sql')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('get_delete_insert_merge_sql')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('get_insert_overwrite_merge_sql')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\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_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.common_get_delete_insert_merge_sql": {"unique_id": "macro.dbt.common_get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.common_get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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 {% do create_indexes(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": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.persist_docs", "macro.dbt.drop_relation_if_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs", "macro.dbt.drop_relation_if_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('handle_existing_table', macro_namespace = 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('generate_database_name')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('get_columns_in_query')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('create_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('drop_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('create_table_as')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('create_view_as')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('get_catalog')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('get_columns_in_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('alter_column_type')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('alter_column_comment')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('alter_relation_comment')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('persist_docs')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('drop_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('truncate_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('rename_relation')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('information_schema_name')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('list_schemas')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('check_schema_exists')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('list_relations_without_caching')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('current_timestamp')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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.dispatch('make_temp_relation')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": [], "created_at": 1631813324}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\nselect *\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": [], "created_at": 1631813324}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by 1\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt_utils') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.postgres__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__length"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt_utils')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.redshift__dateadd": {"unique_id": "macro.dbt_utils.redshift__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "redshift__dateadd", "macro_sql": "{% macro redshift__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ return(dbt_utils.default__dateadd(datepart, interval, from_date_or_timestamp)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt_utils') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt_utils')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.redshift__datediff": {"unique_id": "macro.dbt_utils.redshift__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "redshift__datediff", "macro_sql": "{% macro redshift__datediff(first_date, second_date, datepart) %}\n\n {{ return(dbt_utils.default__datediff(first_date, second_date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt_utils') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt_utils') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt_utils') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__cast_bool_to_text": {"unique_id": "macro.dbt_utils.default__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.redshift__cast_bool_to_text": {"unique_id": "macro.dbt_utils.redshift__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "redshift__cast_bool_to_text", "macro_sql": "{% macro redshift__cast_bool_to_text(field) %}\n case\n when {{ field }} is true then 'true'\n when {{ field }} is false then 'false'\n end::text\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\t\n {%- set error_message = '\n Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \\\n Use `adapter.quote` instead. The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {{ return(adapter.dispatch('identifier', 'dbt_utils') (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__identifier"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\t\n \"{{ value }}\"\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\t\n `{{ value }}`\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt_utils') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt_utils') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ return(adapter.dispatch('current_timestamp', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() -%}\n {{ return(adapter.dispatch('current_timestamp_in_utc', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.postgres__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.default__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.snowflake__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.snowflake__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.postgres__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.postgres__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.redshift__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.redshift__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp_in_utc", "macro_sql": "{% macro redshift__current_timestamp_in_utc() %}\n {{ return(dbt_utils.default__current_timestamp_in_utc()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt_utils') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd('month', '3', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc", "macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.redshift__last_day": {"unique_id": "macro.dbt_utils.redshift__last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "redshift__last_day", "macro_sql": "{% macro redshift__last_day(date, datepart) %}\n\n {{ return(dbt_utils.default__last_day(date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt_utils') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt_utils') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "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{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_is_ephemeral.sql", "original_file_path": "macros/cross_db_utils/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n {{ return(adapter.dispatch('get_period_boundaries', 'dbt_utils')(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_boundaries"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_boundaries", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n {{ return(adapter.dispatch('get_period_sql', 'dbt_utils')(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_sql", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.materialization_insert_by_period_default": {"unique_id": "macro.dbt_utils.materialization_insert_by_period_default", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "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 result = load_result('main-' ~ i) %}\n {% if 'response' in result.keys() %} {# added in v0.19.0 #}\n {% set rows_inserted = result['response']['rows_affected'] %}\n {% else %} {# older versions #}\n {% set rows_inserted = result['status'].split(\" \")[2] | int %}\n {% endif %}\n \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('main', status_string) -%}\n -- no-op\n {%- endcall %}\n\n -- Return the relations created in this materialization\n {{ return({'relations': [target_relation]}) }} \n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.log_info", "macro.dbt_utils.get_period_sql", "macro.dbt.noop_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.replace", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt_utils.position", "macro.dbt_utils.split_part", "macro.dbt_utils.right", "macro.dbt_utils.length", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model) %}\n\n{{ config(fail_calc = 'coalesce(row_count_delta, 0)') }}\n\nwith a as (\n\n select count(*) as count_our_model from {{ model }}\n\n),\nb as (\n\n select count(*) as count_comparison_model from {{ compare_model }}\n\n),\ncounts as (\n\n select\n count_our_model,\n count_comparison_model\n from a\n cross join b\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'coalesce(diff_count, 0)') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\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\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n from a\n cross join b\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval) %}\n\n{% set threshold = dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp()) %}\n\nwith recency as (\n\n select max({{field}}) as most_recent\n from {{ model }}\n\n)\n\nselect\n\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name) %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "test_unique_where", "macro_sql": "{% test unique_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.unique_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_unique_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "default__test_unique_where", "macro_sql": "{% macro default__test_unique_where(model, column_name) %}\r\n {{ return(test_unique(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name) %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_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 *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n *\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model) %}\n {{ return(adapter.dispatch('test_not_null_proportion', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\nwith validation as (\n select \n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n),\nvalidation_errors as (\n select\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect \n count(*)\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None) %}\n\nwith windowed as (\n\n select\n {{ column_name }},\n lag({{ column_name }}) over (\n order by {{ column_name }}\n ) as previous_{{ column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, 'previous_' + column_name) }} as {{ dbt_utils.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = previous_{{ column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "test_not_null_where", "macro_sql": "{% test not_null_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.not_null_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_not_null_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_not_null_where": {"unique_id": "macro.dbt_utils.default__test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "default__test_not_null_where", "macro_sql": "{% macro default__test_not_null_where(model, column_name) %}\r\n {{ return(test_not_null(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\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 'a_minus_b' as which_diff, * from a_minus_b\n union all\n select 'b_minus_a' as which_diff, * from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }},\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 {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[]) -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(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\n {%- for col in cols -%}\n\n {%- if col.column|lower not in except|lower -%}\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 -%}{{ adapter.quote(col)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "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 {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if table %}\n {%- set error_message = '\n Warning: the `unpivot` macro no longer accepts a `table` parameter. \\\n This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead. \\\n The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\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 {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n 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( {% if col.data_type == 'boolean' %}\n {{ dbt_utils.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.type_string", "macro.dbt_utils.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column 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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- if varargs|length >= 1 or field_list is string %}\n\n{%- set error_message = '\nWarning: the `surrogate_key` macro now takes a single list argument instead of \\\nmultiple string arguments. Support for multiple string arguments will be \\\ndeprecated in a future release of dbt-utils. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{# first argument is not included in varargs, so add first element to field_list_xf #}\n{%- set field_list_xf = [field_list] -%}\n\n{%- for field in varargs %}\n{%- set _ = field_list_xf.append(field) -%}\n{%- endfor -%}\n\n{%- else -%}\n\n{# if using list, just set field_list_xf as field_list #}\n{%- set field_list_xf = field_list -%}\n\n{%- endif -%}\n\n\n{%- set fields = [] -%}\n\n{%- for field in field_list_xf -%}\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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.hash", "macro.dbt_utils.concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add() -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(*varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n case table_type\n when 'BASE TABLE' then 'table'\n else lower(table_type)\n end as table_type\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', 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 {%- 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\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "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 distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for v in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\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 {{ dbt_utils.slugify(prefix ~ v ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_expense_accounts_columns": {"unique_id": "macro.netsuite_source.get_expense_accounts_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_expense_accounts_columns.sql", "original_file_path": "macros/get_expense_accounts_columns.sql", "name": "get_expense_accounts_columns", "macro_sql": "{% macro get_expense_accounts_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"account_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"comments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"current_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"desription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"expense_account_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_including_child_subs\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_summary\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"legal_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_accounts_columns": {"unique_id": "macro.netsuite_source.get_accounts_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_accounts_columns.sql", "original_file_path": "macros/get_accounts_columns.sql", "name": "get_accounts_columns", "macro_sql": "{% macro get_accounts_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"accountnumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"general_rate_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_balancesheet\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_leftside\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"type_name\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_float", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_classes_columns": {"unique_id": "macro.netsuite_source.get_classes_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_classes_columns.sql", "original_file_path": "macros/get_classes_columns.sql", "name": "get_classes_columns", "macro_sql": "{% macro get_classes_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"class_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_float", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_items_columns": {"unique_id": "macro.netsuite_source.get_items_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_items_columns.sql", "original_file_path": "macros/get_items_columns.sql", "name": "get_items_columns", "macro_sql": "{% macro get_items_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"allow_drop_ship\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"alt_demand_source_item_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"asset_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"atp_lead_time\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"atp_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"available_to_partners\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"avatax_taxcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"averagecost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"backward_consumption_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"build_sub_assemblies\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"class_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"code_of_supply_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"commodity_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"consumption_unit_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"cost_0\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"cost_category\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"cost_estimate_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"costing_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"country_of_manufacture\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_plan_on_event_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"created\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"current_on_order_count\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"custreturn_variance_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_of_last_transaction\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"default_return_cost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"deferred_expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"deferred_revenue_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"demand_source\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"demand_time_fence\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"department_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"deposit\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"displayname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"distribution_category\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"distribution_network\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"dropship_expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"effective_bom_control_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"featureddescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"featureditem\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fixed_lot_size\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"forward_consumption_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"fraud_risk\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fx_adjustment_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"gain_loss_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"handling_cost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"hazmat\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hazmat_hazard_class\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hazmat_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hazmat_item_units\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hazmat_item_units_qty\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"hazmat_packing_group\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hazmat_shipping_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"include_child_subsidiaries\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"income_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"interco_expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"interco_income_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"invt_count_classification\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"invt_count_interval\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"is_cont_rev_handling\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_enforce_min_qty_internally\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_hold_rev_rec\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_moss\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_phantom\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_special_order_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isonline\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"istaxable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"item_defined_cost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"item_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"item_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"item_image\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"item_revenue_category\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"item_term_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"last_cogs_correction\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"last_invt_count_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"last_purchase_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"lot_numbered_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lot_sizing_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"manufacturer\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"manufacturing_charge_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"match_bill_to_receipt\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"matrix_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"maximum_quantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"minimum_quantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"mpn\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"nature_of_transaction_codes_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"next_invt_count_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"ng_asset_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"ns_lead_time\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"offersupport\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"onspecial\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"overhead_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"payment_method_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"periodic_lot_size_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"periodic_lot_size_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"pref_purchase_tax_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"pref_sale_tax_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"pref_stock_level\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"prices_include_tax\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"pricing_group_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"print_sub_items\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"prod_price_var_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"prod_qty_var_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"prompt_payment_discount_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"purchase_price_var_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchase_unit_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchasedescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"purchaseorderamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"quantityavailable\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"quantitybackordered\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"quantityonhand\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"reorder_multiple\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"reorderpoint\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"replenishment_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"resalable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reschedule_in_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"reschedule_out_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"rev_rec_forecast_rule_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"rev_rec_rule_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"revenue_allocation_group\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"round_up_as_component\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"safety_stock_days\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"safety_stock_level\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"sale_unit_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"salesdescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"salesforce_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"salesprice\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"scrap_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"serialized_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shippingcost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"special_work_order_item\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"specialsdescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"stock_unit_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"storedescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"storedetaileddescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"storedisplayname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subtype\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"supplementary_unit__abberviat\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"supplementary_unit_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"supply_time_fence\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"supply_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_item_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"totalvalue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transferprice\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"type_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"type_of_goods_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"udf1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"udf2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"un_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unbuild_variance_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"units_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"upc_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_component_yield\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vendorname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendreturn_variance_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vsoe_deferral\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vsoe_delivered\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vsoe_discount\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vsoe_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"weight\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"weight_in_user_defined_unit\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"weight_unit_index\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"wip_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"wip_cost_variance_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"work_order_lead_time\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_transaction_lines_columns": {"unique_id": "macro.netsuite_source.get_transaction_lines_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_transaction_lines_columns.sql", "original_file_path": "macros/get_transaction_lines_columns.sql", "name": "get_transaction_lines_columns", "macro_sql": "{% macro get_transaction_lines_columns() %}\n\n{% set columns = [\n {\"name\": \"account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"class_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"company_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"department_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"item_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"memo\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"non_posting_line\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transaction_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transaction_line_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_float", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_vendors_columns": {"unique_id": "macro.netsuite_source.get_vendors_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_vendors_columns.sql", "original_file_path": "macros/get_vendors_columns.sql", "name": "get_vendors_columns", "macro_sql": "{% macro get_vendors_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"account_owner\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accountnumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accounts_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"annual_revenue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"auto_renewals\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"auto_send_statements\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billaddress\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_class_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"comments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"companyname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"creditlimit\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"currency_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"dic\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_bill_payment_vouchers\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_cash_sales\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_credit_notes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_invoices\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_item_fulfilments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_purchase_orders\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_quotes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_sales_orders\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_statements\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"employee_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"exemption_certificate_no\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"expense_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"fax\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"home_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hris_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ico\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id_number_in_the_country_of_r\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id_type_in_the_country_of_r_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"in_transit_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"incoterm\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"industry_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"invoice_via_procurement_syste\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"invoicing_details\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is1099eligible\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_partner\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_person\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isemailhtml\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isemailpdf\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"labor_cost\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"last_sales_activity\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"line1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line3\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"loginaccess\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lsa_link\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lsa_link_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"mobile_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"msa_effective_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"no__of_employees\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"openbalance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"openbalance_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"payables_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"payment_terms_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"prepayment_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"printoncheckas\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"purchaseorderamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchases_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"receiptamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"represents_subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"restrict_access_to_expensify\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"salesforce_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipaddress\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subsidiary\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_contact_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_contact_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_contact_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_contact_middle_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxidnum\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"time_approver_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transactions_need_approval\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"uen\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unbilled_orders\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"unbilled_orders_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vat_registration_no\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vendor_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"zipcode\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_accounting_books_columns": {"unique_id": "macro.netsuite_source.get_accounting_books_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_accounting_books_columns.sql", "original_file_path": "macros/get_accounting_books_columns.sql", "name": "get_accounting_books_columns", "macro_sql": "{% macro get_accounting_books_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accounting_book_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accounting_book_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"accounting_book_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"base_book_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_created\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"effective_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"form_template_component_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"form_template_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"is_adjustment_only\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_arrangement_level_reclass\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_consolidated\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_contingent_revenue_handling\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_include_child_subsidiaries\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_primary\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_two_step_revenue_allocation\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unbilled_receivable_grouping\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_departments_columns": {"unique_id": "macro.netsuite_source.get_departments_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_departments_columns.sql", "original_file_path": "macros/get_departments_columns.sql", "name": "get_departments_columns", "macro_sql": "{% macro get_departments_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"department_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_float", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_transactions_columns": {"unique_id": "macro.netsuite_source.get_transactions_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_transactions_columns.sql", "original_file_path": "macros/get_transactions_columns.sql", "name": "get_transactions_columns", "macro_sql": "{% macro get_transactions_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"accounting_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"currency_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"due_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"is_advanced_intercompany\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_intercompany\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"trandate\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"transaction_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transaction_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_float", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_accounting_periods_columns": {"unique_id": "macro.netsuite_source.get_accounting_periods_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_accounting_periods_columns.sql", "original_file_path": "macros/get_accounting_periods_columns.sql", "name": "get_accounting_periods_columns", "macro_sql": "{% macro get_accounting_periods_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accounting_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"closed\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_accounts_payable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_accounts_receivable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_all\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_on\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"closed_payroll\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"ending\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"fiscal_calendar_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"fivetran_index\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_adjustment\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locked_accounts_payable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locked_accounts_receivable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locked_all\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locked_payroll\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"quarter\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"starting\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"year_0\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"year_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_consolidated_exchange_rates_columns": {"unique_id": "macro.netsuite_source.get_consolidated_exchange_rates_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_consolidated_exchange_rates_columns.sql", "original_file_path": "macros/get_consolidated_exchange_rates_columns.sql", "name": "get_consolidated_exchange_rates_columns", "macro_sql": "{% macro get_consolidated_exchange_rates_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accounting_book_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"accounting_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"average_budget_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"average_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consolidated_exchange_rate_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"current_budget_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"current_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"from_subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"historical_budget_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"historical_rate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"to_subsidiary_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_income_accounts_columns": {"unique_id": "macro.netsuite_source.get_income_accounts_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_income_accounts_columns.sql", "original_file_path": "macros/get_income_accounts_columns.sql", "name": "get_income_accounts_columns", "macro_sql": "{% macro get_income_accounts_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"account_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"comments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"current_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"desription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"income_account_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"income_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"is_including_child_subs\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_summary\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"legal_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_customers_columns": {"unique_id": "macro.netsuite_source.get_customers_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_customers_columns.sql", "original_file_path": "macros/get_customers_columns.sql", "name": "get_customers_columns", "macro_sql": "{% macro get_customers_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"account_owner\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accountnumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accounts_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"alcohol_recipient_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"allow_task_time_for_allocation\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"altemail\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"alternate_contact_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"altphone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"amount_complete\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"annual_revenue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"assess_use_tax_on_billavatax\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"auto_renewals\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"auto_send_statements\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billaddress\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_rate_card_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"billing_schedule_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"billing_schedule_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_transaction_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"brn\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"calculated_end\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"category_0\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"comments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"companyname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"consol_days_overdue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_deposit_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_deposit_balance_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_openbalance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_openbalance_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_unbilled_orders\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"consol_unbilled_orders_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"converted_to_contact_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"converted_to_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"cost_estimate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"credithold\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"creditlimit\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"currency_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"customer_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customer_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"customer_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_calculated_start\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_closed\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_convsersion\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_first_order\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_first_sale\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_gross_lead\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_order\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_sale\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_lead\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_prospect\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_scheduled_end\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"days_overdue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"default_order_priority\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"default_receivables_account_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"deposit_balance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"deposit_balance_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"dic\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_cash_sales\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_credit_notes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_invoices\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_item_fulfilments\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_purchase_orders\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_quotes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_sales_orders\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_statements\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"employee_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"exemption_certificate_no\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"expected_close\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"fax\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"first_sale_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"first_visit\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"firstname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"forecast_based_on_allocations\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"forecast_charge_run_on_demand\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"home_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hris_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ico\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id_number_in_the_country_of_r\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id_type_in_the_country_of_r_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"industry_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"invoice_via_procurement_syste\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"invoicing_details\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_exempt_time\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_explicit_conversion\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_job\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_limit_time_to_assignees\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_partner\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_person\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_productive_time\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_project_completely_billed\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_source_item_from_brc\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_utilized_time\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isemailhtml\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isemailpdf\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"istaxable\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"job_end\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"job_start\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"job_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"labor_budget_from_allocations\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"language_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"last_sale_period_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"last_sales_activity\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"last_visit\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"lastname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lead_source_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"line1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line3\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"loginaccess\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lsa_link\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"lsa_link_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"middlename\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"mobile_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"msa_effective_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"multiple_price_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"no__of_employees\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"openbalance\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"openbalance_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"partner_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"payment_terms_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"primary_contact_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"print_on_check_as\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"probability\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"project_expense_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"project_manager_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"projected_end\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"purchases_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"referrer\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reminderdays\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"renewal\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"represents_subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"resalenumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"restrict_access_to_expensify\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"rev_rec_forecast_rule_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"rev_rec_forecast_template\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"revenue_estimate\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"sales_rep_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"sales_territory_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"salesforce_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"salutation\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"scheduling_method_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ship_complete\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipaddress\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status_descr\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status_probability\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"status_read_only\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_contact_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_contact_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_contact_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_contact_middle_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_item_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"third_party_acct\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"third_party_carrier\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"third_party_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"third_party_zip_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"time_approval_type_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"top_level_parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"transactions_need_approval\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"uen\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unbilled_orders\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"unbilled_orders_foreign\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_calculated_billing_budget\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_calculated_cost_budget\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_percent_complete_override\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vat_reg_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vat_registration_no\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"web_lead\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"zipcode\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_locations_columns": {"unique_id": "macro.netsuite_source.get_locations_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_locations_columns.sql", "original_file_path": "macros/get_locations_columns.sql", "name": "get_locations_columns", "macro_sql": "{% macro get_locations_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"address_one\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"address_three\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"address_two\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"addressee\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"attention\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"branch_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inventory_available\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inventory_available_web_store\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_include_in_supply_planning\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"pick_up\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_address_one\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_address_two\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_zipcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"returnaddress\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tran_num_prefix\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_bins\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"zipcode\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_vendor_types_columns": {"unique_id": "macro.netsuite_source.get_vendor_types_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_vendor_types_columns.sql", "original_file_path": "macros/get_vendor_types_columns.sql", "name": "get_vendor_types_columns", "macro_sql": "{% macro get_vendor_types_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vendor_type_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_type_id\", \"datatype\": dbt_utils.type_float()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_subsidiaries_columns": {"unique_id": "macro.netsuite_source.get_subsidiaries_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_subsidiaries_columns.sql", "original_file_path": "macros/get_subsidiaries_columns.sql", "name": "get_subsidiaries_columns", "macro_sql": "{% macro get_subsidiaries_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"address1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"address2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"base_currency_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"branch_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"brn\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"edition\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"federal_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fiscal_calendar_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_elimination\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"is_moss\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"isinactive_bool\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"legal_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"moss_nexus_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"purchaseorderquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"receiptquantitydiff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"return_address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_address1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_address2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"return_zipcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_zipcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state_tax_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subnav__searchable_subsidiary\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"subsidiary_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subsidiary_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"taxonomy_reference_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tran_num_prefix\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"uen\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"zipcode\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.netsuite_source.get_currencies_columns": {"unique_id": "macro.netsuite_source.get_currencies_columns", "package_name": "netsuite_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/netsuite_source", "path": "macros/get_currencies_columns.sql", "original_file_path": "macros/get_currencies_columns.sql", "name": "get_currencies_columns", "macro_sql": "{% macro get_currencies_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"currency_extid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency_id\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"date_deleted\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"date_last_modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"is_inactive\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"precision_0\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"symbol\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.generate_columns_macro": {"unique_id": "macro.fivetran_utils.generate_columns_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/generate_columns_macro.sql", "original_file_path": "macros/generate_columns_macro.sql", "name": "generate_columns_macro", "macro_sql": "{% macro generate_columns_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set columns = get_columns_for_macro(table_name, schema_name, database_name) %}\n\n{% set jinja_macro=[] %}\n\n{% do jinja_macro.append('{% macro get_' ~ table_name ~ '_columns() %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% set columns = [') %}\n\n{% for col in columns %}\n{% do jinja_macro.append(' ' ~ col ~ (',' if not loop.last)) %}\n{% endfor %}\n\n{% do jinja_macro.append('] %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{{ return(columns) }}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% endmacro %}') %}\n\n{% if execute %}\n\n {% set joined = jinja_macro | join ('\\n') %}\n {{ log(joined, info=True) }}\n {% do return(joined) %}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation() -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') () }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation() %}\n\n{% if var('union_schemas', none) %}\n, case\n {% for schema in var('union_schemas') %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var('union_databases', none) %}\n, case\n {% for database in var('union_databases') %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, '' as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias }) if column.alias else base_columns.append({ \"name\": column.name }) %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.staging_models_automation": {"unique_id": "macro.fivetran_utils.staging_models_automation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/staging_models_automation.sql", "original_file_path": "macros/staging_models_automation.sql", "name": "staging_models_automation", "macro_sql": "{% macro staging_models_automation(package, source_schema, source_database, tables) %}\n\n{% set package = \"\"~ package ~\"\" %}\n{% set source_schema = \"\"~ source_schema ~\"\" %}\n{% set source_database = \"\"~ source_database ~\"\" %}\n\n{% set zsh_command = \"source dbt_modules/fivetran_utils/columns_setup.sh '../dbt_\"\"\"~ package ~\"\"\"_source' stg_\"\"\"~ package ~\"\"\" \"\"\"~ source_database ~\"\"\" \"\"\"~ source_schema ~\"\"\" \" %}\n\n{% for t in tables %}\n {% if t != tables[-1] %}\n {% set help_command = zsh_command + t + \" && \\n\" %}\n\n {% else %}\n {% set help_command = zsh_command + t %}\n\n {% endif %}\n {{ log(help_command, info=True) }}\n\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_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 {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.default__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "default__get_columns_for_macro", "macro_sql": "{% macro default__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'text' then 'dbt_utils.type_string()' \n when lower(data_type) = 'boolean' then '\"boolean\"'\n when lower(data_type) = 'number' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float' then 'dbt_utils.type_float()' \n when lower(data_type) = 'date' then '\"date\"'\n end,\n '}')\nfrom {{ database_name }}.information_schema.columns\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.bigquery__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.bigquery__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "bigquery__get_columns_for_macro", "macro_sql": "{% macro bigquery__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'string' then 'dbt_utils.type_string()' \n when lower(data_type) = 'bool' then '\"boolean\"'\n when lower(data_type) = 'numeric' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float64' then 'dbt_utils.type_float()' \n when lower(data_type) = 'int64' then 'dbt_utils.type_int()' \n when lower(data_type) = 'date' then '\"date\"' \n when lower(data_type) = 'datetime' then '\"datetime\"' \n end,\n '}')\nfrom `{{ database_name }}`.{{ schema_name }}.INFORMATION_SCHEMA.COLUMNS\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.get_columns_for_macro": {"unique_id": "macro.fivetran_utils.get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "get_columns_for_macro", "macro_sql": "{% macro get_columns_for_macro(table_name, schema_name, database_name) -%}\n {{ return(adapter.dispatch('get_columns_for_macro')(table_name, schema_name, database_name)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.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\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.name == source.name %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt_utils.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable) -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable) %}\n\n{% if var('union_schemas', none) %}\n\n {% set relations = [] %}\n\n {% for schema in var('union_schemas') %}\n\n {% set relation=adapter.get_relation(\n database=var(database_variable, default_database),\n schema=schema,\n identifier=table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var('union_databases', none) %}\n\n {% set relations = [] %}\n\n {% for database in var('union_databases') %}\n\n {% set relation=adapter.get_relation(\n database=database,\n schema=var(schema_variable, default_schema),\n identifier=table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Netsuite/dbt_netsuite/integration_tests/dbt_modules/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1631813324}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/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."}}, "exposures": {}, "selectors": {}, "disabled": [], "parent_map": {"seed.netsuite_integration_tests.accounting_books_data": [], "seed.netsuite_integration_tests.vendors_data": [], "seed.netsuite_integration_tests.classes_data": [], "seed.netsuite_integration_tests.locations_data": [], "seed.netsuite_integration_tests.consolidated_exchange_rates_data": [], "seed.netsuite_integration_tests.customers_data": [], "seed.netsuite_integration_tests.accounts_data": [], "seed.netsuite_integration_tests.subsidiaries_data": [], "seed.netsuite_integration_tests.currencies_data": [], "seed.netsuite_integration_tests.income_accounts_data": [], "seed.netsuite_integration_tests.expense_accounts_data": [], "seed.netsuite_integration_tests.departments_data": [], "seed.netsuite_integration_tests.vendor_types_data": [], "seed.netsuite_integration_tests.items_data": [], "seed.netsuite_integration_tests.transactions_data": [], "seed.netsuite_integration_tests.transaction_lines_data": [], "seed.netsuite_integration_tests.accounting_periods_data": [], "model.netsuite_source.stg_netsuite__transactions": ["model.netsuite_source.stg_netsuite__transactions_tmp", "model.netsuite_source.stg_netsuite__transactions_tmp"], "model.netsuite_source.stg_netsuite__customers": ["model.netsuite_source.stg_netsuite__customers_tmp", "model.netsuite_source.stg_netsuite__customers_tmp"], "model.netsuite_source.stg_netsuite__accounting_books": ["model.netsuite_source.stg_netsuite__accounting_books_tmp", "model.netsuite_source.stg_netsuite__accounting_books_tmp"], "model.netsuite_source.stg_netsuite__consolidated_exchange_rates": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp", "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp"], "model.netsuite_source.stg_netsuite__transaction_lines": ["model.netsuite_source.stg_netsuite__transaction_lines_tmp", "model.netsuite_source.stg_netsuite__transaction_lines_tmp"], "model.netsuite_source.stg_netsuite__income_accounts": ["model.netsuite_source.stg_netsuite__income_accounts_tmp", "model.netsuite_source.stg_netsuite__income_accounts_tmp"], "model.netsuite_source.stg_netsuite__expense_accounts": ["model.netsuite_source.stg_netsuite__expense_accounts_tmp", "model.netsuite_source.stg_netsuite__expense_accounts_tmp"], "model.netsuite_source.stg_netsuite__vendors": ["model.netsuite_source.stg_netsuite__vendors_tmp", "model.netsuite_source.stg_netsuite__vendors_tmp"], "model.netsuite_source.stg_netsuite__classes": ["model.netsuite_source.stg_netsuite__classes_tmp", "model.netsuite_source.stg_netsuite__classes_tmp"], "model.netsuite_source.stg_netsuite__subsidiaries": ["model.netsuite_source.stg_netsuite__subsidiaries_tmp", "model.netsuite_source.stg_netsuite__subsidiaries_tmp"], "model.netsuite_source.stg_netsuite__accounts": ["model.netsuite_source.stg_netsuite__accounts_tmp", "model.netsuite_source.stg_netsuite__accounts_tmp"], "model.netsuite_source.stg_netsuite__items": ["model.netsuite_source.stg_netsuite__items_tmp", "model.netsuite_source.stg_netsuite__items_tmp"], "model.netsuite_source.stg_netsuite__locations": ["model.netsuite_source.stg_netsuite__locations_tmp", "model.netsuite_source.stg_netsuite__locations_tmp"], "model.netsuite_source.stg_netsuite__departments": ["model.netsuite_source.stg_netsuite__departments_tmp", "model.netsuite_source.stg_netsuite__departments_tmp"], "model.netsuite_source.stg_netsuite__currencies": ["model.netsuite_source.stg_netsuite__currencies_tmp", "model.netsuite_source.stg_netsuite__currencies_tmp"], "model.netsuite_source.stg_netsuite__vendor_types": ["model.netsuite_source.stg_netsuite__vendor_types_tmp", "model.netsuite_source.stg_netsuite__vendor_types_tmp"], "model.netsuite_source.stg_netsuite__accounting_periods": ["model.netsuite_source.stg_netsuite__accounting_periods_tmp", "model.netsuite_source.stg_netsuite__accounting_periods_tmp"], "model.netsuite_source.stg_netsuite__accounting_periods_tmp": ["seed.netsuite_integration_tests.accounting_periods_data"], "model.netsuite_source.stg_netsuite__accounting_books_tmp": ["seed.netsuite_integration_tests.accounting_books_data"], "model.netsuite_source.stg_netsuite__customers_tmp": ["seed.netsuite_integration_tests.customers_data"], "model.netsuite_source.stg_netsuite__transaction_lines_tmp": ["seed.netsuite_integration_tests.transaction_lines_data"], "model.netsuite_source.stg_netsuite__income_accounts_tmp": ["seed.netsuite_integration_tests.income_accounts_data"], "model.netsuite_source.stg_netsuite__accounts_tmp": ["seed.netsuite_integration_tests.accounts_data"], "model.netsuite_source.stg_netsuite__departments_tmp": ["seed.netsuite_integration_tests.departments_data"], "model.netsuite_source.stg_netsuite__currencies_tmp": ["seed.netsuite_integration_tests.currencies_data"], "model.netsuite_source.stg_netsuite__vendor_types_tmp": ["seed.netsuite_integration_tests.vendor_types_data"], "model.netsuite_source.stg_netsuite__vendors_tmp": ["seed.netsuite_integration_tests.vendors_data"], "model.netsuite_source.stg_netsuite__locations_tmp": ["seed.netsuite_integration_tests.locations_data"], "model.netsuite_source.stg_netsuite__items_tmp": ["seed.netsuite_integration_tests.items_data"], "model.netsuite_source.stg_netsuite__subsidiaries_tmp": ["seed.netsuite_integration_tests.subsidiaries_data"], "model.netsuite_source.stg_netsuite__transactions_tmp": ["seed.netsuite_integration_tests.transactions_data"], "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp": ["seed.netsuite_integration_tests.consolidated_exchange_rates_data"], "model.netsuite_source.stg_netsuite__classes_tmp": ["seed.netsuite_integration_tests.classes_data"], "model.netsuite_source.stg_netsuite__expense_accounts_tmp": ["seed.netsuite_integration_tests.expense_accounts_data"], "model.netsuite.netsuite__income_statement": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__classes", "model.netsuite_source.stg_netsuite__departments", "model.netsuite_source.stg_netsuite__locations", "model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__transaction_lines"], "model.netsuite.netsuite__balance_sheet": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__subsidiaries"], "model.netsuite.netsuite__transaction_details": ["model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__classes", "model.netsuite_source.stg_netsuite__currencies", "model.netsuite_source.stg_netsuite__customers", "model.netsuite_source.stg_netsuite__departments", "model.netsuite_source.stg_netsuite__expense_accounts", "model.netsuite_source.stg_netsuite__income_accounts", "model.netsuite_source.stg_netsuite__items", "model.netsuite_source.stg_netsuite__locations", "model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__transaction_lines", "model.netsuite_source.stg_netsuite__transactions", "model.netsuite_source.stg_netsuite__vendor_types", "model.netsuite_source.stg_netsuite__vendors"], "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map": ["model.netsuite_source.stg_netsuite__accounting_books", "model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__consolidated_exchange_rates", "model.netsuite_source.stg_netsuite__subsidiaries"], "model.netsuite.int_netsuite__transaction_lines_w_accounting_period": ["model.netsuite_source.stg_netsuite__transaction_lines", "model.netsuite_source.stg_netsuite__transactions"], "model.netsuite.int_netsuite__transaction_and_reporting_periods": ["model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__subsidiaries"], "model.netsuite.int_netsuite__transactions_with_converted_amounts": ["model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "model.netsuite.int_netsuite__transaction_and_reporting_periods", "model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "model.netsuite_source.stg_netsuite__accounts"], "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id.e6f9d0d945": ["model.netsuite_source.stg_netsuite__accounting_books"], "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id.bff848e817": ["model.netsuite_source.stg_netsuite__accounting_books"], "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id.24fe28a4c3": ["model.netsuite_source.stg_netsuite__accounting_periods"], "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id.0bbe26d8b2": ["model.netsuite_source.stg_netsuite__accounting_periods"], "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id.9f1ba738bf": ["model.netsuite_source.stg_netsuite__accounting_periods"], "test.netsuite_source.unique_stg_netsuite__accounts_account_id.3eeab2f9dd": ["model.netsuite_source.stg_netsuite__accounts"], "test.netsuite_source.not_null_stg_netsuite__accounts_account_id.fecc4e4cbe": ["model.netsuite_source.stg_netsuite__accounts"], "test.netsuite_source.unique_stg_netsuite__classes_class_id.3440d85229": ["model.netsuite_source.stg_netsuite__classes"], "test.netsuite_source.not_null_stg_netsuite__classes_class_id.ada489e5f0": ["model.netsuite_source.stg_netsuite__classes"], "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.22f44c66d2": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates"], "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.80a48e540a": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates"], "test.netsuite_source.unique_stg_netsuite__currencies_currency_id.8cdbdc9bbe": ["model.netsuite_source.stg_netsuite__currencies"], "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id.212eca61df": ["model.netsuite_source.stg_netsuite__currencies"], "test.netsuite_source.unique_stg_netsuite__customers_customer_id.29356dc3c4": ["model.netsuite_source.stg_netsuite__customers"], "test.netsuite_source.not_null_stg_netsuite__customers_customer_id.c15d024944": ["model.netsuite_source.stg_netsuite__customers"], "test.netsuite_source.unique_stg_netsuite__departments_department_id.822f26f13f": ["model.netsuite_source.stg_netsuite__departments"], "test.netsuite_source.not_null_stg_netsuite__departments_department_id.67c85c30e9": ["model.netsuite_source.stg_netsuite__departments"], "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id.3011426857": ["model.netsuite_source.stg_netsuite__expense_accounts"], "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id.d681f3e292": ["model.netsuite_source.stg_netsuite__expense_accounts"], "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id.8d1b288d60": ["model.netsuite_source.stg_netsuite__income_accounts"], "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id.d7c2f10faf": ["model.netsuite_source.stg_netsuite__income_accounts"], "test.netsuite_source.unique_stg_netsuite__items_item_id.9a63c1548b": ["model.netsuite_source.stg_netsuite__items"], "test.netsuite_source.not_null_stg_netsuite__items_item_id.bc6721fd95": ["model.netsuite_source.stg_netsuite__items"], "test.netsuite_source.unique_stg_netsuite__locations_location_id.3985418f4f": ["model.netsuite_source.stg_netsuite__locations"], "test.netsuite_source.not_null_stg_netsuite__locations_location_id.f5399a180b": ["model.netsuite_source.stg_netsuite__locations"], "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id.a3d8b4994f": ["model.netsuite_source.stg_netsuite__subsidiaries"], "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id.8fe6fa82dd": ["model.netsuite_source.stg_netsuite__subsidiaries"], "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id.04bcc30b93": ["model.netsuite_source.stg_netsuite__transaction_lines"], "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id.d6e7dd66f9": ["model.netsuite_source.stg_netsuite__transaction_lines"], "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id.ed3df2b3f3": ["model.netsuite_source.stg_netsuite__transaction_lines"], "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id.f5f919ae55": ["model.netsuite_source.stg_netsuite__transactions"], "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id.5ffb30c533": ["model.netsuite_source.stg_netsuite__transactions"], "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id.dd1afff7b8": ["model.netsuite_source.stg_netsuite__vendor_types"], "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id.aa60434805": ["model.netsuite_source.stg_netsuite__vendor_types"], "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id.c10484ef81": ["model.netsuite_source.stg_netsuite__vendors"], "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id.2902e05c60": ["model.netsuite_source.stg_netsuite__vendors"], "source.netsuite_source.netsuite.accounting_books": [], "source.netsuite_source.netsuite.accounting_periods": [], "source.netsuite_source.netsuite.accounts": [], "source.netsuite_source.netsuite.classes": [], "source.netsuite_source.netsuite.consolidated_exchange_rates": [], "source.netsuite_source.netsuite.currencies": [], "source.netsuite_source.netsuite.customers": [], "source.netsuite_source.netsuite.departments": [], "source.netsuite_source.netsuite.expense_accounts": [], "source.netsuite_source.netsuite.income_accounts": [], "source.netsuite_source.netsuite.items": [], "source.netsuite_source.netsuite.locations": [], "source.netsuite_source.netsuite.subsidiaries": [], "source.netsuite_source.netsuite.transaction_lines": [], "source.netsuite_source.netsuite.transactions": [], "source.netsuite_source.netsuite.vendor_types": [], "source.netsuite_source.netsuite.vendors": []}, "child_map": {"seed.netsuite_integration_tests.accounting_books_data": ["model.netsuite_source.stg_netsuite__accounting_books_tmp"], "seed.netsuite_integration_tests.vendors_data": ["model.netsuite_source.stg_netsuite__vendors_tmp"], "seed.netsuite_integration_tests.classes_data": ["model.netsuite_source.stg_netsuite__classes_tmp"], "seed.netsuite_integration_tests.locations_data": ["model.netsuite_source.stg_netsuite__locations_tmp"], "seed.netsuite_integration_tests.consolidated_exchange_rates_data": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp"], "seed.netsuite_integration_tests.customers_data": ["model.netsuite_source.stg_netsuite__customers_tmp"], "seed.netsuite_integration_tests.accounts_data": ["model.netsuite_source.stg_netsuite__accounts_tmp"], "seed.netsuite_integration_tests.subsidiaries_data": ["model.netsuite_source.stg_netsuite__subsidiaries_tmp"], "seed.netsuite_integration_tests.currencies_data": ["model.netsuite_source.stg_netsuite__currencies_tmp"], "seed.netsuite_integration_tests.income_accounts_data": ["model.netsuite_source.stg_netsuite__income_accounts_tmp"], "seed.netsuite_integration_tests.expense_accounts_data": ["model.netsuite_source.stg_netsuite__expense_accounts_tmp"], "seed.netsuite_integration_tests.departments_data": ["model.netsuite_source.stg_netsuite__departments_tmp"], "seed.netsuite_integration_tests.vendor_types_data": ["model.netsuite_source.stg_netsuite__vendor_types_tmp"], "seed.netsuite_integration_tests.items_data": ["model.netsuite_source.stg_netsuite__items_tmp"], "seed.netsuite_integration_tests.transactions_data": ["model.netsuite_source.stg_netsuite__transactions_tmp"], "seed.netsuite_integration_tests.transaction_lines_data": ["model.netsuite_source.stg_netsuite__transaction_lines_tmp"], "seed.netsuite_integration_tests.accounting_periods_data": ["model.netsuite_source.stg_netsuite__accounting_periods_tmp"], "model.netsuite_source.stg_netsuite__transactions": ["model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id.5ffb30c533", "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id.f5f919ae55"], "model.netsuite_source.stg_netsuite__customers": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__customers_customer_id.c15d024944", "test.netsuite_source.unique_stg_netsuite__customers_customer_id.29356dc3c4"], "model.netsuite_source.stg_netsuite__accounting_books": ["model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id.bff848e817", "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id.e6f9d0d945"], "model.netsuite_source.stg_netsuite__consolidated_exchange_rates": ["model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.80a48e540a", "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.22f44c66d2"], "model.netsuite_source.stg_netsuite__transaction_lines": ["model.netsuite.int_netsuite__transaction_lines_w_accounting_period", "model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id.ed3df2b3f3", "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id.04bcc30b93", "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id.d6e7dd66f9"], "model.netsuite_source.stg_netsuite__income_accounts": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id.d7c2f10faf", "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id.8d1b288d60"], "model.netsuite_source.stg_netsuite__expense_accounts": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id.d681f3e292", "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id.3011426857"], "model.netsuite_source.stg_netsuite__vendors": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id.2902e05c60", "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id.c10484ef81"], "model.netsuite_source.stg_netsuite__classes": ["model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__classes_class_id.ada489e5f0", "test.netsuite_source.unique_stg_netsuite__classes_class_id.3440d85229"], "model.netsuite_source.stg_netsuite__subsidiaries": ["model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "model.netsuite.int_netsuite__transaction_and_reporting_periods", "model.netsuite.netsuite__balance_sheet", "model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id.8fe6fa82dd", "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id.a3d8b4994f"], "model.netsuite_source.stg_netsuite__accounts": ["model.netsuite.int_netsuite__accountxperiod_exchange_rate_map", "model.netsuite.int_netsuite__transactions_with_converted_amounts", "model.netsuite.netsuite__balance_sheet", "model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__accounts_account_id.fecc4e4cbe", "test.netsuite_source.unique_stg_netsuite__accounts_account_id.3eeab2f9dd"], "model.netsuite_source.stg_netsuite__items": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__items_item_id.bc6721fd95", "test.netsuite_source.unique_stg_netsuite__items_item_id.9a63c1548b"], "model.netsuite_source.stg_netsuite__locations": ["model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__locations_location_id.f5399a180b", "test.netsuite_source.unique_stg_netsuite__locations_location_id.3985418f4f"], "model.netsuite_source.stg_netsuite__departments": ["model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__departments_department_id.67c85c30e9", "test.netsuite_source.unique_stg_netsuite__departments_department_id.822f26f13f"], "model.netsuite_source.stg_netsuite__currencies": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id.212eca61df", "test.netsuite_source.unique_stg_netsuite__currencies_currency_id.8cdbdc9bbe"], "model.netsuite_source.stg_netsuite__vendor_types": ["model.netsuite.netsuite__transaction_details", "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id.aa60434805", "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id.dd1afff7b8"], "model.netsuite_source.stg_netsuite__accounting_periods": ["model.netsuite.int_netsuite__transaction_and_reporting_periods", "model.netsuite.netsuite__balance_sheet", "model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details", "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id.9f1ba738bf", "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id.24fe28a4c3", "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id.0bbe26d8b2"], "model.netsuite_source.stg_netsuite__accounting_periods_tmp": ["model.netsuite_source.stg_netsuite__accounting_periods", "model.netsuite_source.stg_netsuite__accounting_periods"], "model.netsuite_source.stg_netsuite__accounting_books_tmp": ["model.netsuite_source.stg_netsuite__accounting_books", "model.netsuite_source.stg_netsuite__accounting_books"], "model.netsuite_source.stg_netsuite__customers_tmp": ["model.netsuite_source.stg_netsuite__customers", "model.netsuite_source.stg_netsuite__customers"], "model.netsuite_source.stg_netsuite__transaction_lines_tmp": ["model.netsuite_source.stg_netsuite__transaction_lines", "model.netsuite_source.stg_netsuite__transaction_lines"], "model.netsuite_source.stg_netsuite__income_accounts_tmp": ["model.netsuite_source.stg_netsuite__income_accounts", "model.netsuite_source.stg_netsuite__income_accounts"], "model.netsuite_source.stg_netsuite__accounts_tmp": ["model.netsuite_source.stg_netsuite__accounts", "model.netsuite_source.stg_netsuite__accounts"], "model.netsuite_source.stg_netsuite__departments_tmp": ["model.netsuite_source.stg_netsuite__departments", "model.netsuite_source.stg_netsuite__departments"], "model.netsuite_source.stg_netsuite__currencies_tmp": ["model.netsuite_source.stg_netsuite__currencies", "model.netsuite_source.stg_netsuite__currencies"], "model.netsuite_source.stg_netsuite__vendor_types_tmp": ["model.netsuite_source.stg_netsuite__vendor_types", "model.netsuite_source.stg_netsuite__vendor_types"], "model.netsuite_source.stg_netsuite__vendors_tmp": ["model.netsuite_source.stg_netsuite__vendors", "model.netsuite_source.stg_netsuite__vendors"], "model.netsuite_source.stg_netsuite__locations_tmp": ["model.netsuite_source.stg_netsuite__locations", "model.netsuite_source.stg_netsuite__locations"], "model.netsuite_source.stg_netsuite__items_tmp": ["model.netsuite_source.stg_netsuite__items", "model.netsuite_source.stg_netsuite__items"], "model.netsuite_source.stg_netsuite__subsidiaries_tmp": ["model.netsuite_source.stg_netsuite__subsidiaries", "model.netsuite_source.stg_netsuite__subsidiaries"], "model.netsuite_source.stg_netsuite__transactions_tmp": ["model.netsuite_source.stg_netsuite__transactions", "model.netsuite_source.stg_netsuite__transactions"], "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp": ["model.netsuite_source.stg_netsuite__consolidated_exchange_rates", "model.netsuite_source.stg_netsuite__consolidated_exchange_rates"], "model.netsuite_source.stg_netsuite__classes_tmp": ["model.netsuite_source.stg_netsuite__classes", "model.netsuite_source.stg_netsuite__classes"], "model.netsuite_source.stg_netsuite__expense_accounts_tmp": ["model.netsuite_source.stg_netsuite__expense_accounts", "model.netsuite_source.stg_netsuite__expense_accounts"], "model.netsuite.netsuite__income_statement": [], "model.netsuite.netsuite__balance_sheet": [], "model.netsuite.netsuite__transaction_details": [], "model.netsuite.int_netsuite__accountxperiod_exchange_rate_map": ["model.netsuite.int_netsuite__transactions_with_converted_amounts"], "model.netsuite.int_netsuite__transaction_lines_w_accounting_period": ["model.netsuite.int_netsuite__transactions_with_converted_amounts"], "model.netsuite.int_netsuite__transaction_and_reporting_periods": ["model.netsuite.int_netsuite__transactions_with_converted_amounts"], "model.netsuite.int_netsuite__transactions_with_converted_amounts": ["model.netsuite.netsuite__balance_sheet", "model.netsuite.netsuite__income_statement", "model.netsuite.netsuite__transaction_details"], "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id.e6f9d0d945": [], "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id.bff848e817": [], "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id.24fe28a4c3": [], "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id.0bbe26d8b2": [], "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id.9f1ba738bf": [], "test.netsuite_source.unique_stg_netsuite__accounts_account_id.3eeab2f9dd": [], "test.netsuite_source.not_null_stg_netsuite__accounts_account_id.fecc4e4cbe": [], "test.netsuite_source.unique_stg_netsuite__classes_class_id.3440d85229": [], "test.netsuite_source.not_null_stg_netsuite__classes_class_id.ada489e5f0": [], "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.22f44c66d2": [], "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id.80a48e540a": [], "test.netsuite_source.unique_stg_netsuite__currencies_currency_id.8cdbdc9bbe": [], "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id.212eca61df": [], "test.netsuite_source.unique_stg_netsuite__customers_customer_id.29356dc3c4": [], "test.netsuite_source.not_null_stg_netsuite__customers_customer_id.c15d024944": [], "test.netsuite_source.unique_stg_netsuite__departments_department_id.822f26f13f": [], "test.netsuite_source.not_null_stg_netsuite__departments_department_id.67c85c30e9": [], "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id.3011426857": [], "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id.d681f3e292": [], "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id.8d1b288d60": [], "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id.d7c2f10faf": [], "test.netsuite_source.unique_stg_netsuite__items_item_id.9a63c1548b": [], "test.netsuite_source.not_null_stg_netsuite__items_item_id.bc6721fd95": [], "test.netsuite_source.unique_stg_netsuite__locations_location_id.3985418f4f": [], "test.netsuite_source.not_null_stg_netsuite__locations_location_id.f5399a180b": [], "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id.a3d8b4994f": [], "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id.8fe6fa82dd": [], "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id.04bcc30b93": [], "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id.d6e7dd66f9": [], "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id.ed3df2b3f3": [], "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id.f5f919ae55": [], "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id.5ffb30c533": [], "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id.dd1afff7b8": [], "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id.aa60434805": [], "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id.c10484ef81": [], "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id.2902e05c60": [], "source.netsuite_source.netsuite.accounting_books": [], "source.netsuite_source.netsuite.accounting_periods": [], "source.netsuite_source.netsuite.accounts": [], "source.netsuite_source.netsuite.classes": [], "source.netsuite_source.netsuite.consolidated_exchange_rates": [], "source.netsuite_source.netsuite.currencies": [], "source.netsuite_source.netsuite.customers": [], "source.netsuite_source.netsuite.departments": [], "source.netsuite_source.netsuite.expense_accounts": [], "source.netsuite_source.netsuite.income_accounts": [], "source.netsuite_source.netsuite.items": [], "source.netsuite_source.netsuite.locations": [], "source.netsuite_source.netsuite.subsidiaries": [], "source.netsuite_source.netsuite.transaction_lines": [], "source.netsuite_source.netsuite.transactions": [], "source.netsuite_source.netsuite.vendor_types": [], "source.netsuite_source.netsuite.vendors": []}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json deleted file mode 100644 index 32f4fd7b..00000000 --- a/docs/run_results.json +++ /dev/null @@ -1 +0,0 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v1.json", "dbt_version": "0.19.1", "generated_at": "2021-06-14T14:23:58.777410Z", "invocation_id": "c05eb1d6-c3fe-439d-be04-41015149fa2d", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.430527Z", "completed_at": "2021-06-14T14:23:57.437347Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.442119Z", "completed_at": "2021-06-14T14:23:57.442151Z"}], "thread_id": "Thread-1", "execution_time": 0.01379704475402832, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.accounting_books_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.431698Z", "completed_at": "2021-06-14T14:23:57.441935Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.442623Z", "completed_at": "2021-06-14T14:23:57.442631Z"}], "thread_id": "Thread-2", "execution_time": 0.013631105422973633, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.accounting_periods_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.434791Z", "completed_at": "2021-06-14T14:23:57.442319Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.443171Z", "completed_at": "2021-06-14T14:23:57.443179Z"}], "thread_id": "Thread-3", "execution_time": 0.013813018798828125, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.accounts_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.434939Z", "completed_at": "2021-06-14T14:23:57.442469Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.443333Z", "completed_at": "2021-06-14T14:23:57.443340Z"}], "thread_id": "Thread-4", "execution_time": 0.013765096664428711, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.consolidated_exchange_rates_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.446950Z", "completed_at": "2021-06-14T14:23:57.452172Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.456734Z", "completed_at": "2021-06-14T14:23:57.456746Z"}], "thread_id": "Thread-1", "execution_time": 0.012104272842407227, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.subsidiaries_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.450155Z", "completed_at": "2021-06-14T14:23:57.457036Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.457927Z", "completed_at": "2021-06-14T14:23:57.457938Z"}], "thread_id": "Thread-3", "execution_time": 0.011926889419555664, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.transactions_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.450320Z", "completed_at": "2021-06-14T14:23:57.457192Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.458122Z", "completed_at": "2021-06-14T14:23:57.458131Z"}], "thread_id": "Thread-4", "execution_time": 0.011935949325561523, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.departments_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.447757Z", "completed_at": "2021-06-14T14:23:57.462614Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.465306Z", "completed_at": "2021-06-14T14:23:57.465314Z"}], "thread_id": "Thread-2", "execution_time": 0.019453048706054688, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.transaction_lines_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.462455Z", "completed_at": "2021-06-14T14:23:57.465799Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.469757Z", "completed_at": "2021-06-14T14:23:57.469764Z"}], "thread_id": "Thread-1", "execution_time": 0.011059045791625977, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.locations_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.465467Z", "completed_at": "2021-06-14T14:23:57.470149Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.471025Z", "completed_at": "2021-06-14T14:23:57.471032Z"}], "thread_id": "Thread-3", "execution_time": 0.009099006652832031, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.classes_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.465677Z", "completed_at": "2021-06-14T14:23:57.470341Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.471169Z", "completed_at": "2021-06-14T14:23:57.471176Z"}], "thread_id": "Thread-4", "execution_time": 0.009084939956665039, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.currencies_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.471598Z", "completed_at": "2021-06-14T14:23:57.474999Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.477342Z", "completed_at": "2021-06-14T14:23:57.477349Z"}], "thread_id": "Thread-2", "execution_time": 0.007194042205810547, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.customers_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.474879Z", "completed_at": "2021-06-14T14:23:57.477700Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.481493Z", "completed_at": "2021-06-14T14:23:57.481500Z"}], "thread_id": "Thread-1", "execution_time": 0.010025978088378906, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.expense_accounts_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.477477Z", "completed_at": "2021-06-14T14:23:57.481850Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.482743Z", "completed_at": "2021-06-14T14:23:57.482750Z"}], "thread_id": "Thread-3", "execution_time": 0.008450031280517578, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.income_accounts_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.477591Z", "completed_at": "2021-06-14T14:23:57.482035Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.482889Z", "completed_at": "2021-06-14T14:23:57.482895Z"}], "thread_id": "Thread-4", "execution_time": 0.008487939834594727, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.items_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.483252Z", "completed_at": "2021-06-14T14:23:57.487440Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.489699Z", "completed_at": "2021-06-14T14:23:57.489707Z"}], "thread_id": "Thread-2", "execution_time": 0.00783991813659668, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.vendor_types_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.487319Z", "completed_at": "2021-06-14T14:23:57.490064Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.497066Z", "completed_at": "2021-06-14T14:23:57.497073Z"}], "thread_id": "Thread-1", "execution_time": 0.013837099075317383, "adapter_response": {}, "message": null, "unique_id": "seed.netsuite_integration_tests.vendors_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.489957Z", "completed_at": "2021-06-14T14:23:57.498348Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.498838Z", "completed_at": "2021-06-14T14:23:57.498844Z"}], "thread_id": "Thread-4", "execution_time": 0.015584230422973633, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__accounting_periods_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.489840Z", "completed_at": "2021-06-14T14:23:57.498434Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.499037Z", "completed_at": "2021-06-14T14:23:57.499044Z"}], "thread_id": "Thread-3", "execution_time": 0.01628899574279785, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__accounting_books_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.498647Z", "completed_at": "2021-06-14T14:23:57.509229Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.510025Z", "completed_at": "2021-06-14T14:23:57.510035Z"}], "thread_id": "Thread-2", "execution_time": 0.012622833251953125, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__accounts_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.504130Z", "completed_at": "2021-06-14T14:23:57.510408Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.517554Z", "completed_at": "2021-06-14T14:23:57.517566Z"}], "thread_id": "Thread-1", "execution_time": 0.019388914108276367, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__consolidated_exchange_rates_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.510194Z", "completed_at": "2021-06-14T14:23:57.519204Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.520073Z", "completed_at": "2021-06-14T14:23:57.520082Z"}], "thread_id": "Thread-4", "execution_time": 0.015762805938720703, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__subsidiaries_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.510319Z", "completed_at": "2021-06-14T14:23:57.519479Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.520230Z", "completed_at": "2021-06-14T14:23:57.520236Z"}], "thread_id": "Thread-3", "execution_time": 0.0157620906829834, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__transactions_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.519674Z", "completed_at": "2021-06-14T14:23:57.529760Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.530842Z", "completed_at": "2021-06-14T14:23:57.530853Z"}], "thread_id": "Thread-2", "execution_time": 0.012701988220214844, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__departments_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.524902Z", "completed_at": "2021-06-14T14:23:57.530977Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.531641Z", "completed_at": "2021-06-14T14:23:57.531648Z"}], "thread_id": "Thread-1", "execution_time": 0.019406795501708984, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__transaction_lines_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.531234Z", "completed_at": "2021-06-14T14:23:57.540205Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.540847Z", "completed_at": "2021-06-14T14:23:57.540855Z"}], "thread_id": "Thread-3", "execution_time": 0.01417994499206543, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__classes_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.531100Z", "completed_at": "2021-06-14T14:23:57.540320Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.540997Z", "completed_at": "2021-06-14T14:23:57.541005Z"}], "thread_id": "Thread-4", "execution_time": 0.014935016632080078, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__locations_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.540450Z", "completed_at": "2021-06-14T14:23:57.548910Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.550001Z", "completed_at": "2021-06-14T14:23:57.550010Z"}], "thread_id": "Thread-2", "execution_time": 0.011056184768676758, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__currencies_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.544465Z", "completed_at": "2021-06-14T14:23:57.550108Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.550761Z", "completed_at": "2021-06-14T14:23:57.550768Z"}], "thread_id": "Thread-1", "execution_time": 0.017578601837158203, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__customers_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.550254Z", "completed_at": "2021-06-14T14:23:57.559099Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.559922Z", "completed_at": "2021-06-14T14:23:57.559930Z"}], "thread_id": "Thread-3", "execution_time": 0.0160062313079834, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__expense_accounts_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.550366Z", "completed_at": "2021-06-14T14:23:57.559485Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.564932Z", "completed_at": "2021-06-14T14:23:57.564943Z"}], "thread_id": "Thread-4", "execution_time": 0.016082763671875, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__income_accounts_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.559349Z", "completed_at": "2021-06-14T14:23:57.569383Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.570857Z", "completed_at": "2021-06-14T14:23:57.570869Z"}], "thread_id": "Thread-2", "execution_time": 0.013051986694335938, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__items_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.565099Z", "completed_at": "2021-06-14T14:23:57.571273Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.571958Z", "completed_at": "2021-06-14T14:23:57.571965Z"}], "thread_id": "Thread-1", "execution_time": 0.020639896392822266, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__vendor_types_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.571422Z", "completed_at": "2021-06-14T14:23:57.581362Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.582754Z", "completed_at": "2021-06-14T14:23:57.582763Z"}], "thread_id": "Thread-3", "execution_time": 0.017615079879760742, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__vendors_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.597631Z", "completed_at": "2021-06-14T14:23:57.711881Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.712093Z", "completed_at": "2021-06-14T14:23:57.712106Z"}], "thread_id": "Thread-3", "execution_time": 0.11653518676757812, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__consolidated_exchange_rates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.581488Z", "completed_at": "2021-06-14T14:23:57.738886Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.739091Z", "completed_at": "2021-06-14T14:23:57.739101Z"}], "thread_id": "Thread-2", "execution_time": 0.1588139533996582, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__accounting_periods"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.571830Z", "completed_at": "2021-06-14T14:23:57.757755Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.757955Z", "completed_at": "2021-06-14T14:23:57.757967Z"}], "thread_id": "Thread-4", "execution_time": 0.18738389015197754, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__accounting_books"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.587517Z", "completed_at": "2021-06-14T14:23:57.758085Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.758663Z", "completed_at": "2021-06-14T14:23:57.758671Z"}], "thread_id": "Thread-1", "execution_time": 0.1772289276123047, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__accounts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.739950Z", "completed_at": "2021-06-14T14:23:57.875754Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.875917Z", "completed_at": "2021-06-14T14:23:57.875928Z"}], "thread_id": "Thread-2", "execution_time": 0.13650894165039062, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__transactions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.713114Z", "completed_at": "2021-06-14T14:23:57.882074Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.882251Z", "completed_at": "2021-06-14T14:23:57.882260Z"}], "thread_id": "Thread-3", "execution_time": 0.16971397399902344, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__subsidiaries"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.759982Z", "completed_at": "2021-06-14T14:23:57.911471Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.911708Z", "completed_at": "2021-06-14T14:23:57.911725Z"}], "thread_id": "Thread-4", "execution_time": 0.1526327133178711, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__departments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.766573Z", "completed_at": "2021-06-14T14:23:57.924458Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:57.924638Z", "completed_at": "2021-06-14T14:23:57.924648Z"}], "thread_id": "Thread-1", "execution_time": 0.16463780403137207, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__transaction_lines"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.883030Z", "completed_at": "2021-06-14T14:23:58.015501Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.015739Z", "completed_at": "2021-06-14T14:23:58.015755Z"}], "thread_id": "Thread-3", "execution_time": 0.1333608627319336, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__classes"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.913120Z", "completed_at": "2021-06-14T14:23:58.043624Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.043804Z", "completed_at": "2021-06-14T14:23:58.043815Z"}], "thread_id": "Thread-4", "execution_time": 0.13138699531555176, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__currencies"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.876764Z", "completed_at": "2021-06-14T14:23:58.126204Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.126622Z", "completed_at": "2021-06-14T14:23:58.126637Z"}], "thread_id": "Thread-2", "execution_time": 0.2505350112915039, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__locations"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:57.926243Z", "completed_at": "2021-06-14T14:23:58.183920Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.184087Z", "completed_at": "2021-06-14T14:23:58.184098Z"}], "thread_id": "Thread-1", "execution_time": 0.25838518142700195, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.017292Z", "completed_at": "2021-06-14T14:23:58.245727Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.245908Z", "completed_at": "2021-06-14T14:23:58.245920Z"}], "thread_id": "Thread-3", "execution_time": 0.2294919490814209, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__expense_accounts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.044739Z", "completed_at": "2021-06-14T14:23:58.263944Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.264141Z", "completed_at": "2021-06-14T14:23:58.264153Z"}], "thread_id": "Thread-4", "execution_time": 0.22007322311401367, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__income_accounts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.265101Z", "completed_at": "2021-06-14T14:23:58.273748Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.273902Z", "completed_at": "2021-06-14T14:23:58.273910Z"}], "thread_id": "Thread-4", "execution_time": 0.009356975555419922, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.274702Z", "completed_at": "2021-06-14T14:23:58.300895Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.301057Z", "completed_at": "2021-06-14T14:23:58.301065Z"}], "thread_id": "Thread-4", "execution_time": 0.02685403823852539, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__consolidated_exchange_rates_consolidated_exchange_rate_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.184887Z", "completed_at": "2021-06-14T14:23:58.340705Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.341030Z", "completed_at": "2021-06-14T14:23:58.341060Z"}], "thread_id": "Thread-1", "execution_time": 0.1576230525970459, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__vendor_types"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.301815Z", "completed_at": "2021-06-14T14:23:58.340828Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.341962Z", "completed_at": "2021-06-14T14:23:58.341970Z"}], "thread_id": "Thread-4", "execution_time": 0.042077064514160156, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__accounting_periods_accounting_period_id__fiscal_calendar_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.127836Z", "completed_at": "2021-06-14T14:23:58.341699Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.343399Z", "completed_at": "2021-06-14T14:23:58.343406Z"}], "thread_id": "Thread-2", "execution_time": 0.21667122840881348, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__items"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.345582Z", "completed_at": "2021-06-14T14:23:58.359796Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.359953Z", "completed_at": "2021-06-14T14:23:58.359963Z"}], "thread_id": "Thread-1", "execution_time": 0.015501976013183594, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounting_periods_accounting_period_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.346178Z", "completed_at": "2021-06-14T14:23:58.360944Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.361349Z", "completed_at": "2021-06-14T14:23:58.361356Z"}], "thread_id": "Thread-4", "execution_time": 0.020068645477294922, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounting_periods_fiscal_calendar_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.350894Z", "completed_at": "2021-06-14T14:23:58.361117Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.361492Z", "completed_at": "2021-06-14T14:23:58.361499Z"}], "thread_id": "Thread-2", "execution_time": 0.019977092742919922, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounting_books_accounting_book_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.361226Z", "completed_at": "2021-06-14T14:23:58.366618Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.367144Z", "completed_at": "2021-06-14T14:23:58.367151Z"}], "thread_id": "Thread-1", "execution_time": 0.010113000869750977, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__accounting_books_accounting_book_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.367014Z", "completed_at": "2021-06-14T14:23:58.374427Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.374879Z", "completed_at": "2021-06-14T14:23:58.374886Z"}], "thread_id": "Thread-4", "execution_time": 0.009006977081298828, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__accounts_account_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.367269Z", "completed_at": "2021-06-14T14:23:58.375140Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.378831Z", "completed_at": "2021-06-14T14:23:58.378839Z"}], "thread_id": "Thread-2", "execution_time": 0.012855052947998047, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__accounts_account_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.383906Z", "completed_at": "2021-06-14T14:23:58.392019Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.392452Z", "completed_at": "2021-06-14T14:23:58.392459Z"}], "thread_id": "Thread-2", "execution_time": 0.012205123901367188, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__subsidiaries_subsidiary_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.387482Z", "completed_at": "2021-06-14T14:23:58.392752Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.393209Z", "completed_at": "2021-06-14T14:23:58.393215Z"}], "thread_id": "Thread-1", "execution_time": 0.012356281280517578, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__transactions_transaction_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.393110Z", "completed_at": "2021-06-14T14:23:58.397314Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.401217Z", "completed_at": "2021-06-14T14:23:58.401224Z"}], "thread_id": "Thread-4", "execution_time": 0.009291887283325195, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__subsidiaries_subsidiary_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.397240Z", "completed_at": "2021-06-14T14:23:58.406986Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.407650Z", "completed_at": "2021-06-14T14:23:58.407679Z"}], "thread_id": "Thread-2", "execution_time": 0.011842727661132812, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__transactions_transaction_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.401424Z", "completed_at": "2021-06-14T14:23:58.408020Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.412745Z", "completed_at": "2021-06-14T14:23:58.412754Z"}], "thread_id": "Thread-1", "execution_time": 0.01594686508178711, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__departments_department_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.407849Z", "completed_at": "2021-06-14T14:23:58.413756Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.414177Z", "completed_at": "2021-06-14T14:23:58.414182Z"}], "thread_id": "Thread-4", "execution_time": 0.00998997688293457, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__departments_department_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.417384Z", "completed_at": "2021-06-14T14:23:58.422380Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.425664Z", "completed_at": "2021-06-14T14:23:58.425671Z"}], "thread_id": "Thread-1", "execution_time": 0.012208700180053711, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.dbt_utils_unique_combination_of_columns_stg_netsuite__transaction_lines_transaction_id__transaction_line_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.422239Z", "completed_at": "2021-06-14T14:23:58.426952Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.427386Z", "completed_at": "2021-06-14T14:23:58.427393Z"}], "thread_id": "Thread-4", "execution_time": 0.010182857513427734, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.427188Z", "completed_at": "2021-06-14T14:23:58.435526Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.435964Z", "completed_at": "2021-06-14T14:23:58.435972Z"}], "thread_id": "Thread-2", "execution_time": 0.009837865829467773, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__transaction_lines_transaction_line_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.432071Z", "completed_at": "2021-06-14T14:23:58.436230Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.439833Z", "completed_at": "2021-06-14T14:23:58.439839Z"}], "thread_id": "Thread-1", "execution_time": 0.012829780578613281, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__classes_class_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.436156Z", "completed_at": "2021-06-14T14:23:58.440688Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.441054Z", "completed_at": "2021-06-14T14:23:58.441060Z"}], "thread_id": "Thread-4", "execution_time": 0.00893092155456543, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__classes_class_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.440939Z", "completed_at": "2021-06-14T14:23:58.448427Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.448789Z", "completed_at": "2021-06-14T14:23:58.448796Z"}], "thread_id": "Thread-2", "execution_time": 0.012722969055175781, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__currencies_currency_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.444696Z", "completed_at": "2021-06-14T14:23:58.452714Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.453492Z", "completed_at": "2021-06-14T14:23:58.453504Z"}], "thread_id": "Thread-1", "execution_time": 0.012952089309692383, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__currencies_currency_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.448621Z", "completed_at": "2021-06-14T14:23:58.454705Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.455434Z", "completed_at": "2021-06-14T14:23:58.455445Z"}], "thread_id": "Thread-4", "execution_time": 0.012558937072753906, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__locations_location_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.455242Z", "completed_at": "2021-06-14T14:23:58.465480Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.466585Z", "completed_at": "2021-06-14T14:23:58.466593Z"}], "thread_id": "Thread-2", "execution_time": 0.02963089942932129, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__locations_location_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.460995Z", "completed_at": "2021-06-14T14:23:58.494293Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.494952Z", "completed_at": "2021-06-14T14:23:58.494960Z"}], "thread_id": "Thread-1", "execution_time": 0.04008769989013672, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__customers_customer_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.465765Z", "completed_at": "2021-06-14T14:23:58.494728Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.495463Z", "completed_at": "2021-06-14T14:23:58.495468Z"}], "thread_id": "Thread-4", "execution_time": 0.030835866928100586, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__customers_customer_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.246878Z", "completed_at": "2021-06-14T14:23:58.495345Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.495907Z", "completed_at": "2021-06-14T14:23:58.495913Z"}], "thread_id": "Thread-3", "execution_time": 0.2535130977630615, "adapter_response": {}, "message": null, "unique_id": "model.netsuite_source.stg_netsuite__vendors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.495806Z", "completed_at": "2021-06-14T14:23:58.502245Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.507676Z", "completed_at": "2021-06-14T14:23:58.507692Z"}], "thread_id": "Thread-2", "execution_time": 0.018764019012451172, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__expense_accounts_expense_account_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.502063Z", "completed_at": "2021-06-14T14:23:58.517664Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.518321Z", "completed_at": "2021-06-14T14:23:58.518348Z"}], "thread_id": "Thread-1", "execution_time": 0.018718957901000977, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__expense_accounts_expense_account_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.502630Z", "completed_at": "2021-06-14T14:23:58.518684Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.519511Z", "completed_at": "2021-06-14T14:23:58.519517Z"}], "thread_id": "Thread-4", "execution_time": 0.018513202667236328, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__income_accounts_income_account_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.507861Z", "completed_at": "2021-06-14T14:23:58.519109Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.519736Z", "completed_at": "2021-06-14T14:23:58.519742Z"}], "thread_id": "Thread-3", "execution_time": 0.021167755126953125, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__income_accounts_income_account_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.519627Z", "completed_at": "2021-06-14T14:23:58.524929Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.528755Z", "completed_at": "2021-06-14T14:23:58.528776Z"}], "thread_id": "Thread-2", "execution_time": 0.013424873352050781, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__vendor_types_vendor_type_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.524614Z", "completed_at": "2021-06-14T14:23:58.532425Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.535992Z", "completed_at": "2021-06-14T14:23:58.536000Z"}], "thread_id": "Thread-1", "execution_time": 0.01328897476196289, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__vendor_types_vendor_type_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.528622Z", "completed_at": "2021-06-14T14:23:58.536280Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.537129Z", "completed_at": "2021-06-14T14:23:58.537135Z"}], "thread_id": "Thread-4", "execution_time": 0.01295614242553711, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__items_item_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.528921Z", "completed_at": "2021-06-14T14:23:58.536771Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.537339Z", "completed_at": "2021-06-14T14:23:58.537344Z"}], "thread_id": "Thread-3", "execution_time": 0.024673938751220703, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__items_item_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.569441Z", "completed_at": "2021-06-14T14:23:58.578410Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.578547Z", "completed_at": "2021-06-14T14:23:58.578553Z"}], "thread_id": "Thread-1", "execution_time": 0.011870145797729492, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.not_null_stg_netsuite__vendors_vendor_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.574332Z", "completed_at": "2021-06-14T14:23:58.579111Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.579238Z", "completed_at": "2021-06-14T14:23:58.579244Z"}], "thread_id": "Thread-4", "execution_time": 0.009922027587890625, "adapter_response": {}, "message": null, "unique_id": "test.netsuite_source.unique_stg_netsuite__vendors_vendor_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.580640Z", "completed_at": "2021-06-14T14:23:58.757250Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.763107Z", "completed_at": "2021-06-14T14:23:58.763124Z"}], "thread_id": "Thread-3", "execution_time": 0.18698406219482422, "adapter_response": {}, "message": null, "unique_id": "model.netsuite.netsuite__balance_sheet"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.581008Z", "completed_at": "2021-06-14T14:23:58.766637Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.767128Z", "completed_at": "2021-06-14T14:23:58.767135Z"}], "thread_id": "Thread-2", "execution_time": 0.18716096878051758, "adapter_response": {}, "message": null, "unique_id": "model.netsuite.netsuite__income_statement"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-06-14T14:23:58.592347Z", "completed_at": "2021-06-14T14:23:58.767802Z"}, {"name": "execute", "started_at": "2021-06-14T14:23:58.767926Z", "completed_at": "2021-06-14T14:23:58.767932Z"}], "thread_id": "Thread-1", "execution_time": 0.18738031387329102, "adapter_response": {}, "message": null, "unique_id": "model.netsuite.netsuite__transaction_details"}], "elapsed_time": 2.618515968322754, "args": {"log_format": "default", "write_json": true, "profiles_dir": "/Users/joseph.markiewicz/.dbt", "target": "bigquery", "use_cache": true, "compile": true, "version_check": true, "which": "generate", "rpc_method": "docs.generate"}} \ No newline at end of file diff --git a/models/netsuite.yml b/models/netsuite.yml index 627e1867..5e06e8bb 100644 --- a/models/netsuite.yml +++ b/models/netsuite.yml @@ -116,6 +116,12 @@ models: description: Category of the account. Options include Asset, Liability, Equity, Expense or Income. - name: income_statement_sort_helper description: Helper column for sorting income statement records. + - name: subsidiary_id + description: The unique identifier of the subsidiary. + - name: subsidiary_full_name + description: The full name of the subsidiary. + - name: subsidiary_name + description: Name of the subsidiary. - name: netsuite__transaction_details description: > @@ -186,6 +192,10 @@ models: description: Country where the customer is located. - name: customer_date_first_order description: Date customer placed first order. + - name: customer_external_id + description: The unique identifier of the external customer reference. + - name: class_full_name + description: Full name of the class. - name: item_name description: Name of the item. - name: item_type_name diff --git a/models/netsuite__income_statement.sql b/models/netsuite__income_statement.sql index 7afd44fb..b6f2d02f 100644 --- a/models/netsuite__income_statement.sql +++ b/models/netsuite__income_statement.sql @@ -58,6 +58,8 @@ income_statement as ( accounts.type_name as account_type_name, accounts.account_id as account_id, accounts.account_number, + subsidiaries.subsidiary_id, + subsidiaries.full_name as subsidiary_full_name, subsidiaries.name as subsidiary_name, --The below script allows for accounts table pass through columns. diff --git a/models/netsuite__transaction_details.sql b/models/netsuite__transaction_details.sql index 05a3c95a..e964d21d 100644 --- a/models/netsuite__transaction_details.sql +++ b/models/netsuite__transaction_details.sql @@ -75,7 +75,7 @@ currencies as ( classes as ( select * - from {{var('classes')}} + from {{ var('classes') }} ), transaction_details as ( diff --git a/packages.yml b/packages.yml index 33c646c2..ddb98ca0 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,7 @@ packages: - - package: fivetran/netsuite_source - version: [">=0.3.0", "<0.4.0"] + # - package: fivetran/netsuite_source + # version: [">=0.3.0", "<0.4.0"] + + - git: https://github.com/fivetran/dbt_netsuite_source.git + revision: customer/norina-sun + warn-unpinned: false \ No newline at end of file From c147a35428df47708c5f794b365b43f09ae583f5 Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Fri, 17 Sep 2021 08:53:58 -0500 Subject: [PATCH 5/5] source dep switch --- packages.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages.yml b/packages.yml index ddb98ca0..1d402cb5 100644 --- a/packages.yml +++ b/packages.yml @@ -1,7 +1,3 @@ packages: - # - package: fivetran/netsuite_source - # version: [">=0.3.0", "<0.4.0"] - - - git: https://github.com/fivetran/dbt_netsuite_source.git - revision: customer/norina-sun - warn-unpinned: false \ No newline at end of file + - package: fivetran/netsuite_source + version: [">=0.3.0", "<0.4.0"] \ No newline at end of file