From a73f838ed5b221042b86be48cdb1d6c8f989c9c4 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Fri, 13 May 2022 12:38:01 -0700 Subject: [PATCH 001/137] add changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c75a27c..aabf172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# dbt_shopify_source v0.7.0 +🎉 Applying Package Standardization 🎉 +We are applying standardization updates to be more consistent across our documentation. # dbt_shopify_source v0.6.0 🎉 dbt v1.0.0 Compatibility 🎉 ## 🚨 Breaking Changes 🚨 From 75b86e150d17d58ed1263118c256da55c16dc481 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Fri, 13 May 2022 12:38:08 -0700 Subject: [PATCH 002/137] update readme --- README.md | 174 +++++++++++++++++++++++++++++------------------------- 1 file changed, 95 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index 7e6913b..a58e722 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,85 @@ -[![Apache License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) -# Shopify (Source) - -This package models Shopify data from [Fivetran's connector](https://fivetran.com/docs/applications/shopify). It uses data in the format described by [this ERD](https://fivetran.com/docs/applications/shopify#schemainformation). - -This package enriches your Fivetran data by doing the following: - -* Adds descriptions to tables and columns that are synced using Fivetran -* Adds column-level testing where applicable. For example, all primary keys are tested for uniqueness and non-null values. -* Models staging tables, which will be used in our transform package - -## Models - -This package contains staging models, designed to work simultaneously with our [Shopify modeling package](https://github.com/fivetran/dbt_shopify). The staging models name columns consistently across all packages: -* Boolean fields are prefixed with `is_` or `has_` -* Timestamps are appended with `_at` -* ID primary keys are prefixed with the name of the table. For example, the campaign table's ID column is renamed `campaign_id`. - -## Installation Instructions -Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions, or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages. - -Include in your `packages.yml` - +

+ + + + + + + + + + +

+ +# Shopify Source dbt Package ([Docs](https://fivetran.github.io/dbt_shopify_source/)) +# 📣 What does this dbt package do? +- Materializes [Shopify staging tables](https://fivetran.github.io/dbt_shopify_source/#!/overview/github_source/models/?g_v=1) which leverage data in the format described by [this ERD](https://fivetran.com/docs/applications/shopify/#schemainformation). These staging tables clean, test, and prepare your Shopify data from [Fivetran's connector](https://fivetran.com/docs/applications/shopify) for analysis by doing the following: + - Name columns for consistency across all packages and for easier analysis + - Adds freshness tests to source data + - Adds column-level testing where applicable. For example, all primary keys are tested for uniqueness and non-null values. +- Generates a comprehensive data dictionary of your Shopify data through the [dbt docs site](https://fivetran.github.io/dbt_shopify_source/). +- These tables are designed to work simultaneously with our [Shopify transformation package](https://github.com/fivetran/dbt_shopify). + +# 🎯 How do I use the dbt package? +## Step 1: Prerequisites +To use this dbt package, you must have the following: +- At least one Fivetran Shopify connector syncing data into your destination. +- A **BigQuery**, **Snowflake**, **Redshift**, **Databricks**, or **PostgreSQL** destination. + +## Step 2: Install the package +Include the following shopify_source package version in your `packages.yml` file. +> TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages. ```yaml packages: - package: fivetran/shopify_source - version: [">=0.6.0", "<0.7.0"] + version: [">=0.7.0", "<0.8.0"] ``` +## Step 3: Define database and schema variables +By default, this package runs using your destination and the `shopify` schema. If this is not where your Shopify data is (for example, if your Shopify schema is named `shopify_fivetran` and your `issue` table is named `usa_issue`), add the following configuration to your root `dbt_project.yml` file: -## Configuration -By default, this package looks for your Shopify data in the `shopify` schema of your [target database](https://docs.getdbt.com/docs/running-a-dbt-project/using-the-command-line-interface/configure-your-profile). If this is not where your Shopify data is, add the following configuration to your `dbt_project.yml` file: +```yml +vars: + shopify_database: your_destination_name + shopify_schema: your_schema_name +``` + +## Step 4: Disabling models +This package was designed with the intention that users have all relevant Shopify tables being synced by Fivetran. However, if you are a Shopify user that does not operate on returns or adjustments then you will not have the related source tables. As such, you may use the below variable configurations to disable the respective downstream models. All variables are `true` by default. To disable those models, add the below configuration in your root `dbt_project.yml` file: ```yml # dbt_project.yml ... -config-version: 2 - vars: - shopify_database: your_database_name - shopify_schema: your_schema_name + shopify__using_order_adjustment: false # true by default + shopify__using_order_line_refund: false # true by default + shopify__using_refund: false # true by default ``` +## (Optional) Step 5: Additional configurations +
Expand to view configurations + +### Changing the Build Schema +By default this package will build the Shopify staging models within a schema titled ( + `_stg_shopify`) in your target database. If this is not where you would like your staging Shopify data to be written to, add the following configuration to your `dbt_project.yml` file: + +```yml +# dbt_project.yml + +... +models: + shopify_source: + +schema: my_new_schema_name # leave blank for just the target_schema +``` +### Change the source table references +If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable: +> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_shopify_source/blob/main/dbt_project.yml) variable declarations to see the expected names. + +```yml +vars: + shopify__identifier: your_table_name +``` ### Union Multiple Shopify Connectors If you have multiple Shopify connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the `source_relation` column of each model. To use this functionality, you will need to set either the `shopify_union_schemas` or `shopify_union_databases` variables: @@ -54,7 +93,6 @@ vars: shopify_union_schemas: ['shopify_usa','shopify_canada'] # use this if the data is in different schemas/datasets of the same database/project shopify_union_databases: ['shopify_usa','shopify_canada'] # use this if the data is in different databases/projects but uses the same schema name ``` - ### Add Passthrough Columns This package includes all source columns defined in the staging_columns.sql macro. To add additional columns to this package, do so using our pass-through column variables. This is extremely useful if you'd like to include custom fields to the package. @@ -74,60 +112,38 @@ vars: product_variant_pass_through_columns: [] ``` -### Disable Models -This package was designed with the intention that users have all relevant Shopify tables being synced by Fivetran. However, if you are a Shopify user that does not operate on returns or adjustments then you will not have the related source tables. As such, you may use the below variable configurations to disable the respective downstream models. All variables are `true` by default. Only add the below configuration if you are wishing to disable the models: - -```yml -# dbt_project.yml - -... -vars: - shopify__using_order_adjustment: false # true by default - shopify__using_order_line_refund: false # true by default - shopify__using_refund: false # true by default -``` -### Changing the Build Schema -By default this package will build the Shopify staging models within a schema titled ( + `_stg_shopify`) in your target database. If this is not where you would like your staging Shopify data to be written to, add the following configuration to your `dbt_project.yml` file: +
+## (Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Core™ +
Expand to view details +
+ +Fivetran offers the ability for you to orchestrate your dbt project through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt). Learn how to set up your project for orchestration through Fivetran in our [Transformations for dbt Core setup guides](https://fivetran.com/docs/transformations/dbt#setupguide). +
+ +# 🔍 Does this package have dependencies? +This dbt package is dependent on the following dbt packages. Please be aware that these dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site. +> IMPORTANT: If you have any of these dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts. ```yml -# dbt_project.yml +packages: + - package: fivetran/fivetran_utils + version: [">=0.3.0", "<0.4.0"] -... -models: - shopify_source: - +schema: my_new_schema_name # leave blank for just the target_schema + - package: dbt-labs/dbt_utils + version: [">=0.8.0", "<0.9.0"] ``` + +# 🙌 How is this package maintained and can I contribute? +## Package Maintenance +The Fivetran team maintaining this package _only_ maintains the latest version of the package. We highly recommend that you stay consistent with the [latest version](https://hub.getdbt.com/fivetran/jira_source/latest/) of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_jira_source/blob/main/CHANGELOG.md) and release notes for more information on changes across versions. ## Contributions +A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions! -Additional contributions to this package are very welcome! Please create issues -or open PRs against `main`. Check out -[this post](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) -on the best workflow for contributing to a package. - -## Database support -This package has been tested on BigQuery, Snowflake, Redshift, Postgres, and Databricks. - -### Databricks Dispatch Configuration -dbt `v0.20.0` introduced a new project-level dispatch configuration that enables an "override" setting for all dispatched macros. If you are using a Databricks destination with this package you will need to add the below (or a variation of the below) dispatch configuration within your `dbt_project.yml`. This is required in order for the package to accurately search for macros within the `dbt-labs/spark_utils` then the `dbt-labs/dbt_utils` packages respectively. -```yml -# dbt_project.yml - -dispatch: - - macro_namespace: dbt_utils - search_order: ['spark_utils', 'dbt_utils'] -``` +We highly encourage and welcome contributions to this package. Check out [this dbt Discourse article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) to learn how to contribute to a dbt package! -## Resources: -- Provide [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next -- Have questions, feedback, or need help? Book a time during our office hours [using Calendly](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) or email us at solutions@fivetran.com -- Find all of Fivetran's pre-built dbt packages in our [dbt hub](https://hub.getdbt.com/fivetran/) -- Learn how to orchestrate [dbt transformations with Fivetran](https://fivetran.com/docs/transformations/dbt) -- Learn more about Fivetran overall [in our docs](https://fivetran.com/docs) -- Check out [Fivetran's blog](https://fivetran.com/blog) -- Learn more about dbt [in the dbt docs](https://docs.getdbt.com/docs/introduction) -- Check out [Discourse](https://discourse.getdbt.com/) for commonly asked questions and answers -- Join the [chat](http://slack.getdbt.com/) on Slack for live discussions and support -- Find [dbt events](https://events.getdbt.com) near you -- Check out [the dbt blog](https://blog.getdbt.com/) for the latest news on dbt's development and best practices +# 🏪 Are there any resources available? +- If you have questions or want to reach out for help, please refer to the [GitHub Issue](https://github.com/fivetran/dbt_jira_source/issues/new/choose) section to find the right avenue of support for you. +- If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our [Feedback Form](https://www.surveymonkey.com/r/DQ7K7WW). +- Have questions or want to just say hi? Book a time during our office hours [on Calendly](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) or email us at solutions@fivetran.com. From 71f3a3ad3835bf491f48a8628b12d1aea3551999 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Fri, 13 May 2022 12:38:24 -0700 Subject: [PATCH 003/137] update versioining --- 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 7315e7f..a35339f 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'shopify_source' -version: '0.6.0' +version: '0.7.0' config-version: 2 require-dbt-version: [">=1.0.0", "<2.0.0"] diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 5414bb7..ccf73d1 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'shopify_source_integration_tests' -version: '0.5.2' +version: '0.7.0' profile: 'integration_tests' config-version: 2 From fee26cc5375ef510bb8077efa208c8ae98a2abd7 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Fri, 13 May 2022 12:38:28 -0700 Subject: [PATCH 004/137] clean --- .github/ISSUE_TEMPLATE/config.yml | 16 ++++++++++++++++ .github/ISSUE_TEMPLATE/question.md | 20 -------------------- docs/manifest.json | 1 - 3 files changed, 16 insertions(+), 21 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/question.md delete mode 100644 docs/manifest.json diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..4264c49 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,16 @@ +contact_links: + - name: Provide feedback to our dbt package team + url: https://www.surveymonkey.com/r/DQ7K7WW + about: Fill out our survey form to provide valuable feedback to the Fivetran team developing and maintaining the dbt packages. + - name: Ask a question during our office hours + url: https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours + about: Schedule time during the external office hours block with the Fivetran Analytics Engineering team for support + - name: Fivetran connector question + url: https://support.fivetran.com/hc + about: Have a question about your connector? Check out the Fivetran support portal for more details. + - name: What is dbt + url: https://docs.getdbt.com/docs/introduction + about: Check out the dbt docs for all dbt related information + - name: Hang out in dbt Slack + url: https://www.getdbt.com/community/ + about: Have a question or just want to chat with fellow data friends, join dbt Slack and hangout in the tools-fivetran channel with us! \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index 2bd3b25..0000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Question -about: Confused about how to use the package? Ask us a question -title: QUESTION - [your question title here] -labels: question -assignees: '' - ---- - -**Are you a Fivetran customer?** - - -**Your Question** - - -**Additional context** - - -**Please indicate the level of urgency and business impact of this request** - diff --git a/docs/manifest.json b/docs/manifest.json deleted file mode 100644 index f71d42f..0000000 --- a/docs/manifest.json +++ /dev/null @@ -1 +0,0 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v1.json", "dbt_version": "0.19.1", "generated_at": "2021-05-10T15:49:33.056218Z", "invocation_id": "25205f8f-a888-421f-a470-c817bc340294", "env": {}, "project_id": "f2f22d4d8db9dfa8a08831bb14141bc2", "user_id": "57178664-37b2-4047-9572-68ec8b488cd7", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.shopify_source_integration_tests.shopify_order_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "processed_at": "timestamp", "cancelled_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64", "customer_id": "INT64", "location_id": "INT64", "user_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_data.csv", "original_file_path": "data/shopify_order_data.csv", "name": "shopify_order_data", "alias": "shopify_order_data", "checksum": {"name": "sha256", "checksum": "4d0dd043a886a0d9e7680e7ee2cd132717490f75d3a06fe7c38956d901976146"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "processed_at": "timestamp", "cancelled_at": "timestamp", "_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "customer_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "location_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "user_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_data`"}, "seed.shopify_source_integration_tests.shopify_order_line_refund_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64", "location_id": "INT64", "refund_id": "INT64", "order_line_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_line_refund_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_refund_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_line_refund_data.csv", "original_file_path": "data/shopify_order_line_refund_data.csv", "name": "shopify_order_line_refund_data", "alias": "shopify_order_line_refund_data", "checksum": {"name": "sha256", "checksum": "52889a517b6610f539a77f9905805d67fbee62f0bcd63f3ca432efce9a328b45"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "location_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "refund_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_line_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_refund_data`"}, "seed.shopify_source_integration_tests.shopify_order_adjustment_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "refund_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_adjustment_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_adjustment_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_adjustment_data.csv", "original_file_path": "data/shopify_order_adjustment_data.csv", "name": "shopify_order_adjustment_data", "alias": "shopify_order_adjustment_data", "checksum": {"name": "sha256", "checksum": "99899b3532a7e74a67063723058528563d4fedc8114e99e930cfbc8598a16da8"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "refund_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_adjustment_data`"}, "seed.shopify_source_integration_tests.shopify_product_variant_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "product_id": "INT64", "inventory_item_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_product_variant_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_product_variant_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_product_variant_data.csv", "original_file_path": "data/shopify_product_variant_data.csv", "name": "shopify_product_variant_data", "alias": "shopify_product_variant_data", "checksum": {"name": "sha256", "checksum": "5fbf997eaa32d49016b0ba5acd2201e60309b0b7fb3a83e5a782542502426abc"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "product_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "inventory_item_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_product_variant_data`"}, "seed.shopify_source_integration_tests.shopify_refund_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "user_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_refund_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_refund_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_refund_data.csv", "original_file_path": "data/shopify_refund_data.csv", "name": "shopify_refund_data", "alias": "shopify_refund_data", "checksum": {"name": "sha256", "checksum": "1efcab5977150427c6c7ef2c3aff396384bdd80dfd5872752836b027ea78e404"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "user_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_refund_data`"}, "seed.shopify_source_integration_tests.shopify_transaction_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "refund_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_transaction_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_transaction_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_transaction_data.csv", "original_file_path": "data/shopify_transaction_data.csv", "name": "shopify_transaction_data", "alias": "shopify_transaction_data", "checksum": {"name": "sha256", "checksum": "353ca5206d7a0982439b57cda81d05e861b924f65071e3c2c2b6ad1ca7fccf75"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "refund_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_transaction_data`"}, "seed.shopify_source_integration_tests.shopify_product_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "published_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_product_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_product_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_product_data.csv", "original_file_path": "data/shopify_product_data.csv", "name": "shopify_product_data", "alias": "shopify_product_data", "checksum": {"name": "sha256", "checksum": "5cc03f90512ac04a6526220040085e4e0488b62ef22e8b201424c7d7cf1bf847"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "published_at": "timestamp", "_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_product_data`"}, "seed.shopify_source_integration_tests.shopify_customer_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64", "default_address_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_customer_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_customer_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_customer_data.csv", "original_file_path": "data/shopify_customer_data.csv", "name": "shopify_customer_data", "alias": "shopify_customer_data", "checksum": {"name": "sha256", "checksum": "79bc0a5972c321cefe2973acdd443ce1d42e36b3b23b2298151046d23bdf4bea"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "default_address_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_customer_data`"}, "seed.shopify_source_integration_tests.shopify_order_line_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "order_id": "INT64", "id": "INT64", "product_id": "INT64", "variant_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_line_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_line_data.csv", "original_file_path": "data/shopify_order_line_data.csv", "name": "shopify_order_line_data", "alias": "shopify_order_line_data", "checksum": {"name": "sha256", "checksum": "cabaa49c9bd299b34eb2154893a6dd399fbbad7e4ad7036293c8b4cb599199e0"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "product_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "variant_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_data`"}, "model.shopify_source.stg_shopify__order_line": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_line_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_line_tmp')),\n staging_columns=get_order_line_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_line_pass_through_columns') %}\n ,\n {{ var('order_line_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_line_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_line_tmp", "model.shopify_source.stg_shopify__order_line_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line"], "unique_id": "model.shopify_source.stg_shopify__order_line", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order_line.sql", "original_file_path": "models/stg_shopify__order_line.sql", "name": "stg_shopify__order_line", "alias": "stg_shopify__order_line", "checksum": {"name": "sha256", "checksum": "961391fa517a5bf84ab40e9a93d41909046267406b20a9a0eaeb01a69f143ec4"}, "tags": [], "refs": [["stg_shopify__order_line_tmp"], ["stg_shopify__order_line_tmp"]], "sources": [], "description": "Each record represents a line item from an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillable_quantity": {"name": "fulfillable_quantity", "description": "The amount available to fulfill, calculated as follows: quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The service provider that's fulfilling the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "How far along an order is in terms line items fulfilled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_gift_card": {"name": "is_gift_card", "description": "Whether the item is a gift card. If true, then the item is not taxed or considered for shipping charges.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the item in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the line item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the related order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the item before discounts have been applied in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The ID of the product that the line item belongs to. Can be null if the original product associated with the order is deleted at a later date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of items that were purchased.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_requiring_shipping": {"name": "is_requiring_shipping", "description": "Whether the item requires shipping.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "The item's SKU (stock keeping unit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_taxable": {"name": "is_taxable", "description": "Whether the item was taxable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discount": {"name": "total_discount", "description": "The total amount of the discount allocated to the line item in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The ID of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the item's supplier.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order_line.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n fulfillable_quantity\n \n as \n \n fulfillable_quantity\n \n, \n \n \n fulfillment_service\n \n as \n \n fulfillment_service\n \n, \n \n \n fulfillment_status\n \n as \n \n fulfillment_status\n \n, \n \n \n gift_card\n \n as is_gift_card , \n \n \n grams\n \n as \n \n grams\n \n, \n \n \n id\n \n as order_line_id , \n \n \n index\n \n as \n \n index\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n pre_tax_price\n \n as \n \n pre_tax_price\n \n, \n \n \n price\n \n as \n \n price\n \n, \n \n \n product_id\n \n as \n \n product_id\n \n, \n cast(null as \n numeric\n) as \n \n property_charge_interval_frequency\n \n , \n cast(null as \n string\n) as \n \n property_for_shipping_jan_3_rd_2020\n \n , \n cast(null as \n numeric\n) as \n \n property_shipping_interval_frequency\n \n , \n cast(null as \n string\n) as \n \n property_shipping_interval_unit_type\n \n , \n cast(null as \n numeric\n) as \n \n property_subscription_id\n \n , \n \n \n quantity\n \n as \n \n quantity\n \n, \n \n \n requires_shipping\n \n as is_requiring_shipping , \n \n \n sku\n \n as \n \n sku\n \n, \n \n \n taxable\n \n as is_taxable , \n \n \n title\n \n as \n \n title\n \n, \n \n \n total_discount\n \n as \n \n total_discount\n \n, \n \n \n variant_id\n \n as \n \n variant_id\n \n, \n \n \n vendor\n \n as \n \n vendor\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line`"}, "model.shopify_source.stg_shopify__refund": {"raw_sql": "with source as (\n\n select * \n from {{ ref('stg_shopify__refund_tmp') }}\n\n),\n\nrenamed as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__refund_tmp')),\n staging_columns=get_refund_columns()\n )\n }}\n \n from source\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_refund_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__refund_tmp", "model.shopify_source.stg_shopify__refund_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__refund"], "unique_id": "model.shopify_source.stg_shopify__refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__refund.sql", "original_file_path": "models/stg_shopify__refund.sql", "name": "stg_shopify__refund", "alias": "stg_shopify__refund", "checksum": {"name": "sha256", "checksum": "20ab47c1ea17b352a952dff3831bf0cc35a79e629e8a2fd26d1038dd9854d033"}, "tags": [], "refs": [["stg_shopify__refund_tmp"], ["stg_shopify__refund_tmp"]], "sources": [], "description": "Each record represents a refund within Shopify.", "columns": {"refund_id": {"name": "refund_id", "description": "The unique numeric identifier for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of the date when the refund was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "Timestamp of the date when the refund was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "User generated note attached to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock": {"name": "restock", "description": "Boolean indicating if the refund is a result of a restock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Reference to the user id which generated the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_duties_set": {"name": "total_duties_set", "description": "Record representing total duties set for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the refund is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__refund.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * \n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n id\n \n as refund_id , \n \n \n note\n \n as \n \n note\n \n, \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n processed_at\n \n as \n \n processed_at\n \n, \n \n \n restock\n \n as \n \n restock\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n \n from source\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund`"}, "model.shopify_source.stg_shopify__product": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__product_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__product_tmp')),\n staging_columns=get_product_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('product_pass_through_columns') %}\n ,\n {{ var('product_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_product_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__product_tmp", "model.shopify_source.stg_shopify__product_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product"], "unique_id": "model.shopify_source.stg_shopify__product", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__product.sql", "original_file_path": "models/stg_shopify__product.sql", "name": "stg_shopify__product", "alias": "stg_shopify__product", "checksum": {"name": "sha256", "checksum": "470f6430f6b7c22f0bbdfdf989c302463572c345232f3a7dfc033546f644689f"}, "tags": [], "refs": [["stg_shopify__product_tmp"], ["stg_shopify__product_tmp"]], "sources": [], "description": "Each record represents a product in Shopify.", "columns": {"_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Whether the record has been deleted in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the product was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "handle": {"name": "handle", "description": "A unique human-friendly string for the product. Automatically generated from the product's title.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "An unsigned 64-bit integer that's used as a unique identifier for the product. Each id is unique across the Shopify system. No two products will have the same id, even if they're from different shops.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_type": {"name": "product_type", "description": "A categorization for the product used for filtering and searching products.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_timestamp": {"name": "published_timestamp", "description": "The date and time (ISO 8601 format) when the product was published. Can be set to null to unpublish the product from the Online Store channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_scope": {"name": "published_scope", "description": "Whether the product is published to the Point of Sale channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The name of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the product was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the product's vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__product.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as created_timestamp , \n \n \n handle\n \n as \n \n handle\n \n, \n \n \n id\n \n as product_id , \n \n \n product_type\n \n as \n \n product_type\n \n, \n \n \n published_at\n \n as published_timestamp , \n \n \n published_scope\n \n as \n \n published_scope\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as updated_timestamp , \n \n \n vendor\n \n as \n \n vendor\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product`"}, "model.shopify_source.stg_shopify__product_variant": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__product_variant_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__product_variant_tmp')),\n staging_columns=get_product_variant_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('product_variant_pass_through_columns') %}\n ,\n {{ var('product_variant_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_product_variant_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__product_variant_tmp", "model.shopify_source.stg_shopify__product_variant_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product_variant"], "unique_id": "model.shopify_source.stg_shopify__product_variant", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__product_variant.sql", "original_file_path": "models/stg_shopify__product_variant.sql", "name": "stg_shopify__product_variant", "alias": "stg_shopify__product_variant", "checksum": {"name": "sha256", "checksum": "0bfac7e5aab433722634b674b7ac67d409184b9f8168d4cec962009ff3a3ce1e"}, "tags": [], "refs": [["stg_shopify__product_variant_tmp"], ["stg_shopify__product_variant_tmp"]], "sources": [], "description": "Each record represents a product variant in Shopify", "columns": {"barcode": {"name": "barcode", "description": "The barcode, UPC, or ISBN number for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "compare_at_price": {"name": "compare_at_price", "description": "The original price of the item before an adjustment or a sale.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time (ISO 8601 format) when the product variant was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The fulfillment service associated with the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the product variant in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The unique numeric identifier for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "image_id": {"name": "image_id", "description": "The unique numeric identifier for a product's image. The image must be associated to the same product as the variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_item_id": {"name": "inventory_item_id", "description": "The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_management": {"name": "inventory_management", "description": "The fulfillment service that tracks the number of items in stock for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_policy": {"name": "inventory_policy", "description": "Whether customers are allowed to place an order for the product variant when it's out of stock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_quantity": {"name": "inventory_quantity", "description": "An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "old_inventory_quantity": {"name": "old_inventory_quantity", "description": "This property is deprecated. Use the InventoryLevel resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_1": {"name": "option_1", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_2": {"name": "option_2", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_3": {"name": "option_3", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The order of the product variant in the list of product variants. The first position in the list is 1. The position of variants is indicated by the order in which they are listed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The unique numeric identifier for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_requiring_shipping": {"name": "is_requiring_shipping", "description": "This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_taxable": {"name": "is_taxable", "description": "Whether a tax is charged when the product variant is sold.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_code": {"name": "tax_code", "description": "This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product variant. The title field is a concatenation of the option1, option2, and option3 fields. You can only update title indirectly using the option fields.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the product variant was last modified. Gets returned in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight": {"name": "weight", "description": "The weight of the product variant in the unit system specified with weight_unit.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight_unit": {"name": "weight_unit", "description": "The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__product_variant.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n id\n \n as variant_id , \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as created_timestamp , \n \n \n updated_at\n \n as updated_timestamp , \n \n \n product_id\n \n as \n \n product_id\n \n, \n \n \n inventory_item_id\n \n as \n \n inventory_item_id\n \n, \n \n \n image_id\n \n as \n \n image_id\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n price\n \n as \n \n price\n \n, \n \n \n sku\n \n as \n \n sku\n \n, \n \n \n position\n \n as \n \n position\n \n, \n \n \n inventory_policy\n \n as \n \n inventory_policy\n \n, \n \n \n compare_at_price\n \n as \n \n compare_at_price\n \n, \n \n \n fulfillment_service\n \n as \n \n fulfillment_service\n \n, \n \n \n inventory_management\n \n as \n \n inventory_management\n \n, \n \n \n taxable\n \n as is_taxable , \n \n \n barcode\n \n as \n \n barcode\n \n, \n \n \n grams\n \n as \n \n grams\n \n, \n \n \n inventory_quantity\n \n as \n \n inventory_quantity\n \n, \n \n \n weight\n \n as \n \n weight\n \n, \n \n \n weight_unit\n \n as \n \n weight_unit\n \n, \n \n \n option_1\n \n as \n \n option_1\n \n, \n \n \n option_2\n \n as \n \n option_2\n \n, \n \n \n option_3\n \n as \n \n option_3\n \n, \n \n \n tax_code\n \n as \n \n tax_code\n \n, \n \n \n old_inventory_quantity\n \n as \n \n old_inventory_quantity\n \n, \n \n \n requires_shipping\n \n as is_requiring_shipping \n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant`"}, "model.shopify_source.stg_shopify__order": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_tmp')),\n staging_columns=get_order_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_pass_through_columns') %}\n ,\n {{ var('order_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_tmp", "model.shopify_source.stg_shopify__order_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order"], "unique_id": "model.shopify_source.stg_shopify__order", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order.sql", "original_file_path": "models/stg_shopify__order.sql", "name": "stg_shopify__order", "alias": "stg_shopify__order", "checksum": {"name": "sha256", "checksum": "92d39b99aabc22ec3997565a7ef8635a299738e18331d9e5a4f689a713ae14eb"}, "tags": [], "refs": [["stg_shopify__order_tmp"], ["stg_shopify__order_tmp"]], "sources": [], "description": "Each record represents an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The ID of the app that created the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_1": {"name": "billing_address_address_1", "description": "The street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_2": {"name": "billing_address_address_2", "description": "An optional additional field for the street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_city": {"name": "billing_address_city", "description": "The city, town, or village of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_company": {"name": "billing_address_company", "description": "The company of the person associated with the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country": {"name": "billing_address_country", "description": "The name of the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country_code": {"name": "billing_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_first_name": {"name": "billing_address_first_name", "description": "The first name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_last_name": {"name": "billing_address_last_name", "description": "The last name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_latitude": {"name": "billing_address_latitude", "description": "The latitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_longitude": {"name": "billing_address_longitude", "description": "The longitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_name": {"name": "billing_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_phone": {"name": "billing_address_phone", "description": "The phone number at the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province": {"name": "billing_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province_code": {"name": "billing_address_province_code", "description": "The two-letter abbreviation of the region of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_zip": {"name": "billing_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "browser_ip": {"name": "browser_ip", "description": "The IP address of the browser used by the customer when they placed the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_buyer_accepted_marketing": {"name": "has_buyer_accepted_marketing", "description": "Whether the customer consented to receive email updates from the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancel_reason": {"name": "cancel_reason", "description": "The reason why the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancelled_timestamp": {"name": "cancelled_timestamp", "description": "The date and time when the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cart_token": {"name": "cart_token", "description": "The ID of the cart that's associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_timestamp": {"name": "closed_timestamp", "description": "The date and time when the order was closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The autogenerated date and time when the order was created in Shopify.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code for the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "The ID of the order's customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The customer's email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "financial_status": {"name": "financial_status", "description": "The status of payments associated with the order. Can only be set when the order is created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "The order's status in terms of fulfilled line items.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the order, used for API purposes. This is different from the order_number property, which is the ID used by the shop owner and customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "landing_site_base_url": {"name": "landing_site_base_url", "description": "The URL for the page where the buyer landed when they entered the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the order was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The order name, generated by combining the order_number property with the order prefix and suffix that are set in the merchant's general settings.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "An optional note that a shop owner can attach to the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The order's position in the shop's count of orders. Numbers are sequential and start at 1.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "The order 's position in the shop's count of orders starting at 1001. Order numbers are sequential and start at 1001.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when an order was processed. This value is the date that appears on your orders and that's used in the analytic reports.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processing_method": {"name": "processing_method", "description": "How the payment was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "referring_site": {"name": "referring_site", "description": "The website where the customer clicked a link to the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_1": {"name": "shipping_address_address_1", "description": "The street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_2": {"name": "shipping_address_address_2", "description": "An optional additional field for the street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_city": {"name": "shipping_address_city", "description": "The city, town, or village of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_company": {"name": "shipping_address_company", "description": "The company of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country": {"name": "shipping_address_country", "description": "The name of the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country_code": {"name": "shipping_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_first_name": {"name": "shipping_address_first_name", "description": "The first name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_last_name": {"name": "shipping_address_last_name", "description": "The last name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_latitude": {"name": "shipping_address_latitude", "description": "The latitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_longitude": {"name": "shipping_address_longitude", "description": "The longitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_name": {"name": "shipping_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_phone": {"name": "shipping_address_phone", "description": "The phone number at the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province": {"name": "shipping_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province_code": {"name": "shipping_address_province_code", "description": "The two-letter abbreviation of the region of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_zip": {"name": "shipping_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "Where the order originated. Can be set only during order creation, and is not writeable afterwards.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal_price": {"name": "subtotal_price", "description": "The price of the order in the shop currency after discounts but before shipping, taxes, and tips.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_taxes_included": {"name": "has_taxes_included", "description": "Whether taxes are included in the order subtotal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_test_order": {"name": "is_test_order", "description": "Whether this is a test order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "token": {"name": "token", "description": "A unique token for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discounts": {"name": "total_discounts", "description": "The total discounts applied to the price of the order in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_line_items_price": {"name": "total_line_items_price", "description": "The sum of all line item prices in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The sum of all the taxes applied to the order in th shop currency. Must be positive).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_weight": {"name": "total_weight", "description": "The sum of all line item weights in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time (ISO 8601 format) when the order was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID of the user logged into Shopify POS who processed the order, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_shipping_price_set": {"name": "total_shipping_price_set", "description": "The total shipping price set for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "index": {"name": "index", "description": "The index associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pre_tax_price": {"name": "pre_tax_price", "description": "The total pre tax price of the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n billing_address_address_1\n \n as \n \n billing_address_address_1\n \n, \n \n \n billing_address_address_2\n \n as \n \n billing_address_address_2\n \n, \n \n \n billing_address_city\n \n as \n \n billing_address_city\n \n, \n \n \n billing_address_company\n \n as \n \n billing_address_company\n \n, \n \n \n billing_address_country\n \n as \n \n billing_address_country\n \n, \n \n \n billing_address_country_code\n \n as \n \n billing_address_country_code\n \n, \n \n \n billing_address_first_name\n \n as \n \n billing_address_first_name\n \n, \n \n \n billing_address_last_name\n \n as \n \n billing_address_last_name\n \n, \n \n \n billing_address_latitude\n \n as \n \n billing_address_latitude\n \n, \n \n \n billing_address_longitude\n \n as \n \n billing_address_longitude\n \n, \n \n \n billing_address_name\n \n as \n \n billing_address_name\n \n, \n \n \n billing_address_phone\n \n as \n \n billing_address_phone\n \n, \n \n \n billing_address_province\n \n as \n \n billing_address_province\n \n, \n \n \n billing_address_province_code\n \n as \n \n billing_address_province_code\n \n, \n \n \n billing_address_zip\n \n as \n \n billing_address_zip\n \n, \n \n \n browser_ip\n \n as \n \n browser_ip\n \n, \n \n \n buyer_accepts_marketing\n \n as has_buyer_accepted_marketing , \n \n \n cancel_reason\n \n as \n \n cancel_reason\n \n, \n \n \n cancelled_at\n \n as cancelled_timestamp , \n \n \n cart_token\n \n as \n \n cart_token\n \n, \n \n \n checkout_token\n \n as \n \n checkout_token\n \n, \n \n \n closed_at\n \n as closed_timestamp , \n \n \n created_at\n \n as created_timestamp , \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n customer_id\n \n as \n \n customer_id\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n financial_status\n \n as \n \n financial_status\n \n, \n \n \n fulfillment_status\n \n as \n \n fulfillment_status\n \n, \n \n \n id\n \n as order_id , \n \n \n landing_site_base_url\n \n as \n \n landing_site_base_url\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 \n \n note\n \n as \n \n note\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n order_number\n \n as \n \n order_number\n \n, \n \n \n processed_at\n \n as processed_timestamp , \n \n \n processing_method\n \n as \n \n processing_method\n \n, \n \n \n referring_site\n \n as \n \n referring_site\n \n, \n cast(null as \n string\n) as \n \n total_shipping_price_set\n \n , \n \n \n shipping_address_address_1\n \n as \n \n shipping_address_address_1\n \n, \n \n \n shipping_address_address_2\n \n as \n \n shipping_address_address_2\n \n, \n \n \n shipping_address_city\n \n as \n \n shipping_address_city\n \n, \n \n \n shipping_address_company\n \n as \n \n shipping_address_company\n \n, \n \n \n shipping_address_country\n \n as \n \n shipping_address_country\n \n, \n \n \n shipping_address_country_code\n \n as \n \n shipping_address_country_code\n \n, \n \n \n shipping_address_first_name\n \n as \n \n shipping_address_first_name\n \n, \n \n \n shipping_address_last_name\n \n as \n \n shipping_address_last_name\n \n, \n \n \n shipping_address_latitude\n \n as \n \n shipping_address_latitude\n \n, \n \n \n shipping_address_longitude\n \n as \n \n shipping_address_longitude\n \n, \n \n \n shipping_address_name\n \n as \n \n shipping_address_name\n \n, \n \n \n shipping_address_phone\n \n as \n \n shipping_address_phone\n \n, \n \n \n shipping_address_province\n \n as \n \n shipping_address_province\n \n, \n \n \n shipping_address_province_code\n \n as \n \n shipping_address_province_code\n \n, \n \n \n shipping_address_zip\n \n as \n \n shipping_address_zip\n \n, \n \n \n source_name\n \n as \n \n source_name\n \n, \n \n \n subtotal_price\n \n as \n \n subtotal_price\n \n, \n \n \n taxes_included\n \n as has_taxes_included , \n \n \n test\n \n as is_test_order , \n \n \n token\n \n as \n \n token\n \n, \n \n \n total_discounts\n \n as \n \n total_discounts\n \n, \n \n \n total_line_items_price\n \n as \n \n total_line_items_price\n \n, \n \n \n total_price\n \n as \n \n total_price\n \n, \n \n \n total_tax\n \n as \n \n total_tax\n \n, \n \n \n total_weight\n \n as \n \n total_weight\n \n, \n \n \n updated_at\n \n as updated_timestamp , \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order`"}, "model.shopify_source.stg_shopify__transaction": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__transaction_tmp') }}\n\n),\n\nrenamed as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__transaction_tmp')),\n staging_columns=get_transaction_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('transaction_pass_through_columns') %}\n ,\n {{ var('transaction_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n where not test\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_transaction_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__transaction_tmp", "model.shopify_source.stg_shopify__transaction_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__transaction"], "unique_id": "model.shopify_source.stg_shopify__transaction", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__transaction.sql", "original_file_path": "models/stg_shopify__transaction.sql", "name": "stg_shopify__transaction", "alias": "stg_shopify__transaction", "checksum": {"name": "sha256", "checksum": "f8f807ac9ac627ebd0cbb81ab4023242f02ba5724e1ecd2c10913335e7ff277b"}, "tags": [], "refs": [["stg_shopify__transaction_tmp"], ["stg_shopify__transaction_tmp"]], "sources": [], "description": "Each record represents a transaction in Shopify.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The ID for the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID for the order that the transaction is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID associated with a refund in the refund table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of money included in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authorization": {"name": "authorization", "description": "The authorization code associated with the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the transaction was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when a transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device_id": {"name": "device_id", "description": "The ID for the device.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gateway": {"name": "gateway", "description": "The name of the gateway the transaction was issued through.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "The origin of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "message": {"name": "message", "description": "A string generated by the payment provider with additional information about why the transaction succeeded or failed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code (ISO 4217 format) for the currency used for the payment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The ID of an associated transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_avs_result_code": {"name": "payment_avs_result_code", "description": "The response code from the address verification system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_bin": {"name": "payment_credit_card_bin", "description": "The issuer identification number (IIN), formerly known as bank identification number (BIN) of the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_cvv_result_code": {"name": "payment_cvv_result_code", "description": "The response code from the credit card company indicating whether the customer entered the card security code, or card verification value, correctly.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_number": {"name": "payment_credit_card_number", "description": "The customer's credit card number, with most of the leading digits redacted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_company": {"name": "payment_credit_card_company", "description": "The name of the company that issued the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The transaction's type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "receipt": {"name": "receipt", "description": "A transaction receipt attached to the transaction by the gateway.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_id": {"name": "currency_exchange_id", "description": "The ID of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_adjustment": {"name": "currency_exchange_adjustment", "description": "The difference between the amounts on the associated transaction and the parent transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_original_amount": {"name": "currency_exchange_original_amount", "description": "The amount of the parent transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_final_amount": {"name": "currency_exchange_final_amount", "description": "The amount of the associated transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_currency": {"name": "currency_exchange_currency", "description": "The shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "error_code": {"name": "error_code", "description": "A standardized error code, independent of the payment provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether the transaction is a test transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__transaction.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction_tmp`\n\n),\n\nrenamed as (\n\n select\n\n \n \n \n id\n \n as transaction_id , \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n refund_id\n \n as \n \n refund_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n created_at\n \n as created_timestamp , \n \n \n processed_at\n \n as processed_timestamp , \n \n \n device_id\n \n as \n \n device_id\n \n, \n \n \n gateway\n \n as \n \n gateway\n \n, \n \n \n source_name\n \n as \n \n source_name\n \n, \n \n \n message\n \n as \n \n message\n \n, \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n location_id\n \n as \n \n location_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n payment_avs_result_code\n \n as \n \n payment_avs_result_code\n \n, \n \n \n payment_credit_card_bin\n \n as \n \n payment_credit_card_bin\n \n, \n \n \n payment_cvv_result_code\n \n as \n \n payment_cvv_result_code\n \n, \n \n \n payment_credit_card_number\n \n as \n \n payment_credit_card_number\n \n, \n \n \n payment_credit_card_company\n \n as \n \n payment_credit_card_company\n \n, \n \n \n kind\n \n as \n \n kind\n \n, \n \n \n receipt\n \n as \n \n receipt\n \n, \n \n \n currency_exchange_id\n \n as \n \n currency_exchange_id\n \n, \n \n \n currency_exchange_adjustment\n \n as \n \n currency_exchange_adjustment\n \n, \n \n \n currency_exchange_original_amount\n \n as \n \n currency_exchange_original_amount\n \n, \n \n \n currency_exchange_final_amount\n \n as \n \n currency_exchange_final_amount\n \n, \n \n \n currency_exchange_currency\n \n as \n \n currency_exchange_currency\n \n, \n \n \n error_code\n \n as \n \n error_code\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n test\n \n as \n \n test\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n where not test\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction`"}, "model.shopify_source.stg_shopify__order_adjustment": {"raw_sql": "with source as (\n\n select * \n from {{ ref('stg_shopify__order_adjustment_tmp') }}\n\n),\n\nrenamed as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_adjustment_tmp')),\n staging_columns=get_order_adjustment_columns()\n )\n }}\n \n from source\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_adjustment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment_tmp", "model.shopify_source.stg_shopify__order_adjustment_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_adjustment"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order_adjustment.sql", "original_file_path": "models/stg_shopify__order_adjustment.sql", "name": "stg_shopify__order_adjustment", "alias": "stg_shopify__order_adjustment", "checksum": {"name": "sha256", "checksum": "46da70e0f39c656244e8fb915416eb195ba18729dd920ae10ee8e19fad0c0151"}, "tags": [], "refs": [["stg_shopify__order_adjustment_tmp"], ["stg_shopify__order_adjustment_tmp"]], "sources": [], "description": "Each record represents and adjustment to and order within Shopify.", "columns": {"order_adjustment_id": {"name": "order_adjustment_id", "description": "The unique numeric identifier for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "Reference to the refund which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Amount of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount": {"name": "tax_amount", "description": "Tax amount applied to the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The kind of order adjustment (eg. refund, restock, etc.).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "The reason for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount_set": {"name": "amount_set", "description": "Amount set towards the order adjustment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount_set": {"name": "tax_amount_set", "description": "Tax amount set towards the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order_adjustment.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * \n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n id\n \n as order_adjustment_id , \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n refund_id\n \n as \n \n refund_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n tax_amount\n \n as \n \n tax_amount\n \n, \n \n \n kind\n \n as \n \n kind\n \n, \n \n \n reason\n \n as \n \n reason\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n\n\n\n \n from source\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`"}, "model.shopify_source.stg_shopify__customer": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__customer_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__customer_tmp')),\n staging_columns=get_customer_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('customer_pass_through_columns') %}\n ,\n {{ var('customer_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_customer_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__customer_tmp", "model.shopify_source.stg_shopify__customer_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__customer"], "unique_id": "model.shopify_source.stg_shopify__customer", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__customer.sql", "original_file_path": "models/stg_shopify__customer.sql", "name": "stg_shopify__customer", "alias": "stg_shopify__customer", "checksum": {"name": "sha256", "checksum": "266d051984b96bb4f699dacb99811ddbcc05078ec34cd7ce2f0f117163d78e28"}, "tags": [], "refs": [["stg_shopify__customer_tmp"], ["stg_shopify__customer_tmp"]], "sources": [], "description": "Each record represents a customer in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_accepted_marketing": {"name": "has_accepted_marketing", "description": "Whether the customer has consented to receive marketing material via email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the customer was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_address_id": {"name": "default_address_id", "description": "The default address for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The customer's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "A unique identifier for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The customer's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orders_count": {"name": "orders_count", "description": "The number of orders associated with this customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_state": {"name": "account_state", "description": "The state of the customer's account with a shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_tax_exempt": {"name": "is_tax_exempt", "description": "Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_spent": {"name": "total_spent", "description": "The total amount of money that the customer has spent across their order history.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the customer information was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_verified_email": {"name": "is_verified_email", "description": "Whether the customer has verified their email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__customer.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n accepts_marketing\n \n as has_accepted_marketing , \n \n \n created_at\n \n as created_timestamp , \n \n \n default_address_id\n \n as \n \n default_address_id\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n id\n \n as customer_id , \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n orders_count\n \n as \n \n orders_count\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n state\n \n as account_state , \n \n \n tax_exempt\n \n as is_tax_exempt , \n \n \n total_spent\n \n as \n \n total_spent\n \n, \n \n \n updated_at\n \n as updated_timestamp , \n \n \n verified_email\n \n as is_verified_email \n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer`"}, "model.shopify_source.stg_shopify__order_line_refund": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_line_refund_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_line_refund_tmp')),\n staging_columns=get_order_line_refund_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_line_refund_pass_through_columns') %}\n ,\n {{ var('order_line_refund_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_line_refund_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund_tmp", "model.shopify_source.stg_shopify__order_line_refund_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line_refund"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order_line_refund.sql", "original_file_path": "models/stg_shopify__order_line_refund.sql", "name": "stg_shopify__order_line_refund", "alias": "stg_shopify__order_line_refund", "checksum": {"name": "sha256", "checksum": "299d1175d39aa9b204dc1cc358faa49285944c1955f34209cadfe4e97936a065"}, "tags": [], "refs": [["stg_shopify__order_line_refund_tmp"], ["stg_shopify__order_line_refund_tmp"]], "sources": [], "description": "Each record represents a line item from an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_refund_id": {"name": "order_line_refund_id", "description": "The unique identifier of the line item in the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "TThe unique identifier of the location where the items will be restockedBD", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the related line item in the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the associated line item that was returned.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID of the related refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock_type": {"name": "restock_type", "description": "How this refund line item affects inventory levels.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal": {"name": "subtotal", "description": "Subtotal amount of the order line refund", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The total tax applied to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order_line_refund.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n id\n \n as order_line_refund_id , \n \n \n location_id\n \n as \n \n location_id\n \n, \n \n \n order_line_id\n \n as \n \n order_line_id\n \n, \n \n \n subtotal\n \n as \n \n subtotal\n \n, \n \n \n total_tax\n \n as \n \n total_tax\n \n, \n \n \n quantity\n \n as \n \n quantity\n \n, \n \n \n refund_id\n \n as \n \n refund_id\n \n, \n \n \n restock_type\n \n as \n \n restock_type\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`"}, "model.shopify_source.stg_shopify__customer_tmp": {"raw_sql": "select * \nfrom {{ var('customer_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_customer_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__customer_tmp"], "unique_id": "model.shopify_source.stg_shopify__customer_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__customer_tmp.sql", "original_file_path": "models/tmp/stg_shopify__customer_tmp.sql", "name": "stg_shopify__customer_tmp", "alias": "stg_shopify__customer_tmp", "checksum": {"name": "sha256", "checksum": "deaf49343836d3356ee206649fef0d98b18ec5bc641986c22f62023da7fff775"}, "tags": [], "refs": [["shopify_customer_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__customer_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_customer_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer_tmp`"}, "model.shopify_source.stg_shopify__order_line_tmp": {"raw_sql": "select * \nfrom {{ var('order_line_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_line_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_line_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_line_tmp.sql", "name": "stg_shopify__order_line_tmp", "alias": "stg_shopify__order_line_tmp", "checksum": {"name": "sha256", "checksum": "4f88b0914ec43445b81faff6b8be89de161ef6df43072b89abbecee6579406f8"}, "tags": [], "refs": [["shopify_order_line_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_line_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_tmp`"}, "model.shopify_source.stg_shopify__refund_tmp": {"raw_sql": "select * from {{ var('refund_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_refund_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__refund_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__refund_tmp.sql", "original_file_path": "models/tmp/stg_shopify__refund_tmp.sql", "name": "stg_shopify__refund_tmp", "alias": "stg_shopify__refund_tmp", "checksum": {"name": "sha256", "checksum": "b3f28d92902436cbadbd58025984940667683f3464d32b4ed4af9e4fee62b63f"}, "tags": [], "refs": [["shopify_refund_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__refund_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * from `dbt-package-testing`.`shopify_integration_tests`.`shopify_refund_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund_tmp`"}, "model.shopify_source.stg_shopify__product_tmp": {"raw_sql": "select * \nfrom {{ var('product_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_product_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__product_tmp.sql", "original_file_path": "models/tmp/stg_shopify__product_tmp.sql", "name": "stg_shopify__product_tmp", "alias": "stg_shopify__product_tmp", "checksum": {"name": "sha256", "checksum": "dffc13a21ff254e1da0215bf970c1a017dc97b3ce01213de77f5d9ec5ad55058"}, "tags": [], "refs": [["shopify_product_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__product_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_product_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_tmp`"}, "model.shopify_source.stg_shopify__order_adjustment_tmp": {"raw_sql": "select * from {{ var('order_adjustment_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_adjustment_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_adjustment_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_adjustment_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_adjustment_tmp.sql", "name": "stg_shopify__order_adjustment_tmp", "alias": "stg_shopify__order_adjustment_tmp", "checksum": {"name": "sha256", "checksum": "101e5ba755fa6754726a19e618a84d69b19292c1798cf7a95ff626403a6391fb"}, "tags": [], "refs": [["shopify_order_adjustment_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_adjustment_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * from `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_adjustment_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment_tmp`"}, "model.shopify_source.stg_shopify__order_line_refund_tmp": {"raw_sql": "select * \nfrom {{ var('order_line_refund_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_line_refund_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_line_refund_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_line_refund_tmp.sql", "name": "stg_shopify__order_line_refund_tmp", "alias": "stg_shopify__order_line_refund_tmp", "checksum": {"name": "sha256", "checksum": "c8fbe437524231390da877b9938924ba3c35eb512e66cd8170effef15f4c833d"}, "tags": [], "refs": [["shopify_order_line_refund_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_line_refund_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_refund_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund_tmp`"}, "model.shopify_source.stg_shopify__transaction_tmp": {"raw_sql": "select *\nfrom {{ var('transaction_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_transaction_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__transaction_tmp"], "unique_id": "model.shopify_source.stg_shopify__transaction_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__transaction_tmp.sql", "original_file_path": "models/tmp/stg_shopify__transaction_tmp.sql", "name": "stg_shopify__transaction_tmp", "alias": "stg_shopify__transaction_tmp", "checksum": {"name": "sha256", "checksum": "1ff90d82e3717cc2fed52f012d44b32b056f4557d7eacbf7bbd9939db945d218"}, "tags": [], "refs": [["shopify_transaction_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__transaction_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select *\nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_transaction_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction_tmp`"}, "model.shopify_source.stg_shopify__product_variant_tmp": {"raw_sql": "select * \nfrom {{ var('product_variant_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_product_variant_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_variant_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_variant_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__product_variant_tmp.sql", "original_file_path": "models/tmp/stg_shopify__product_variant_tmp.sql", "name": "stg_shopify__product_variant_tmp", "alias": "stg_shopify__product_variant_tmp", "checksum": {"name": "sha256", "checksum": "2fc5d907ac6851ad0c903c4582ad191688fb04b6d0675d69f26704a6bb52d1ce"}, "tags": [], "refs": [["shopify_product_variant_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__product_variant_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_product_variant_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant_tmp`"}, "model.shopify_source.stg_shopify__order_tmp": {"raw_sql": "select * \nfrom {{ var('order_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_tmp.sql", "name": "stg_shopify__order_tmp", "alias": "stg_shopify__order_tmp", "checksum": {"name": "sha256", "checksum": "6366abc8eea74fea0832c0ad9084a1ddeb3f38409990d2cfdeff83c8b01f1e5f"}, "tags": [], "refs": [["shopify_order_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_tmp`"}, "test.shopify_source.unique_stg_shopify__customer_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_shopify__customer') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__customer"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__customer_customer_id"], "unique_id": "test.shopify_source.unique_stg_shopify__customer_customer_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__customer_customer_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__customer_customer_id", "alias": "unique_stg_shopify__customer_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__customer"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__customer_customer_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "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`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer`\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.shopify_source.not_null_stg_shopify__customer_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_shopify__customer') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__customer"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__customer_customer_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__customer_customer_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__customer_customer_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__customer_customer_id", "alias": "not_null_stg_shopify__customer_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__customer"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__customer_customer_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer`\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_line_refund_id", "model": "{{ ref('stg_shopify__order_line_refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_line_refund_order_line_refund_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_line_refund_order_line_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_line_refund_order_line_refund_id", "alias": "unique_stg_shopify__order_line_refund_order_line_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line_refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_line_refund_order_line_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_line_refund_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`\n where order_line_refund_id is not null\n group by order_line_refund_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_refund_id"}, "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_line_refund_id", "model": "{{ ref('stg_shopify__order_line_refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_line_refund_order_line_refund_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_line_refund_order_line_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_line_refund_order_line_refund_id", "alias": "not_null_stg_shopify__order_line_refund_order_line_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line_refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_line_refund_order_line_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`\nwhere order_line_refund_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_refund_id"}, "test.shopify_source.unique_stg_shopify__order_line_order_line_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_line_id", "model": "{{ ref('stg_shopify__order_line') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order_line"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_line_order_line_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_line_order_line_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_line_order_line_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_line_order_line_id", "alias": "unique_stg_shopify__order_line_order_line_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_line_order_line_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_line_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line`\n where order_line_id is not null\n group by order_line_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_id"}, "test.shopify_source.not_null_stg_shopify__order_line_order_line_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_line_id", "model": "{{ ref('stg_shopify__order_line') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order_line"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_line_order_line_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_line_order_line_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_line_order_line_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_line_order_line_id", "alias": "not_null_stg_shopify__order_line_order_line_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_line_order_line_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line`\nwhere order_line_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_id"}, "test.shopify_source.unique_stg_shopify__order_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ ref('stg_shopify__order') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_order_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_order_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_order_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_order_id", "alias": "unique_stg_shopify__order_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_order_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order`\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.shopify_source.not_null_stg_shopify__order_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ ref('stg_shopify__order') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_order_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_order_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_order_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_order_id", "alias": "not_null_stg_shopify__order_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_order_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order`\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.shopify_source.unique_stg_shopify__product_product_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "product_id", "model": "{{ ref('stg_shopify__product') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__product"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__product_product_id"], "unique_id": "test.shopify_source.unique_stg_shopify__product_product_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__product_product_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__product_product_id", "alias": "unique_stg_shopify__product_product_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__product_product_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n product_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product`\n where product_id is not null\n group by product_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "product_id"}, "test.shopify_source.not_null_stg_shopify__product_product_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "product_id", "model": "{{ ref('stg_shopify__product') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__product"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__product_product_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__product_product_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__product_product_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__product_product_id", "alias": "not_null_stg_shopify__product_product_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__product_product_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product`\nwhere product_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "product_id"}, "test.shopify_source.not_null_stg_shopify__product_variant_variant_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "variant_id", "model": "{{ ref('stg_shopify__product_variant') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__product_variant"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__product_variant_variant_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__product_variant_variant_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__product_variant_variant_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__product_variant_variant_id", "alias": "not_null_stg_shopify__product_variant_variant_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product_variant"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__product_variant_variant_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant`\nwhere variant_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "variant_id"}, "test.shopify_source.unique_stg_shopify__product_variant_variant_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "variant_id", "model": "{{ ref('stg_shopify__product_variant') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__product_variant"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__product_variant_variant_id"], "unique_id": "test.shopify_source.unique_stg_shopify__product_variant_variant_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__product_variant_variant_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__product_variant_variant_id", "alias": "unique_stg_shopify__product_variant_variant_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product_variant"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__product_variant_variant_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n variant_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant`\n where variant_id is not null\n group by variant_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "variant_id"}, "test.shopify_source.unique_stg_shopify__transaction_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_shopify__transaction') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__transaction"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__transaction_transaction_id"], "unique_id": "test.shopify_source.unique_stg_shopify__transaction_transaction_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__transaction_transaction_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__transaction_transaction_id", "alias": "unique_stg_shopify__transaction_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__transaction"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__transaction_transaction_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "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`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction`\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.shopify_source.not_null_stg_shopify__transaction_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_shopify__transaction') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__transaction"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__transaction_transaction_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__transaction_transaction_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__transaction_transaction_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__transaction_transaction_id", "alias": "not_null_stg_shopify__transaction_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__transaction"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__transaction_transaction_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction`\nwhere transaction_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_id"}, "test.shopify_source.unique_stg_shopify__refund_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "refund_id", "model": "{{ ref('stg_shopify__refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__refund_refund_id"], "unique_id": "test.shopify_source.unique_stg_shopify__refund_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__refund_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__refund_refund_id", "alias": "unique_stg_shopify__refund_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__refund_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n refund_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund`\n where refund_id is not null\n group by refund_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "refund_id"}, "test.shopify_source.not_null_stg_shopify__refund_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "refund_id", "model": "{{ ref('stg_shopify__refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__refund_refund_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__refund_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__refund_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__refund_refund_id", "alias": "not_null_stg_shopify__refund_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__refund_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund`\nwhere refund_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "refund_id"}, "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_adjustment_id", "model": "{{ ref('stg_shopify__order_adjustment') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_adjustment_order_adjustment_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_adjustment_order_adjustment_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_adjustment_order_adjustment_id", "alias": "unique_stg_shopify__order_adjustment_order_adjustment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_adjustment"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_adjustment_order_adjustment_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_adjustment_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`\n where order_adjustment_id is not null\n group by order_adjustment_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_adjustment_id"}, "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_adjustment_id", "model": "{{ ref('stg_shopify__order_adjustment') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_adjustment_order_adjustment_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_adjustment_order_adjustment_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_adjustment_order_adjustment_id", "alias": "not_null_stg_shopify__order_adjustment_order_adjustment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_adjustment"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_adjustment_order_adjustment_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`\nwhere order_adjustment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_adjustment_id"}}, "sources": {"source.shopify_source.shopify.order": {"fqn": ["shopify_source", "shopify", "order"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": true, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The ID of the app that created the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_1": {"name": "billing_address_address_1", "description": "The street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_2": {"name": "billing_address_address_2", "description": "An optional additional field for the street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_city": {"name": "billing_address_city", "description": "The city, town, or village of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_company": {"name": "billing_address_company", "description": "The company of the person associated with the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country": {"name": "billing_address_country", "description": "The name of the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country_code": {"name": "billing_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_first_name": {"name": "billing_address_first_name", "description": "The first name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_last_name": {"name": "billing_address_last_name", "description": "The last name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_latitude": {"name": "billing_address_latitude", "description": "The latitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_longitude": {"name": "billing_address_longitude", "description": "The longitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_name": {"name": "billing_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_phone": {"name": "billing_address_phone", "description": "The phone number at the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province": {"name": "billing_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province_code": {"name": "billing_address_province_code", "description": "The two-letter abbreviation of the region of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_zip": {"name": "billing_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "browser_ip": {"name": "browser_ip", "description": "The IP address of the browser used by the customer when they placed the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "buyer_accepts_marketing": {"name": "buyer_accepts_marketing", "description": "Whether the customer consented to receive email updates from the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancel_reason": {"name": "cancel_reason", "description": "The reason why the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancelled_at": {"name": "cancelled_at", "description": "The date and time when the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cart_token": {"name": "cart_token", "description": "The ID of the cart that's associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The date and time when the order was closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The autogenerated date and time when the order was created in Shopify.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code for the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "The ID of the order's customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The customer's email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "financial_status": {"name": "financial_status", "description": "The status of payments associated with the order. Can only be set when the order is created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "The order's status in terms of fulfilled line items.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The ID of the order, used for API purposes. This is different from the order_number property, which is the ID used by the shop owner and customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "landing_site_base_url": {"name": "landing_site_base_url", "description": "The URL for the page where the buyer landed when they entered the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the order was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The order name, generated by combining the order_number property with the order prefix and suffix that are set in the merchant's general settings.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "An optional note that a shop owner can attach to the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The order's position in the shop's count of orders. Numbers are sequential and start at 1.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "The order 's position in the shop's count of orders starting at 1001. Order numbers are sequential and start at 1001.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "The date and time when an order was processed. This value is the date that appears on your orders and that's used in the analytic reports.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processing_method": {"name": "processing_method", "description": "How the payment was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "referring_site": {"name": "referring_site", "description": "The website where the customer clicked a link to the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_1": {"name": "shipping_address_address_1", "description": "The street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_2": {"name": "shipping_address_address_2", "description": "An optional additional field for the street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_city": {"name": "shipping_address_city", "description": "The city, town, or village of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_company": {"name": "shipping_address_company", "description": "The company of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country": {"name": "shipping_address_country", "description": "The name of the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country_code": {"name": "shipping_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_first_name": {"name": "shipping_address_first_name", "description": "The first name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_last_name": {"name": "shipping_address_last_name", "description": "The last name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_latitude": {"name": "shipping_address_latitude", "description": "The latitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_longitude": {"name": "shipping_address_longitude", "description": "The longitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_name": {"name": "shipping_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_phone": {"name": "shipping_address_phone", "description": "The phone number at the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province": {"name": "shipping_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province_code": {"name": "shipping_address_province_code", "description": "The two-letter abbreviation of the region of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_zip": {"name": "shipping_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "Where the order originated. Can be set only during order creation, and is not writeable afterwards.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal_price": {"name": "subtotal_price", "description": "The price of the order in the shop currency after discounts but before shipping, taxes, and tips.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxes_included": {"name": "taxes_included", "description": "Whether taxes are included in the order subtotal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether this is a test order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "token": {"name": "token", "description": "A unique token for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discounts": {"name": "total_discounts", "description": "The total discounts applied to the price of the order in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_line_items_price": {"name": "total_line_items_price", "description": "The sum of all line item prices in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The sum of all the taxes applied to the order in th shop currency. Must be positive).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_weight": {"name": "total_weight", "description": "The sum of all line item weights in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time (ISO 8601 format) when the order was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID of the user logged into Shopify POS who processed the order, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order`"}, "source.shopify_source.shopify.customer": {"fqn": ["shopify_source", "shopify", "customer"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.customer", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "customer", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "customer", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a customer in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accepts_marketing": {"name": "accepts_marketing", "description": "Whether the customer has consented to receive marketing material via email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time when the customer was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_address_id": {"name": "default_address_id", "description": "The default address for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The customer's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "A unique identifier for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The customer's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orders_count": {"name": "orders_count", "description": "The number of orders associated with this customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the customer's account with a shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_exempt": {"name": "tax_exempt", "description": "Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_spent": {"name": "total_spent", "description": "The total amount of money that the customer has spent across their order history.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the customer information was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "verified_email": {"name": "verified_email", "description": "Whether the customer has verified their email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`customer`"}, "source.shopify_source.shopify.order_line": {"fqn": ["shopify_source", "shopify", "order_line"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_line", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_line", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_line", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a line item for an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillable_quantity": {"name": "fulfillable_quantity", "description": "The amount available to fulfill, calculated as follows: quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The service provider that's fulfilling the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "How far along an order is in terms line items fulfilled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gift_card": {"name": "gift_card", "description": "Whether the item is a gift card. If true, then the item is not taxed or considered for shipping charges.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the item in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The ID of the line item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the related order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the item before discounts have been applied in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The ID of the product that the line item belongs to. Can be null if the original product associated with the order is deleted at a later date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of items that were purchased.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requires_shipping": {"name": "requires_shipping", "description": "Whether the item requires shipping.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "The item's SKU (stock keeping unit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxable": {"name": "taxable", "description": "Whether the item was taxable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discount": {"name": "total_discount", "description": "The total amount of the discount allocated to the line item in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The ID of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the item's supplier.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order_line`"}, "source.shopify_source.shopify.order_line_refund": {"fqn": ["shopify_source", "shopify", "order_line_refund"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_line_refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_line_refund", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_line_refund", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a line item refund in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The unique identifier of the line item in the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "TThe unique identifier of the location where the items will be restockedBD", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the related line item in the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the associated line item that was returned.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID of the related refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock_type": {"name": "restock_type", "description": "How this refund line item affects inventory levels.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal": {"name": "subtotal", "description": "Subtotal amount of the order line refund", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The total tax applied to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order_line_refund`"}, "source.shopify_source.shopify.product": {"fqn": ["shopify_source", "shopify", "product"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.product", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "product", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "product", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a product in Shopify.", "columns": {"_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Whether the record has been deleted in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time when the product was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "handle": {"name": "handle", "description": "A unique human-friendly string for the product. Automatically generated from the product's title.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "An unsigned 64-bit integer that's used as a unique identifier for the product. Each id is unique across the Shopify system. No two products will have the same id, even if they're from different shops.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_type": {"name": "product_type", "description": "A categorization for the product used for filtering and searching products.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_at": {"name": "published_at", "description": "The date and time (ISO 8601 format) when the product was published. Can be set to null to unpublish the product from the Online Store channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_scope": {"name": "published_scope", "description": "Whether the product is published to the Point of Sale channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The name of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the product was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the product's vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`product`"}, "source.shopify_source.shopify.product_variant": {"fqn": ["shopify_source", "shopify", "product_variant"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.product_variant", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "product_variant", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "product_variant", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a product variant in Shopify", "columns": {"barcode": {"name": "barcode", "description": "The barcode, UPC, or ISBN number for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "compare_at_price": {"name": "compare_at_price", "description": "The original price of the item before an adjustment or a sale.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time (ISO 8601 format) when the product variant was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The fulfillment service associated with the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the product variant in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The unique numeric identifier for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "image_id": {"name": "image_id", "description": "The unique numeric identifier for a product's image. The image must be associated to the same product as the variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_item_id": {"name": "inventory_item_id", "description": "The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_management": {"name": "inventory_management", "description": "The fulfillment service that tracks the number of items in stock for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_policy": {"name": "inventory_policy", "description": "Whether customers are allowed to place an order for the product variant when it's out of stock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_quantity": {"name": "inventory_quantity", "description": "An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "old_inventory_quantity": {"name": "old_inventory_quantity", "description": "This property is deprecated. Use the InventoryLevel resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_1": {"name": "option_1", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_2": {"name": "option_2", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_3": {"name": "option_3", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The order of the product variant in the list of product variants. The first position in the list is 1. The position of variants is indicated by the order in which they are listed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The unique numeric identifier for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requires_shipping": {"name": "requires_shipping", "description": "This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxable": {"name": "taxable", "description": "Whether a tax is charged when the product variant is sold.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_code": {"name": "tax_code", "description": "This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product variant. The title field is a concatenation of the option1, option2, and option3 fields. You can only update title indirectly using the option fields.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the product variant was last modified. Gets returned in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight": {"name": "weight", "description": "The weight of the product variant in the unit system specified with weight_unit.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight_unit": {"name": "weight_unit", "description": "The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_shipping_price_set": {"name": "total_shipping_price_set", "description": "The total shipping price set for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "index": {"name": "index", "description": "The index associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pre_tax_price": {"name": "pre_tax_price", "description": "The total pre tax price of the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`product_variant`"}, "source.shopify_source.shopify.transaction": {"fqn": ["shopify_source", "shopify", "transaction"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.transaction", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "transaction", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "transaction", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a transaction in Shopify.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The ID for the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID for the order that the transaction is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID associated with a refund in the refund table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of money included in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authorization": {"name": "authorization", "description": "The authorization code associated with the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the transaction was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when a transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device_id": {"name": "device_id", "description": "The ID for the device.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gateway": {"name": "gateway", "description": "The name of the gateway the transaction was issued through.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "The origin of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "message": {"name": "message", "description": "A string generated by the payment provider with additional information about why the transaction succeeded or failed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code (ISO 4217 format) for the currency used for the payment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The ID of an associated transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_avs_result_code": {"name": "payment_avs_result_code", "description": "The response code from the address verification system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_bin": {"name": "payment_credit_card_bin", "description": "The issuer identification number (IIN), formerly known as bank identification number (BIN) of the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_cvv_result_code": {"name": "payment_cvv_result_code", "description": "The response code from the credit card company indicating whether the customer entered the card security code, or card verification value, correctly.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_number": {"name": "payment_credit_card_number", "description": "The customer's credit card number, with most of the leading digits redacted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_company": {"name": "payment_credit_card_company", "description": "The name of the company that issued the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The transaction's type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "receipt": {"name": "receipt", "description": "A transaction receipt attached to the transaction by the gateway.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_id": {"name": "currency_exchange_id", "description": "The ID of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_adjustment": {"name": "currency_exchange_adjustment", "description": "The difference between the amounts on the associated transaction and the parent transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_original_amount": {"name": "currency_exchange_original_amount", "description": "The amount of the parent transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_final_amount": {"name": "currency_exchange_final_amount", "description": "The amount of the associated transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_currency": {"name": "currency_exchange_currency", "description": "The shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "error_code": {"name": "error_code", "description": "A standardized error code, independent of the payment provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether the transaction is a test transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`transaction`"}, "source.shopify_source.shopify.refund": {"fqn": ["shopify_source", "shopify", "refund"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "refund", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "refund", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a refund within Shopify.", "columns": {"id": {"name": "id", "description": "The unique numeric identifier for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of the date when the refund was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "Timestamp of the date when the refund was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "User generated note attached to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock": {"name": "restock", "description": "Boolean indicating if the refund is a result of a restock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Reference to the user id which generated the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_duties_set": {"name": "total_duties_set", "description": "Record representing total duties set for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the refund is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`refund`"}, "source.shopify_source.shopify.order_adjustment": {"fqn": ["shopify_source", "shopify", "order_adjustment"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_adjustment", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_adjustment", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_adjustment", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents and adjustment to and order within Shopify.", "columns": {"id": {"name": "id", "description": "The unique numeric identifier for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "Reference to the refund which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Amount of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount": {"name": "tax_amount", "description": "Tax amount applied to the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The kind of order adjustment (eg. refund, restock, etc.).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "The reason for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount_set": {"name": "amount_set", "description": "Amount set towards the order adjustment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount_set": {"name": "tax_amount_set", "description": "Tax amount set towards the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order_adjustment`"}}, "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.shopify_source.get_order_columns": {"unique_id": "macro.shopify_source.get_order_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_columns", "macro_sql": "{% macro get_order_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"billing_address_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_address_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_latitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_longitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_province\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_province_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"browser_ip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"buyer_accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_buyer_accepted_marketing\"},\n {\"name\": \"cancel_reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"cancelled_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"cancelled_timestamp\"},\n {\"name\": \"cart_token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"checkout_token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"closed_timestamp\"},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customer_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"financial_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_id\"},\n {\"name\": \"landing_site_base_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"note\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"number\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"order_number\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"processing_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"referring_site\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_shipping_price_set\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_address_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_latitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_longitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_province\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_province_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"source_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subtotal_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"taxes_included\", \"datatype\": \"boolean\", \"alias\": \"has_taxes_included\"},\n {\"name\": \"test\", \"datatype\": \"boolean\", \"alias\": \"is_test_order\"},\n {\"name\": \"token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_discounts\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_line_items_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_tax\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_weight\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()}\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.shopify_source.get_customer_columns": {"unique_id": "macro.shopify_source.get_customer_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_customer_columns", "macro_sql": "{% macro get_customer_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_accepted_marketing\"},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"default_address_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"customer_id\"},\n {\"name\": \"last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"orders_count\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string(), \"alias\": \"account_state\"},\n {\"name\": \"tax_exempt\", \"datatype\": \"boolean\", \"alias\": \"is_tax_exempt\"},\n {\"name\": \"total_spent\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"verified_email\", \"datatype\": \"boolean\", \"alias\": \"is_verified_email\"}\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.shopify_source.get_order_line_refund_columns": {"unique_id": "macro.shopify_source.get_order_line_refund_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_line_refund_columns", "macro_sql": "{% macro get_order_line_refund_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_line_refund_id\"},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"order_line_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"subtotal\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"total_tax\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"restock_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.shopify_source.get_order_line_columns": {"unique_id": "macro.shopify_source.get_order_line_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_line_columns", "macro_sql": "{% macro get_order_line_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"fulfillable_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"gift_card\", \"datatype\": \"boolean\", \"alias\": \"is_gift_card\"},\n {\"name\": \"grams\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_line_id\"},\n {\"name\": \"index\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"pre_tax_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"product_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_charge_interval_frequency\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_for_shipping_jan_3_rd_2020\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"property_shipping_interval_frequency\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_shipping_interval_unit_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"property_subscription_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"requires_shipping\", \"datatype\": \"boolean\", \"alias\": \"is_requiring_shipping\"},\n {\"name\": \"sku\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_discount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"variant_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"vendor\", \"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.shopify_source.get_product_columns": {"unique_id": "macro.shopify_source.get_product_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_product_columns", "macro_sql": "{% macro get_product_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"handle\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"product_id\"},\n {\"name\": \"product_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"published_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"published_timestamp\"},\n {\"name\": \"published_scope\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"vendor\", \"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.shopify_source.get_product_variant_columns": {"unique_id": "macro.shopify_source.get_product_variant_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_product_variant_columns", "macro_sql": "{% macro get_product_variant_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"variant_id\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"product_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"inventory_item_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"image_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"sku\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"position\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"inventory_policy\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"compare_at_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inventory_management\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"barcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"grams\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"inventory_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"weight\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"weight_unit\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_3\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"old_inventory_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"requires_shipping\", \"datatype\": \"boolean\", \"alias\": \"is_requiring_shipping\"}\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.shopify_source.get_transaction_columns": {"unique_id": "macro.shopify_source.get_transaction_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_transaction_columns", "macro_sql": "{% macro get_transaction_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"transaction_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"device_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"gateway\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"source_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"message\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"payment_avs_result_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_bin\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_cvv_result_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"kind\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"receipt\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency_exchange_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_adjustment\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_original_amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_final_amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"test\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{% if target.type in ('redshift','postgres') %}\n {{ columns.append({\"name\": \"authorization\", \"datatype\": dbt_utils.type_string(), \"quote\": True, \"alias\": \"authorization\"}) }}\n{% else %}\n {\"name\": \"authorization\", \"datatype\": dbt_utils.type_string()}\n{% endif %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.shopify_source.get_refund_columns": {"unique_id": "macro.shopify_source.get_refund_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_refund_columns", "macro_sql": "{% macro get_refund_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"refund_id\"},\n {\"name\": \"note\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"restock\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()}\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.shopify_source.get_order_adjustment_columns": {"unique_id": "macro.shopify_source.get_order_adjustment_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_adjustment_columns", "macro_sql": "{% macro get_order_adjustment_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_adjustment_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"kind\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()}\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.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/geo/haversine_distance.sql", "original_file_path": "macros/geo/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1,lon1,lat2,lon2) -%}\n {{ return(adapter.dispatch('haversine_distance', packages = dbt_utils._get_utils_namespaces())(lat1,lon1,lat2,lon2)) }}\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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/geo/haversine_distance.sql", "original_file_path": "macros/geo/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1,lon1,lat2,lon2) -%}\n\n 2 * 3961 * asin(sqrt((sin(radians(({{lat2}} - {{lat1}}) / 2))) ^ 2 +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n (sin(radians(({{lon2}} - {{lon1}}) / 2))) ^ 2))\n\n{%- endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 {{ column_name }}\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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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\nwith meet_condition as (\n\n select * from {{ model }} where {{ condition }}\n\n),\nvalidation_errors as (\n\n select\n *\n from meet_condition\n where not({{expression}})\n\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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') %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', packages = dbt_utils._get_utils_namespaces())(model, lower_bound_column, upper_bound_column, partition_by, gaps)) }}\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/Shopify/dbt_shopify_source/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') %}\n\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }},\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions nore cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound < upper_bound,\n false\n ) as lower_bound_less_than_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_less_than_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect count(*) from validation_errors\n{% endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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({{ col.column }} as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.spark_utils.spark__type_numeric": {"unique_id": "macro.spark_utils.spark__type_numeric", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "name": "spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__dateadd": {"unique_id": "macro.spark_utils.spark__dateadd", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "name": "spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }}, {{interval}} * {{multiplier}})\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n {{interval}} * {{multiplier}}\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + {{interval}} * {{multiplier}}\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__datediff": {"unique_id": "macro.spark_utils.spark__datediff", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "name": "spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', second_date) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', first_date) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', second_date) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', first_date) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__current_timestamp": {"unique_id": "macro.spark_utils.spark__current_timestamp", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__current_timestamp_in_utc": {"unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__split_part": {"unique_id": "macro.spark_utils.spark__split_part", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "name": "spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_relations_by_pattern": {"unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_relations_by_prefix": {"unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_tables_by_pattern": {"unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_tables_by_prefix": {"unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.assert_not_null": {"unique_id": "macro.spark_utils.assert_not_null", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__convert_timezone": {"unique_id": "macro.spark_utils.spark__convert_timezone", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "name": "spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 explode(from_json( {{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.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 == 'bigquery' %}\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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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."}, "shopify_source._fivetran_synced": {"unique_id": "shopify_source._fivetran_synced", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "_fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "selectors": {}, "disabled": [], "parent_map": {"seed.shopify_source_integration_tests.shopify_order_data": [], "seed.shopify_source_integration_tests.shopify_order_line_refund_data": [], "seed.shopify_source_integration_tests.shopify_order_adjustment_data": [], "seed.shopify_source_integration_tests.shopify_product_variant_data": [], "seed.shopify_source_integration_tests.shopify_refund_data": [], "seed.shopify_source_integration_tests.shopify_transaction_data": [], "seed.shopify_source_integration_tests.shopify_product_data": [], "seed.shopify_source_integration_tests.shopify_customer_data": [], "seed.shopify_source_integration_tests.shopify_order_line_data": [], "model.shopify_source.stg_shopify__order_line": ["model.shopify_source.stg_shopify__order_line_tmp", "model.shopify_source.stg_shopify__order_line_tmp"], "model.shopify_source.stg_shopify__refund": ["model.shopify_source.stg_shopify__refund_tmp", "model.shopify_source.stg_shopify__refund_tmp"], "model.shopify_source.stg_shopify__product": ["model.shopify_source.stg_shopify__product_tmp", "model.shopify_source.stg_shopify__product_tmp"], "model.shopify_source.stg_shopify__product_variant": ["model.shopify_source.stg_shopify__product_variant_tmp", "model.shopify_source.stg_shopify__product_variant_tmp"], "model.shopify_source.stg_shopify__order": ["model.shopify_source.stg_shopify__order_tmp", "model.shopify_source.stg_shopify__order_tmp"], "model.shopify_source.stg_shopify__transaction": ["model.shopify_source.stg_shopify__transaction_tmp", "model.shopify_source.stg_shopify__transaction_tmp"], "model.shopify_source.stg_shopify__order_adjustment": ["model.shopify_source.stg_shopify__order_adjustment_tmp", "model.shopify_source.stg_shopify__order_adjustment_tmp"], "model.shopify_source.stg_shopify__customer": ["model.shopify_source.stg_shopify__customer_tmp", "model.shopify_source.stg_shopify__customer_tmp"], "model.shopify_source.stg_shopify__order_line_refund": ["model.shopify_source.stg_shopify__order_line_refund_tmp", "model.shopify_source.stg_shopify__order_line_refund_tmp"], "model.shopify_source.stg_shopify__customer_tmp": ["seed.shopify_source_integration_tests.shopify_customer_data"], "model.shopify_source.stg_shopify__order_line_tmp": ["seed.shopify_source_integration_tests.shopify_order_line_data"], "model.shopify_source.stg_shopify__refund_tmp": ["seed.shopify_source_integration_tests.shopify_refund_data"], "model.shopify_source.stg_shopify__product_tmp": ["seed.shopify_source_integration_tests.shopify_product_data"], "model.shopify_source.stg_shopify__order_adjustment_tmp": ["seed.shopify_source_integration_tests.shopify_order_adjustment_data"], "model.shopify_source.stg_shopify__order_line_refund_tmp": ["seed.shopify_source_integration_tests.shopify_order_line_refund_data"], "model.shopify_source.stg_shopify__transaction_tmp": ["seed.shopify_source_integration_tests.shopify_transaction_data"], "model.shopify_source.stg_shopify__product_variant_tmp": ["seed.shopify_source_integration_tests.shopify_product_variant_data"], "model.shopify_source.stg_shopify__order_tmp": ["seed.shopify_source_integration_tests.shopify_order_data"], "test.shopify_source.unique_stg_shopify__customer_customer_id": ["model.shopify_source.stg_shopify__customer"], "test.shopify_source.not_null_stg_shopify__customer_customer_id": ["model.shopify_source.stg_shopify__customer"], "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id": ["model.shopify_source.stg_shopify__order_line_refund"], "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id": ["model.shopify_source.stg_shopify__order_line_refund"], "test.shopify_source.unique_stg_shopify__order_line_order_line_id": ["model.shopify_source.stg_shopify__order_line"], "test.shopify_source.not_null_stg_shopify__order_line_order_line_id": ["model.shopify_source.stg_shopify__order_line"], "test.shopify_source.unique_stg_shopify__order_order_id": ["model.shopify_source.stg_shopify__order"], "test.shopify_source.not_null_stg_shopify__order_order_id": ["model.shopify_source.stg_shopify__order"], "test.shopify_source.unique_stg_shopify__product_product_id": ["model.shopify_source.stg_shopify__product"], "test.shopify_source.not_null_stg_shopify__product_product_id": ["model.shopify_source.stg_shopify__product"], "test.shopify_source.not_null_stg_shopify__product_variant_variant_id": ["model.shopify_source.stg_shopify__product_variant"], "test.shopify_source.unique_stg_shopify__product_variant_variant_id": ["model.shopify_source.stg_shopify__product_variant"], "test.shopify_source.unique_stg_shopify__transaction_transaction_id": ["model.shopify_source.stg_shopify__transaction"], "test.shopify_source.not_null_stg_shopify__transaction_transaction_id": ["model.shopify_source.stg_shopify__transaction"], "test.shopify_source.unique_stg_shopify__refund_refund_id": ["model.shopify_source.stg_shopify__refund"], "test.shopify_source.not_null_stg_shopify__refund_refund_id": ["model.shopify_source.stg_shopify__refund"], "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id": ["model.shopify_source.stg_shopify__order_adjustment"], "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id": ["model.shopify_source.stg_shopify__order_adjustment"], "source.shopify_source.shopify.order": [], "source.shopify_source.shopify.customer": [], "source.shopify_source.shopify.order_line": [], "source.shopify_source.shopify.order_line_refund": [], "source.shopify_source.shopify.product": [], "source.shopify_source.shopify.product_variant": [], "source.shopify_source.shopify.transaction": [], "source.shopify_source.shopify.refund": [], "source.shopify_source.shopify.order_adjustment": []}, "child_map": {"seed.shopify_source_integration_tests.shopify_order_data": ["model.shopify_source.stg_shopify__order_tmp"], "seed.shopify_source_integration_tests.shopify_order_line_refund_data": ["model.shopify_source.stg_shopify__order_line_refund_tmp"], "seed.shopify_source_integration_tests.shopify_order_adjustment_data": ["model.shopify_source.stg_shopify__order_adjustment_tmp"], "seed.shopify_source_integration_tests.shopify_product_variant_data": ["model.shopify_source.stg_shopify__product_variant_tmp"], "seed.shopify_source_integration_tests.shopify_refund_data": ["model.shopify_source.stg_shopify__refund_tmp"], "seed.shopify_source_integration_tests.shopify_transaction_data": ["model.shopify_source.stg_shopify__transaction_tmp"], "seed.shopify_source_integration_tests.shopify_product_data": ["model.shopify_source.stg_shopify__product_tmp"], "seed.shopify_source_integration_tests.shopify_customer_data": ["model.shopify_source.stg_shopify__customer_tmp"], "seed.shopify_source_integration_tests.shopify_order_line_data": ["model.shopify_source.stg_shopify__order_line_tmp"], "model.shopify_source.stg_shopify__order_line": ["test.shopify_source.not_null_stg_shopify__order_line_order_line_id", "test.shopify_source.unique_stg_shopify__order_line_order_line_id"], "model.shopify_source.stg_shopify__refund": ["test.shopify_source.not_null_stg_shopify__refund_refund_id", "test.shopify_source.unique_stg_shopify__refund_refund_id"], "model.shopify_source.stg_shopify__product": ["test.shopify_source.not_null_stg_shopify__product_product_id", "test.shopify_source.unique_stg_shopify__product_product_id"], "model.shopify_source.stg_shopify__product_variant": ["test.shopify_source.not_null_stg_shopify__product_variant_variant_id", "test.shopify_source.unique_stg_shopify__product_variant_variant_id"], "model.shopify_source.stg_shopify__order": ["test.shopify_source.not_null_stg_shopify__order_order_id", "test.shopify_source.unique_stg_shopify__order_order_id"], "model.shopify_source.stg_shopify__transaction": ["test.shopify_source.not_null_stg_shopify__transaction_transaction_id", "test.shopify_source.unique_stg_shopify__transaction_transaction_id"], "model.shopify_source.stg_shopify__order_adjustment": ["test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id", "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id"], "model.shopify_source.stg_shopify__customer": ["test.shopify_source.not_null_stg_shopify__customer_customer_id", "test.shopify_source.unique_stg_shopify__customer_customer_id"], "model.shopify_source.stg_shopify__order_line_refund": ["test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id", "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id"], "model.shopify_source.stg_shopify__customer_tmp": ["model.shopify_source.stg_shopify__customer", "model.shopify_source.stg_shopify__customer"], "model.shopify_source.stg_shopify__order_line_tmp": ["model.shopify_source.stg_shopify__order_line", "model.shopify_source.stg_shopify__order_line"], "model.shopify_source.stg_shopify__refund_tmp": ["model.shopify_source.stg_shopify__refund", "model.shopify_source.stg_shopify__refund"], "model.shopify_source.stg_shopify__product_tmp": ["model.shopify_source.stg_shopify__product", "model.shopify_source.stg_shopify__product"], "model.shopify_source.stg_shopify__order_adjustment_tmp": ["model.shopify_source.stg_shopify__order_adjustment", "model.shopify_source.stg_shopify__order_adjustment"], "model.shopify_source.stg_shopify__order_line_refund_tmp": ["model.shopify_source.stg_shopify__order_line_refund", "model.shopify_source.stg_shopify__order_line_refund"], "model.shopify_source.stg_shopify__transaction_tmp": ["model.shopify_source.stg_shopify__transaction", "model.shopify_source.stg_shopify__transaction"], "model.shopify_source.stg_shopify__product_variant_tmp": ["model.shopify_source.stg_shopify__product_variant", "model.shopify_source.stg_shopify__product_variant"], "model.shopify_source.stg_shopify__order_tmp": ["model.shopify_source.stg_shopify__order", "model.shopify_source.stg_shopify__order"], "test.shopify_source.unique_stg_shopify__customer_customer_id": [], "test.shopify_source.not_null_stg_shopify__customer_customer_id": [], "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id": [], "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id": [], "test.shopify_source.unique_stg_shopify__order_line_order_line_id": [], "test.shopify_source.not_null_stg_shopify__order_line_order_line_id": [], "test.shopify_source.unique_stg_shopify__order_order_id": [], "test.shopify_source.not_null_stg_shopify__order_order_id": [], "test.shopify_source.unique_stg_shopify__product_product_id": [], "test.shopify_source.not_null_stg_shopify__product_product_id": [], "test.shopify_source.not_null_stg_shopify__product_variant_variant_id": [], "test.shopify_source.unique_stg_shopify__product_variant_variant_id": [], "test.shopify_source.unique_stg_shopify__transaction_transaction_id": [], "test.shopify_source.not_null_stg_shopify__transaction_transaction_id": [], "test.shopify_source.unique_stg_shopify__refund_refund_id": [], "test.shopify_source.not_null_stg_shopify__refund_refund_id": [], "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id": [], "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id": [], "source.shopify_source.shopify.order": [], "source.shopify_source.shopify.customer": [], "source.shopify_source.shopify.order_line": [], "source.shopify_source.shopify.order_line_refund": [], "source.shopify_source.shopify.product": [], "source.shopify_source.shopify.product_variant": [], "source.shopify_source.shopify.transaction": [], "source.shopify_source.shopify.refund": [], "source.shopify_source.shopify.order_adjustment": []}} \ No newline at end of file From a278cc4f389286494604cc99955d6233f6628046 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Fri, 13 May 2022 14:04:23 -0700 Subject: [PATCH 005/137] add idenfier var --- docs/manifest.json | 1 + integration_tests/dbt_project.yml | 18 +++++++++--------- models/src_shopify.yml | 9 +++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 docs/manifest.json diff --git a/docs/manifest.json b/docs/manifest.json new file mode 100644 index 0000000..f71d42f --- /dev/null +++ b/docs/manifest.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v1.json", "dbt_version": "0.19.1", "generated_at": "2021-05-10T15:49:33.056218Z", "invocation_id": "25205f8f-a888-421f-a470-c817bc340294", "env": {}, "project_id": "f2f22d4d8db9dfa8a08831bb14141bc2", "user_id": "57178664-37b2-4047-9572-68ec8b488cd7", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.shopify_source_integration_tests.shopify_order_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "processed_at": "timestamp", "cancelled_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64", "customer_id": "INT64", "location_id": "INT64", "user_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_data.csv", "original_file_path": "data/shopify_order_data.csv", "name": "shopify_order_data", "alias": "shopify_order_data", "checksum": {"name": "sha256", "checksum": "4d0dd043a886a0d9e7680e7ee2cd132717490f75d3a06fe7c38956d901976146"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "processed_at": "timestamp", "cancelled_at": "timestamp", "_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "customer_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "location_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "user_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_data`"}, "seed.shopify_source_integration_tests.shopify_order_line_refund_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64", "location_id": "INT64", "refund_id": "INT64", "order_line_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_line_refund_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_refund_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_line_refund_data.csv", "original_file_path": "data/shopify_order_line_refund_data.csv", "name": "shopify_order_line_refund_data", "alias": "shopify_order_line_refund_data", "checksum": {"name": "sha256", "checksum": "52889a517b6610f539a77f9905805d67fbee62f0bcd63f3ca432efce9a328b45"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "location_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "refund_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_line_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_refund_data`"}, "seed.shopify_source_integration_tests.shopify_order_adjustment_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "refund_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_adjustment_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_adjustment_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_adjustment_data.csv", "original_file_path": "data/shopify_order_adjustment_data.csv", "name": "shopify_order_adjustment_data", "alias": "shopify_order_adjustment_data", "checksum": {"name": "sha256", "checksum": "99899b3532a7e74a67063723058528563d4fedc8114e99e930cfbc8598a16da8"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "refund_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_adjustment_data`"}, "seed.shopify_source_integration_tests.shopify_product_variant_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "product_id": "INT64", "inventory_item_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_product_variant_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_product_variant_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_product_variant_data.csv", "original_file_path": "data/shopify_product_variant_data.csv", "name": "shopify_product_variant_data", "alias": "shopify_product_variant_data", "checksum": {"name": "sha256", "checksum": "5fbf997eaa32d49016b0ba5acd2201e60309b0b7fb3a83e5a782542502426abc"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "product_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "inventory_item_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_product_variant_data`"}, "seed.shopify_source_integration_tests.shopify_refund_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "user_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_refund_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_refund_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_refund_data.csv", "original_file_path": "data/shopify_refund_data.csv", "name": "shopify_refund_data", "alias": "shopify_refund_data", "checksum": {"name": "sha256", "checksum": "1efcab5977150427c6c7ef2c3aff396384bdd80dfd5872752836b027ea78e404"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "user_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_refund_data`"}, "seed.shopify_source_integration_tests.shopify_transaction_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "refund_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_transaction_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_transaction_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_transaction_data.csv", "original_file_path": "data/shopify_transaction_data.csv", "name": "shopify_transaction_data", "alias": "shopify_transaction_data", "checksum": {"name": "sha256", "checksum": "353ca5206d7a0982439b57cda81d05e861b924f65071e3c2c2b6ad1ca7fccf75"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "refund_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_transaction_data`"}, "seed.shopify_source_integration_tests.shopify_product_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "published_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_product_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_product_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_product_data.csv", "original_file_path": "data/shopify_product_data.csv", "name": "shopify_product_data", "alias": "shopify_product_data", "checksum": {"name": "sha256", "checksum": "5cc03f90512ac04a6526220040085e4e0488b62ef22e8b201424c7d7cf1bf847"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "published_at": "timestamp", "_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_product_data`"}, "seed.shopify_source_integration_tests.shopify_customer_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64", "default_address_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_customer_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_customer_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_customer_data.csv", "original_file_path": "data/shopify_customer_data.csv", "name": "shopify_customer_data", "alias": "shopify_customer_data", "checksum": {"name": "sha256", "checksum": "79bc0a5972c321cefe2973acdd443ce1d42e36b3b23b2298151046d23bdf4bea"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "default_address_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_customer_data`"}, "seed.shopify_source_integration_tests.shopify_order_line_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "order_id": "INT64", "id": "INT64", "product_id": "INT64", "variant_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_line_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_line_data.csv", "original_file_path": "data/shopify_order_line_data.csv", "name": "shopify_order_line_data", "alias": "shopify_order_line_data", "checksum": {"name": "sha256", "checksum": "cabaa49c9bd299b34eb2154893a6dd399fbbad7e4ad7036293c8b4cb599199e0"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "product_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "variant_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_data`"}, "model.shopify_source.stg_shopify__order_line": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_line_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_line_tmp')),\n staging_columns=get_order_line_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_line_pass_through_columns') %}\n ,\n {{ var('order_line_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_line_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_line_tmp", "model.shopify_source.stg_shopify__order_line_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line"], "unique_id": "model.shopify_source.stg_shopify__order_line", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order_line.sql", "original_file_path": "models/stg_shopify__order_line.sql", "name": "stg_shopify__order_line", "alias": "stg_shopify__order_line", "checksum": {"name": "sha256", "checksum": "961391fa517a5bf84ab40e9a93d41909046267406b20a9a0eaeb01a69f143ec4"}, "tags": [], "refs": [["stg_shopify__order_line_tmp"], ["stg_shopify__order_line_tmp"]], "sources": [], "description": "Each record represents a line item from an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillable_quantity": {"name": "fulfillable_quantity", "description": "The amount available to fulfill, calculated as follows: quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The service provider that's fulfilling the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "How far along an order is in terms line items fulfilled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_gift_card": {"name": "is_gift_card", "description": "Whether the item is a gift card. If true, then the item is not taxed or considered for shipping charges.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the item in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the line item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the related order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the item before discounts have been applied in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The ID of the product that the line item belongs to. Can be null if the original product associated with the order is deleted at a later date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of items that were purchased.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_requiring_shipping": {"name": "is_requiring_shipping", "description": "Whether the item requires shipping.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "The item's SKU (stock keeping unit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_taxable": {"name": "is_taxable", "description": "Whether the item was taxable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discount": {"name": "total_discount", "description": "The total amount of the discount allocated to the line item in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The ID of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the item's supplier.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order_line.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n fulfillable_quantity\n \n as \n \n fulfillable_quantity\n \n, \n \n \n fulfillment_service\n \n as \n \n fulfillment_service\n \n, \n \n \n fulfillment_status\n \n as \n \n fulfillment_status\n \n, \n \n \n gift_card\n \n as is_gift_card , \n \n \n grams\n \n as \n \n grams\n \n, \n \n \n id\n \n as order_line_id , \n \n \n index\n \n as \n \n index\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n pre_tax_price\n \n as \n \n pre_tax_price\n \n, \n \n \n price\n \n as \n \n price\n \n, \n \n \n product_id\n \n as \n \n product_id\n \n, \n cast(null as \n numeric\n) as \n \n property_charge_interval_frequency\n \n , \n cast(null as \n string\n) as \n \n property_for_shipping_jan_3_rd_2020\n \n , \n cast(null as \n numeric\n) as \n \n property_shipping_interval_frequency\n \n , \n cast(null as \n string\n) as \n \n property_shipping_interval_unit_type\n \n , \n cast(null as \n numeric\n) as \n \n property_subscription_id\n \n , \n \n \n quantity\n \n as \n \n quantity\n \n, \n \n \n requires_shipping\n \n as is_requiring_shipping , \n \n \n sku\n \n as \n \n sku\n \n, \n \n \n taxable\n \n as is_taxable , \n \n \n title\n \n as \n \n title\n \n, \n \n \n total_discount\n \n as \n \n total_discount\n \n, \n \n \n variant_id\n \n as \n \n variant_id\n \n, \n \n \n vendor\n \n as \n \n vendor\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line`"}, "model.shopify_source.stg_shopify__refund": {"raw_sql": "with source as (\n\n select * \n from {{ ref('stg_shopify__refund_tmp') }}\n\n),\n\nrenamed as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__refund_tmp')),\n staging_columns=get_refund_columns()\n )\n }}\n \n from source\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_refund_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__refund_tmp", "model.shopify_source.stg_shopify__refund_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__refund"], "unique_id": "model.shopify_source.stg_shopify__refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__refund.sql", "original_file_path": "models/stg_shopify__refund.sql", "name": "stg_shopify__refund", "alias": "stg_shopify__refund", "checksum": {"name": "sha256", "checksum": "20ab47c1ea17b352a952dff3831bf0cc35a79e629e8a2fd26d1038dd9854d033"}, "tags": [], "refs": [["stg_shopify__refund_tmp"], ["stg_shopify__refund_tmp"]], "sources": [], "description": "Each record represents a refund within Shopify.", "columns": {"refund_id": {"name": "refund_id", "description": "The unique numeric identifier for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of the date when the refund was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "Timestamp of the date when the refund was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "User generated note attached to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock": {"name": "restock", "description": "Boolean indicating if the refund is a result of a restock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Reference to the user id which generated the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_duties_set": {"name": "total_duties_set", "description": "Record representing total duties set for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the refund is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__refund.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * \n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n id\n \n as refund_id , \n \n \n note\n \n as \n \n note\n \n, \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n processed_at\n \n as \n \n processed_at\n \n, \n \n \n restock\n \n as \n \n restock\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n \n from source\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund`"}, "model.shopify_source.stg_shopify__product": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__product_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__product_tmp')),\n staging_columns=get_product_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('product_pass_through_columns') %}\n ,\n {{ var('product_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_product_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__product_tmp", "model.shopify_source.stg_shopify__product_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product"], "unique_id": "model.shopify_source.stg_shopify__product", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__product.sql", "original_file_path": "models/stg_shopify__product.sql", "name": "stg_shopify__product", "alias": "stg_shopify__product", "checksum": {"name": "sha256", "checksum": "470f6430f6b7c22f0bbdfdf989c302463572c345232f3a7dfc033546f644689f"}, "tags": [], "refs": [["stg_shopify__product_tmp"], ["stg_shopify__product_tmp"]], "sources": [], "description": "Each record represents a product in Shopify.", "columns": {"_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Whether the record has been deleted in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the product was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "handle": {"name": "handle", "description": "A unique human-friendly string for the product. Automatically generated from the product's title.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "An unsigned 64-bit integer that's used as a unique identifier for the product. Each id is unique across the Shopify system. No two products will have the same id, even if they're from different shops.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_type": {"name": "product_type", "description": "A categorization for the product used for filtering and searching products.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_timestamp": {"name": "published_timestamp", "description": "The date and time (ISO 8601 format) when the product was published. Can be set to null to unpublish the product from the Online Store channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_scope": {"name": "published_scope", "description": "Whether the product is published to the Point of Sale channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The name of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the product was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the product's vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__product.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as created_timestamp , \n \n \n handle\n \n as \n \n handle\n \n, \n \n \n id\n \n as product_id , \n \n \n product_type\n \n as \n \n product_type\n \n, \n \n \n published_at\n \n as published_timestamp , \n \n \n published_scope\n \n as \n \n published_scope\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as updated_timestamp , \n \n \n vendor\n \n as \n \n vendor\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product`"}, "model.shopify_source.stg_shopify__product_variant": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__product_variant_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__product_variant_tmp')),\n staging_columns=get_product_variant_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('product_variant_pass_through_columns') %}\n ,\n {{ var('product_variant_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_product_variant_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__product_variant_tmp", "model.shopify_source.stg_shopify__product_variant_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product_variant"], "unique_id": "model.shopify_source.stg_shopify__product_variant", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__product_variant.sql", "original_file_path": "models/stg_shopify__product_variant.sql", "name": "stg_shopify__product_variant", "alias": "stg_shopify__product_variant", "checksum": {"name": "sha256", "checksum": "0bfac7e5aab433722634b674b7ac67d409184b9f8168d4cec962009ff3a3ce1e"}, "tags": [], "refs": [["stg_shopify__product_variant_tmp"], ["stg_shopify__product_variant_tmp"]], "sources": [], "description": "Each record represents a product variant in Shopify", "columns": {"barcode": {"name": "barcode", "description": "The barcode, UPC, or ISBN number for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "compare_at_price": {"name": "compare_at_price", "description": "The original price of the item before an adjustment or a sale.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time (ISO 8601 format) when the product variant was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The fulfillment service associated with the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the product variant in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The unique numeric identifier for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "image_id": {"name": "image_id", "description": "The unique numeric identifier for a product's image. The image must be associated to the same product as the variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_item_id": {"name": "inventory_item_id", "description": "The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_management": {"name": "inventory_management", "description": "The fulfillment service that tracks the number of items in stock for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_policy": {"name": "inventory_policy", "description": "Whether customers are allowed to place an order for the product variant when it's out of stock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_quantity": {"name": "inventory_quantity", "description": "An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "old_inventory_quantity": {"name": "old_inventory_quantity", "description": "This property is deprecated. Use the InventoryLevel resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_1": {"name": "option_1", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_2": {"name": "option_2", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_3": {"name": "option_3", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The order of the product variant in the list of product variants. The first position in the list is 1. The position of variants is indicated by the order in which they are listed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The unique numeric identifier for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_requiring_shipping": {"name": "is_requiring_shipping", "description": "This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_taxable": {"name": "is_taxable", "description": "Whether a tax is charged when the product variant is sold.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_code": {"name": "tax_code", "description": "This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product variant. The title field is a concatenation of the option1, option2, and option3 fields. You can only update title indirectly using the option fields.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the product variant was last modified. Gets returned in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight": {"name": "weight", "description": "The weight of the product variant in the unit system specified with weight_unit.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight_unit": {"name": "weight_unit", "description": "The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__product_variant.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n id\n \n as variant_id , \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as created_timestamp , \n \n \n updated_at\n \n as updated_timestamp , \n \n \n product_id\n \n as \n \n product_id\n \n, \n \n \n inventory_item_id\n \n as \n \n inventory_item_id\n \n, \n \n \n image_id\n \n as \n \n image_id\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n price\n \n as \n \n price\n \n, \n \n \n sku\n \n as \n \n sku\n \n, \n \n \n position\n \n as \n \n position\n \n, \n \n \n inventory_policy\n \n as \n \n inventory_policy\n \n, \n \n \n compare_at_price\n \n as \n \n compare_at_price\n \n, \n \n \n fulfillment_service\n \n as \n \n fulfillment_service\n \n, \n \n \n inventory_management\n \n as \n \n inventory_management\n \n, \n \n \n taxable\n \n as is_taxable , \n \n \n barcode\n \n as \n \n barcode\n \n, \n \n \n grams\n \n as \n \n grams\n \n, \n \n \n inventory_quantity\n \n as \n \n inventory_quantity\n \n, \n \n \n weight\n \n as \n \n weight\n \n, \n \n \n weight_unit\n \n as \n \n weight_unit\n \n, \n \n \n option_1\n \n as \n \n option_1\n \n, \n \n \n option_2\n \n as \n \n option_2\n \n, \n \n \n option_3\n \n as \n \n option_3\n \n, \n \n \n tax_code\n \n as \n \n tax_code\n \n, \n \n \n old_inventory_quantity\n \n as \n \n old_inventory_quantity\n \n, \n \n \n requires_shipping\n \n as is_requiring_shipping \n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant`"}, "model.shopify_source.stg_shopify__order": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_tmp')),\n staging_columns=get_order_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_pass_through_columns') %}\n ,\n {{ var('order_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_tmp", "model.shopify_source.stg_shopify__order_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order"], "unique_id": "model.shopify_source.stg_shopify__order", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order.sql", "original_file_path": "models/stg_shopify__order.sql", "name": "stg_shopify__order", "alias": "stg_shopify__order", "checksum": {"name": "sha256", "checksum": "92d39b99aabc22ec3997565a7ef8635a299738e18331d9e5a4f689a713ae14eb"}, "tags": [], "refs": [["stg_shopify__order_tmp"], ["stg_shopify__order_tmp"]], "sources": [], "description": "Each record represents an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The ID of the app that created the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_1": {"name": "billing_address_address_1", "description": "The street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_2": {"name": "billing_address_address_2", "description": "An optional additional field for the street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_city": {"name": "billing_address_city", "description": "The city, town, or village of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_company": {"name": "billing_address_company", "description": "The company of the person associated with the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country": {"name": "billing_address_country", "description": "The name of the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country_code": {"name": "billing_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_first_name": {"name": "billing_address_first_name", "description": "The first name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_last_name": {"name": "billing_address_last_name", "description": "The last name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_latitude": {"name": "billing_address_latitude", "description": "The latitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_longitude": {"name": "billing_address_longitude", "description": "The longitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_name": {"name": "billing_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_phone": {"name": "billing_address_phone", "description": "The phone number at the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province": {"name": "billing_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province_code": {"name": "billing_address_province_code", "description": "The two-letter abbreviation of the region of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_zip": {"name": "billing_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "browser_ip": {"name": "browser_ip", "description": "The IP address of the browser used by the customer when they placed the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_buyer_accepted_marketing": {"name": "has_buyer_accepted_marketing", "description": "Whether the customer consented to receive email updates from the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancel_reason": {"name": "cancel_reason", "description": "The reason why the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancelled_timestamp": {"name": "cancelled_timestamp", "description": "The date and time when the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cart_token": {"name": "cart_token", "description": "The ID of the cart that's associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_timestamp": {"name": "closed_timestamp", "description": "The date and time when the order was closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The autogenerated date and time when the order was created in Shopify.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code for the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "The ID of the order's customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The customer's email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "financial_status": {"name": "financial_status", "description": "The status of payments associated with the order. Can only be set when the order is created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "The order's status in terms of fulfilled line items.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the order, used for API purposes. This is different from the order_number property, which is the ID used by the shop owner and customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "landing_site_base_url": {"name": "landing_site_base_url", "description": "The URL for the page where the buyer landed when they entered the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the order was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The order name, generated by combining the order_number property with the order prefix and suffix that are set in the merchant's general settings.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "An optional note that a shop owner can attach to the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The order's position in the shop's count of orders. Numbers are sequential and start at 1.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "The order 's position in the shop's count of orders starting at 1001. Order numbers are sequential and start at 1001.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when an order was processed. This value is the date that appears on your orders and that's used in the analytic reports.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processing_method": {"name": "processing_method", "description": "How the payment was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "referring_site": {"name": "referring_site", "description": "The website where the customer clicked a link to the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_1": {"name": "shipping_address_address_1", "description": "The street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_2": {"name": "shipping_address_address_2", "description": "An optional additional field for the street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_city": {"name": "shipping_address_city", "description": "The city, town, or village of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_company": {"name": "shipping_address_company", "description": "The company of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country": {"name": "shipping_address_country", "description": "The name of the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country_code": {"name": "shipping_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_first_name": {"name": "shipping_address_first_name", "description": "The first name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_last_name": {"name": "shipping_address_last_name", "description": "The last name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_latitude": {"name": "shipping_address_latitude", "description": "The latitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_longitude": {"name": "shipping_address_longitude", "description": "The longitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_name": {"name": "shipping_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_phone": {"name": "shipping_address_phone", "description": "The phone number at the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province": {"name": "shipping_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province_code": {"name": "shipping_address_province_code", "description": "The two-letter abbreviation of the region of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_zip": {"name": "shipping_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "Where the order originated. Can be set only during order creation, and is not writeable afterwards.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal_price": {"name": "subtotal_price", "description": "The price of the order in the shop currency after discounts but before shipping, taxes, and tips.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_taxes_included": {"name": "has_taxes_included", "description": "Whether taxes are included in the order subtotal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_test_order": {"name": "is_test_order", "description": "Whether this is a test order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "token": {"name": "token", "description": "A unique token for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discounts": {"name": "total_discounts", "description": "The total discounts applied to the price of the order in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_line_items_price": {"name": "total_line_items_price", "description": "The sum of all line item prices in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The sum of all the taxes applied to the order in th shop currency. Must be positive).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_weight": {"name": "total_weight", "description": "The sum of all line item weights in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time (ISO 8601 format) when the order was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID of the user logged into Shopify POS who processed the order, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_shipping_price_set": {"name": "total_shipping_price_set", "description": "The total shipping price set for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "index": {"name": "index", "description": "The index associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pre_tax_price": {"name": "pre_tax_price", "description": "The total pre tax price of the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n billing_address_address_1\n \n as \n \n billing_address_address_1\n \n, \n \n \n billing_address_address_2\n \n as \n \n billing_address_address_2\n \n, \n \n \n billing_address_city\n \n as \n \n billing_address_city\n \n, \n \n \n billing_address_company\n \n as \n \n billing_address_company\n \n, \n \n \n billing_address_country\n \n as \n \n billing_address_country\n \n, \n \n \n billing_address_country_code\n \n as \n \n billing_address_country_code\n \n, \n \n \n billing_address_first_name\n \n as \n \n billing_address_first_name\n \n, \n \n \n billing_address_last_name\n \n as \n \n billing_address_last_name\n \n, \n \n \n billing_address_latitude\n \n as \n \n billing_address_latitude\n \n, \n \n \n billing_address_longitude\n \n as \n \n billing_address_longitude\n \n, \n \n \n billing_address_name\n \n as \n \n billing_address_name\n \n, \n \n \n billing_address_phone\n \n as \n \n billing_address_phone\n \n, \n \n \n billing_address_province\n \n as \n \n billing_address_province\n \n, \n \n \n billing_address_province_code\n \n as \n \n billing_address_province_code\n \n, \n \n \n billing_address_zip\n \n as \n \n billing_address_zip\n \n, \n \n \n browser_ip\n \n as \n \n browser_ip\n \n, \n \n \n buyer_accepts_marketing\n \n as has_buyer_accepted_marketing , \n \n \n cancel_reason\n \n as \n \n cancel_reason\n \n, \n \n \n cancelled_at\n \n as cancelled_timestamp , \n \n \n cart_token\n \n as \n \n cart_token\n \n, \n \n \n checkout_token\n \n as \n \n checkout_token\n \n, \n \n \n closed_at\n \n as closed_timestamp , \n \n \n created_at\n \n as created_timestamp , \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n customer_id\n \n as \n \n customer_id\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n financial_status\n \n as \n \n financial_status\n \n, \n \n \n fulfillment_status\n \n as \n \n fulfillment_status\n \n, \n \n \n id\n \n as order_id , \n \n \n landing_site_base_url\n \n as \n \n landing_site_base_url\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 \n \n note\n \n as \n \n note\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n order_number\n \n as \n \n order_number\n \n, \n \n \n processed_at\n \n as processed_timestamp , \n \n \n processing_method\n \n as \n \n processing_method\n \n, \n \n \n referring_site\n \n as \n \n referring_site\n \n, \n cast(null as \n string\n) as \n \n total_shipping_price_set\n \n , \n \n \n shipping_address_address_1\n \n as \n \n shipping_address_address_1\n \n, \n \n \n shipping_address_address_2\n \n as \n \n shipping_address_address_2\n \n, \n \n \n shipping_address_city\n \n as \n \n shipping_address_city\n \n, \n \n \n shipping_address_company\n \n as \n \n shipping_address_company\n \n, \n \n \n shipping_address_country\n \n as \n \n shipping_address_country\n \n, \n \n \n shipping_address_country_code\n \n as \n \n shipping_address_country_code\n \n, \n \n \n shipping_address_first_name\n \n as \n \n shipping_address_first_name\n \n, \n \n \n shipping_address_last_name\n \n as \n \n shipping_address_last_name\n \n, \n \n \n shipping_address_latitude\n \n as \n \n shipping_address_latitude\n \n, \n \n \n shipping_address_longitude\n \n as \n \n shipping_address_longitude\n \n, \n \n \n shipping_address_name\n \n as \n \n shipping_address_name\n \n, \n \n \n shipping_address_phone\n \n as \n \n shipping_address_phone\n \n, \n \n \n shipping_address_province\n \n as \n \n shipping_address_province\n \n, \n \n \n shipping_address_province_code\n \n as \n \n shipping_address_province_code\n \n, \n \n \n shipping_address_zip\n \n as \n \n shipping_address_zip\n \n, \n \n \n source_name\n \n as \n \n source_name\n \n, \n \n \n subtotal_price\n \n as \n \n subtotal_price\n \n, \n \n \n taxes_included\n \n as has_taxes_included , \n \n \n test\n \n as is_test_order , \n \n \n token\n \n as \n \n token\n \n, \n \n \n total_discounts\n \n as \n \n total_discounts\n \n, \n \n \n total_line_items_price\n \n as \n \n total_line_items_price\n \n, \n \n \n total_price\n \n as \n \n total_price\n \n, \n \n \n total_tax\n \n as \n \n total_tax\n \n, \n \n \n total_weight\n \n as \n \n total_weight\n \n, \n \n \n updated_at\n \n as updated_timestamp , \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order`"}, "model.shopify_source.stg_shopify__transaction": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__transaction_tmp') }}\n\n),\n\nrenamed as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__transaction_tmp')),\n staging_columns=get_transaction_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('transaction_pass_through_columns') %}\n ,\n {{ var('transaction_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n where not test\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_transaction_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__transaction_tmp", "model.shopify_source.stg_shopify__transaction_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__transaction"], "unique_id": "model.shopify_source.stg_shopify__transaction", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__transaction.sql", "original_file_path": "models/stg_shopify__transaction.sql", "name": "stg_shopify__transaction", "alias": "stg_shopify__transaction", "checksum": {"name": "sha256", "checksum": "f8f807ac9ac627ebd0cbb81ab4023242f02ba5724e1ecd2c10913335e7ff277b"}, "tags": [], "refs": [["stg_shopify__transaction_tmp"], ["stg_shopify__transaction_tmp"]], "sources": [], "description": "Each record represents a transaction in Shopify.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The ID for the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID for the order that the transaction is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID associated with a refund in the refund table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of money included in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authorization": {"name": "authorization", "description": "The authorization code associated with the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the transaction was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when a transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device_id": {"name": "device_id", "description": "The ID for the device.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gateway": {"name": "gateway", "description": "The name of the gateway the transaction was issued through.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "The origin of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "message": {"name": "message", "description": "A string generated by the payment provider with additional information about why the transaction succeeded or failed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code (ISO 4217 format) for the currency used for the payment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The ID of an associated transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_avs_result_code": {"name": "payment_avs_result_code", "description": "The response code from the address verification system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_bin": {"name": "payment_credit_card_bin", "description": "The issuer identification number (IIN), formerly known as bank identification number (BIN) of the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_cvv_result_code": {"name": "payment_cvv_result_code", "description": "The response code from the credit card company indicating whether the customer entered the card security code, or card verification value, correctly.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_number": {"name": "payment_credit_card_number", "description": "The customer's credit card number, with most of the leading digits redacted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_company": {"name": "payment_credit_card_company", "description": "The name of the company that issued the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The transaction's type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "receipt": {"name": "receipt", "description": "A transaction receipt attached to the transaction by the gateway.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_id": {"name": "currency_exchange_id", "description": "The ID of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_adjustment": {"name": "currency_exchange_adjustment", "description": "The difference between the amounts on the associated transaction and the parent transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_original_amount": {"name": "currency_exchange_original_amount", "description": "The amount of the parent transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_final_amount": {"name": "currency_exchange_final_amount", "description": "The amount of the associated transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_currency": {"name": "currency_exchange_currency", "description": "The shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "error_code": {"name": "error_code", "description": "A standardized error code, independent of the payment provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether the transaction is a test transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__transaction.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction_tmp`\n\n),\n\nrenamed as (\n\n select\n\n \n \n \n id\n \n as transaction_id , \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n refund_id\n \n as \n \n refund_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n created_at\n \n as created_timestamp , \n \n \n processed_at\n \n as processed_timestamp , \n \n \n device_id\n \n as \n \n device_id\n \n, \n \n \n gateway\n \n as \n \n gateway\n \n, \n \n \n source_name\n \n as \n \n source_name\n \n, \n \n \n message\n \n as \n \n message\n \n, \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n location_id\n \n as \n \n location_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n payment_avs_result_code\n \n as \n \n payment_avs_result_code\n \n, \n \n \n payment_credit_card_bin\n \n as \n \n payment_credit_card_bin\n \n, \n \n \n payment_cvv_result_code\n \n as \n \n payment_cvv_result_code\n \n, \n \n \n payment_credit_card_number\n \n as \n \n payment_credit_card_number\n \n, \n \n \n payment_credit_card_company\n \n as \n \n payment_credit_card_company\n \n, \n \n \n kind\n \n as \n \n kind\n \n, \n \n \n receipt\n \n as \n \n receipt\n \n, \n \n \n currency_exchange_id\n \n as \n \n currency_exchange_id\n \n, \n \n \n currency_exchange_adjustment\n \n as \n \n currency_exchange_adjustment\n \n, \n \n \n currency_exchange_original_amount\n \n as \n \n currency_exchange_original_amount\n \n, \n \n \n currency_exchange_final_amount\n \n as \n \n currency_exchange_final_amount\n \n, \n \n \n currency_exchange_currency\n \n as \n \n currency_exchange_currency\n \n, \n \n \n error_code\n \n as \n \n error_code\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n test\n \n as \n \n test\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n where not test\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction`"}, "model.shopify_source.stg_shopify__order_adjustment": {"raw_sql": "with source as (\n\n select * \n from {{ ref('stg_shopify__order_adjustment_tmp') }}\n\n),\n\nrenamed as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_adjustment_tmp')),\n staging_columns=get_order_adjustment_columns()\n )\n }}\n \n from source\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_adjustment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment_tmp", "model.shopify_source.stg_shopify__order_adjustment_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_adjustment"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order_adjustment.sql", "original_file_path": "models/stg_shopify__order_adjustment.sql", "name": "stg_shopify__order_adjustment", "alias": "stg_shopify__order_adjustment", "checksum": {"name": "sha256", "checksum": "46da70e0f39c656244e8fb915416eb195ba18729dd920ae10ee8e19fad0c0151"}, "tags": [], "refs": [["stg_shopify__order_adjustment_tmp"], ["stg_shopify__order_adjustment_tmp"]], "sources": [], "description": "Each record represents and adjustment to and order within Shopify.", "columns": {"order_adjustment_id": {"name": "order_adjustment_id", "description": "The unique numeric identifier for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "Reference to the refund which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Amount of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount": {"name": "tax_amount", "description": "Tax amount applied to the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The kind of order adjustment (eg. refund, restock, etc.).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "The reason for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount_set": {"name": "amount_set", "description": "Amount set towards the order adjustment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount_set": {"name": "tax_amount_set", "description": "Tax amount set towards the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order_adjustment.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * \n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n id\n \n as order_adjustment_id , \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n refund_id\n \n as \n \n refund_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n tax_amount\n \n as \n \n tax_amount\n \n, \n \n \n kind\n \n as \n \n kind\n \n, \n \n \n reason\n \n as \n \n reason\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n\n\n\n \n from source\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`"}, "model.shopify_source.stg_shopify__customer": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__customer_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__customer_tmp')),\n staging_columns=get_customer_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('customer_pass_through_columns') %}\n ,\n {{ var('customer_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_customer_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__customer_tmp", "model.shopify_source.stg_shopify__customer_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__customer"], "unique_id": "model.shopify_source.stg_shopify__customer", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__customer.sql", "original_file_path": "models/stg_shopify__customer.sql", "name": "stg_shopify__customer", "alias": "stg_shopify__customer", "checksum": {"name": "sha256", "checksum": "266d051984b96bb4f699dacb99811ddbcc05078ec34cd7ce2f0f117163d78e28"}, "tags": [], "refs": [["stg_shopify__customer_tmp"], ["stg_shopify__customer_tmp"]], "sources": [], "description": "Each record represents a customer in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_accepted_marketing": {"name": "has_accepted_marketing", "description": "Whether the customer has consented to receive marketing material via email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the customer was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_address_id": {"name": "default_address_id", "description": "The default address for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The customer's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "A unique identifier for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The customer's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orders_count": {"name": "orders_count", "description": "The number of orders associated with this customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_state": {"name": "account_state", "description": "The state of the customer's account with a shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_tax_exempt": {"name": "is_tax_exempt", "description": "Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_spent": {"name": "total_spent", "description": "The total amount of money that the customer has spent across their order history.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the customer information was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_verified_email": {"name": "is_verified_email", "description": "Whether the customer has verified their email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__customer.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n accepts_marketing\n \n as has_accepted_marketing , \n \n \n created_at\n \n as created_timestamp , \n \n \n default_address_id\n \n as \n \n default_address_id\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n id\n \n as customer_id , \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n orders_count\n \n as \n \n orders_count\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n state\n \n as account_state , \n \n \n tax_exempt\n \n as is_tax_exempt , \n \n \n total_spent\n \n as \n \n total_spent\n \n, \n \n \n updated_at\n \n as updated_timestamp , \n \n \n verified_email\n \n as is_verified_email \n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer`"}, "model.shopify_source.stg_shopify__order_line_refund": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_line_refund_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_line_refund_tmp')),\n staging_columns=get_order_line_refund_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_line_refund_pass_through_columns') %}\n ,\n {{ var('order_line_refund_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_line_refund_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund_tmp", "model.shopify_source.stg_shopify__order_line_refund_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line_refund"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order_line_refund.sql", "original_file_path": "models/stg_shopify__order_line_refund.sql", "name": "stg_shopify__order_line_refund", "alias": "stg_shopify__order_line_refund", "checksum": {"name": "sha256", "checksum": "299d1175d39aa9b204dc1cc358faa49285944c1955f34209cadfe4e97936a065"}, "tags": [], "refs": [["stg_shopify__order_line_refund_tmp"], ["stg_shopify__order_line_refund_tmp"]], "sources": [], "description": "Each record represents a line item from an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_refund_id": {"name": "order_line_refund_id", "description": "The unique identifier of the line item in the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "TThe unique identifier of the location where the items will be restockedBD", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the related line item in the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the associated line item that was returned.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID of the related refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock_type": {"name": "restock_type", "description": "How this refund line item affects inventory levels.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal": {"name": "subtotal", "description": "Subtotal amount of the order line refund", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The total tax applied to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order_line_refund.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n id\n \n as order_line_refund_id , \n \n \n location_id\n \n as \n \n location_id\n \n, \n \n \n order_line_id\n \n as \n \n order_line_id\n \n, \n \n \n subtotal\n \n as \n \n subtotal\n \n, \n \n \n total_tax\n \n as \n \n total_tax\n \n, \n \n \n quantity\n \n as \n \n quantity\n \n, \n \n \n refund_id\n \n as \n \n refund_id\n \n, \n \n \n restock_type\n \n as \n \n restock_type\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`"}, "model.shopify_source.stg_shopify__customer_tmp": {"raw_sql": "select * \nfrom {{ var('customer_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_customer_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__customer_tmp"], "unique_id": "model.shopify_source.stg_shopify__customer_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__customer_tmp.sql", "original_file_path": "models/tmp/stg_shopify__customer_tmp.sql", "name": "stg_shopify__customer_tmp", "alias": "stg_shopify__customer_tmp", "checksum": {"name": "sha256", "checksum": "deaf49343836d3356ee206649fef0d98b18ec5bc641986c22f62023da7fff775"}, "tags": [], "refs": [["shopify_customer_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__customer_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_customer_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer_tmp`"}, "model.shopify_source.stg_shopify__order_line_tmp": {"raw_sql": "select * \nfrom {{ var('order_line_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_line_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_line_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_line_tmp.sql", "name": "stg_shopify__order_line_tmp", "alias": "stg_shopify__order_line_tmp", "checksum": {"name": "sha256", "checksum": "4f88b0914ec43445b81faff6b8be89de161ef6df43072b89abbecee6579406f8"}, "tags": [], "refs": [["shopify_order_line_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_line_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_tmp`"}, "model.shopify_source.stg_shopify__refund_tmp": {"raw_sql": "select * from {{ var('refund_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_refund_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__refund_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__refund_tmp.sql", "original_file_path": "models/tmp/stg_shopify__refund_tmp.sql", "name": "stg_shopify__refund_tmp", "alias": "stg_shopify__refund_tmp", "checksum": {"name": "sha256", "checksum": "b3f28d92902436cbadbd58025984940667683f3464d32b4ed4af9e4fee62b63f"}, "tags": [], "refs": [["shopify_refund_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__refund_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * from `dbt-package-testing`.`shopify_integration_tests`.`shopify_refund_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund_tmp`"}, "model.shopify_source.stg_shopify__product_tmp": {"raw_sql": "select * \nfrom {{ var('product_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_product_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__product_tmp.sql", "original_file_path": "models/tmp/stg_shopify__product_tmp.sql", "name": "stg_shopify__product_tmp", "alias": "stg_shopify__product_tmp", "checksum": {"name": "sha256", "checksum": "dffc13a21ff254e1da0215bf970c1a017dc97b3ce01213de77f5d9ec5ad55058"}, "tags": [], "refs": [["shopify_product_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__product_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_product_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_tmp`"}, "model.shopify_source.stg_shopify__order_adjustment_tmp": {"raw_sql": "select * from {{ var('order_adjustment_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_adjustment_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_adjustment_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_adjustment_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_adjustment_tmp.sql", "name": "stg_shopify__order_adjustment_tmp", "alias": "stg_shopify__order_adjustment_tmp", "checksum": {"name": "sha256", "checksum": "101e5ba755fa6754726a19e618a84d69b19292c1798cf7a95ff626403a6391fb"}, "tags": [], "refs": [["shopify_order_adjustment_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_adjustment_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * from `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_adjustment_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment_tmp`"}, "model.shopify_source.stg_shopify__order_line_refund_tmp": {"raw_sql": "select * \nfrom {{ var('order_line_refund_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_line_refund_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_line_refund_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_line_refund_tmp.sql", "name": "stg_shopify__order_line_refund_tmp", "alias": "stg_shopify__order_line_refund_tmp", "checksum": {"name": "sha256", "checksum": "c8fbe437524231390da877b9938924ba3c35eb512e66cd8170effef15f4c833d"}, "tags": [], "refs": [["shopify_order_line_refund_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_line_refund_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_refund_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund_tmp`"}, "model.shopify_source.stg_shopify__transaction_tmp": {"raw_sql": "select *\nfrom {{ var('transaction_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_transaction_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__transaction_tmp"], "unique_id": "model.shopify_source.stg_shopify__transaction_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__transaction_tmp.sql", "original_file_path": "models/tmp/stg_shopify__transaction_tmp.sql", "name": "stg_shopify__transaction_tmp", "alias": "stg_shopify__transaction_tmp", "checksum": {"name": "sha256", "checksum": "1ff90d82e3717cc2fed52f012d44b32b056f4557d7eacbf7bbd9939db945d218"}, "tags": [], "refs": [["shopify_transaction_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__transaction_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select *\nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_transaction_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction_tmp`"}, "model.shopify_source.stg_shopify__product_variant_tmp": {"raw_sql": "select * \nfrom {{ var('product_variant_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_product_variant_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_variant_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_variant_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__product_variant_tmp.sql", "original_file_path": "models/tmp/stg_shopify__product_variant_tmp.sql", "name": "stg_shopify__product_variant_tmp", "alias": "stg_shopify__product_variant_tmp", "checksum": {"name": "sha256", "checksum": "2fc5d907ac6851ad0c903c4582ad191688fb04b6d0675d69f26704a6bb52d1ce"}, "tags": [], "refs": [["shopify_product_variant_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__product_variant_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_product_variant_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant_tmp`"}, "model.shopify_source.stg_shopify__order_tmp": {"raw_sql": "select * \nfrom {{ var('order_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_tmp.sql", "name": "stg_shopify__order_tmp", "alias": "stg_shopify__order_tmp", "checksum": {"name": "sha256", "checksum": "6366abc8eea74fea0832c0ad9084a1ddeb3f38409990d2cfdeff83c8b01f1e5f"}, "tags": [], "refs": [["shopify_order_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_tmp`"}, "test.shopify_source.unique_stg_shopify__customer_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_shopify__customer') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__customer"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__customer_customer_id"], "unique_id": "test.shopify_source.unique_stg_shopify__customer_customer_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__customer_customer_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__customer_customer_id", "alias": "unique_stg_shopify__customer_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__customer"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__customer_customer_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "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`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer`\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.shopify_source.not_null_stg_shopify__customer_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_shopify__customer') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__customer"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__customer_customer_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__customer_customer_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__customer_customer_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__customer_customer_id", "alias": "not_null_stg_shopify__customer_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__customer"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__customer_customer_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer`\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_line_refund_id", "model": "{{ ref('stg_shopify__order_line_refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_line_refund_order_line_refund_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_line_refund_order_line_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_line_refund_order_line_refund_id", "alias": "unique_stg_shopify__order_line_refund_order_line_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line_refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_line_refund_order_line_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_line_refund_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`\n where order_line_refund_id is not null\n group by order_line_refund_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_refund_id"}, "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_line_refund_id", "model": "{{ ref('stg_shopify__order_line_refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_line_refund_order_line_refund_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_line_refund_order_line_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_line_refund_order_line_refund_id", "alias": "not_null_stg_shopify__order_line_refund_order_line_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line_refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_line_refund_order_line_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`\nwhere order_line_refund_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_refund_id"}, "test.shopify_source.unique_stg_shopify__order_line_order_line_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_line_id", "model": "{{ ref('stg_shopify__order_line') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order_line"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_line_order_line_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_line_order_line_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_line_order_line_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_line_order_line_id", "alias": "unique_stg_shopify__order_line_order_line_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_line_order_line_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_line_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line`\n where order_line_id is not null\n group by order_line_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_id"}, "test.shopify_source.not_null_stg_shopify__order_line_order_line_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_line_id", "model": "{{ ref('stg_shopify__order_line') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order_line"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_line_order_line_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_line_order_line_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_line_order_line_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_line_order_line_id", "alias": "not_null_stg_shopify__order_line_order_line_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_line_order_line_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line`\nwhere order_line_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_id"}, "test.shopify_source.unique_stg_shopify__order_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ ref('stg_shopify__order') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_order_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_order_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_order_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_order_id", "alias": "unique_stg_shopify__order_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_order_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order`\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.shopify_source.not_null_stg_shopify__order_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ ref('stg_shopify__order') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_order_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_order_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_order_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_order_id", "alias": "not_null_stg_shopify__order_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_order_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order`\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.shopify_source.unique_stg_shopify__product_product_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "product_id", "model": "{{ ref('stg_shopify__product') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__product"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__product_product_id"], "unique_id": "test.shopify_source.unique_stg_shopify__product_product_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__product_product_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__product_product_id", "alias": "unique_stg_shopify__product_product_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__product_product_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n product_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product`\n where product_id is not null\n group by product_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "product_id"}, "test.shopify_source.not_null_stg_shopify__product_product_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "product_id", "model": "{{ ref('stg_shopify__product') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__product"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__product_product_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__product_product_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__product_product_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__product_product_id", "alias": "not_null_stg_shopify__product_product_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__product_product_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product`\nwhere product_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "product_id"}, "test.shopify_source.not_null_stg_shopify__product_variant_variant_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "variant_id", "model": "{{ ref('stg_shopify__product_variant') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__product_variant"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__product_variant_variant_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__product_variant_variant_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__product_variant_variant_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__product_variant_variant_id", "alias": "not_null_stg_shopify__product_variant_variant_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product_variant"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__product_variant_variant_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant`\nwhere variant_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "variant_id"}, "test.shopify_source.unique_stg_shopify__product_variant_variant_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "variant_id", "model": "{{ ref('stg_shopify__product_variant') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__product_variant"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__product_variant_variant_id"], "unique_id": "test.shopify_source.unique_stg_shopify__product_variant_variant_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__product_variant_variant_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__product_variant_variant_id", "alias": "unique_stg_shopify__product_variant_variant_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product_variant"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__product_variant_variant_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n variant_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant`\n where variant_id is not null\n group by variant_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "variant_id"}, "test.shopify_source.unique_stg_shopify__transaction_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_shopify__transaction') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__transaction"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__transaction_transaction_id"], "unique_id": "test.shopify_source.unique_stg_shopify__transaction_transaction_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__transaction_transaction_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__transaction_transaction_id", "alias": "unique_stg_shopify__transaction_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__transaction"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__transaction_transaction_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "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`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction`\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.shopify_source.not_null_stg_shopify__transaction_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_shopify__transaction') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__transaction"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__transaction_transaction_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__transaction_transaction_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__transaction_transaction_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__transaction_transaction_id", "alias": "not_null_stg_shopify__transaction_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__transaction"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__transaction_transaction_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction`\nwhere transaction_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_id"}, "test.shopify_source.unique_stg_shopify__refund_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "refund_id", "model": "{{ ref('stg_shopify__refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__refund_refund_id"], "unique_id": "test.shopify_source.unique_stg_shopify__refund_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__refund_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__refund_refund_id", "alias": "unique_stg_shopify__refund_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__refund_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n refund_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund`\n where refund_id is not null\n group by refund_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "refund_id"}, "test.shopify_source.not_null_stg_shopify__refund_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "refund_id", "model": "{{ ref('stg_shopify__refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__refund_refund_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__refund_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__refund_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__refund_refund_id", "alias": "not_null_stg_shopify__refund_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__refund_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund`\nwhere refund_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "refund_id"}, "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_adjustment_id", "model": "{{ ref('stg_shopify__order_adjustment') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_adjustment_order_adjustment_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_adjustment_order_adjustment_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_adjustment_order_adjustment_id", "alias": "unique_stg_shopify__order_adjustment_order_adjustment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_adjustment"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_adjustment_order_adjustment_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_adjustment_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`\n where order_adjustment_id is not null\n group by order_adjustment_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_adjustment_id"}, "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_adjustment_id", "model": "{{ ref('stg_shopify__order_adjustment') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_adjustment_order_adjustment_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_adjustment_order_adjustment_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_adjustment_order_adjustment_id", "alias": "not_null_stg_shopify__order_adjustment_order_adjustment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_adjustment"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_adjustment_order_adjustment_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`\nwhere order_adjustment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_adjustment_id"}}, "sources": {"source.shopify_source.shopify.order": {"fqn": ["shopify_source", "shopify", "order"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": true, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The ID of the app that created the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_1": {"name": "billing_address_address_1", "description": "The street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_2": {"name": "billing_address_address_2", "description": "An optional additional field for the street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_city": {"name": "billing_address_city", "description": "The city, town, or village of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_company": {"name": "billing_address_company", "description": "The company of the person associated with the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country": {"name": "billing_address_country", "description": "The name of the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country_code": {"name": "billing_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_first_name": {"name": "billing_address_first_name", "description": "The first name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_last_name": {"name": "billing_address_last_name", "description": "The last name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_latitude": {"name": "billing_address_latitude", "description": "The latitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_longitude": {"name": "billing_address_longitude", "description": "The longitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_name": {"name": "billing_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_phone": {"name": "billing_address_phone", "description": "The phone number at the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province": {"name": "billing_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province_code": {"name": "billing_address_province_code", "description": "The two-letter abbreviation of the region of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_zip": {"name": "billing_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "browser_ip": {"name": "browser_ip", "description": "The IP address of the browser used by the customer when they placed the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "buyer_accepts_marketing": {"name": "buyer_accepts_marketing", "description": "Whether the customer consented to receive email updates from the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancel_reason": {"name": "cancel_reason", "description": "The reason why the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancelled_at": {"name": "cancelled_at", "description": "The date and time when the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cart_token": {"name": "cart_token", "description": "The ID of the cart that's associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The date and time when the order was closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The autogenerated date and time when the order was created in Shopify.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code for the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "The ID of the order's customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The customer's email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "financial_status": {"name": "financial_status", "description": "The status of payments associated with the order. Can only be set when the order is created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "The order's status in terms of fulfilled line items.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The ID of the order, used for API purposes. This is different from the order_number property, which is the ID used by the shop owner and customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "landing_site_base_url": {"name": "landing_site_base_url", "description": "The URL for the page where the buyer landed when they entered the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the order was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The order name, generated by combining the order_number property with the order prefix and suffix that are set in the merchant's general settings.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "An optional note that a shop owner can attach to the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The order's position in the shop's count of orders. Numbers are sequential and start at 1.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "The order 's position in the shop's count of orders starting at 1001. Order numbers are sequential and start at 1001.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "The date and time when an order was processed. This value is the date that appears on your orders and that's used in the analytic reports.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processing_method": {"name": "processing_method", "description": "How the payment was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "referring_site": {"name": "referring_site", "description": "The website where the customer clicked a link to the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_1": {"name": "shipping_address_address_1", "description": "The street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_2": {"name": "shipping_address_address_2", "description": "An optional additional field for the street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_city": {"name": "shipping_address_city", "description": "The city, town, or village of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_company": {"name": "shipping_address_company", "description": "The company of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country": {"name": "shipping_address_country", "description": "The name of the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country_code": {"name": "shipping_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_first_name": {"name": "shipping_address_first_name", "description": "The first name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_last_name": {"name": "shipping_address_last_name", "description": "The last name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_latitude": {"name": "shipping_address_latitude", "description": "The latitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_longitude": {"name": "shipping_address_longitude", "description": "The longitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_name": {"name": "shipping_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_phone": {"name": "shipping_address_phone", "description": "The phone number at the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province": {"name": "shipping_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province_code": {"name": "shipping_address_province_code", "description": "The two-letter abbreviation of the region of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_zip": {"name": "shipping_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "Where the order originated. Can be set only during order creation, and is not writeable afterwards.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal_price": {"name": "subtotal_price", "description": "The price of the order in the shop currency after discounts but before shipping, taxes, and tips.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxes_included": {"name": "taxes_included", "description": "Whether taxes are included in the order subtotal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether this is a test order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "token": {"name": "token", "description": "A unique token for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discounts": {"name": "total_discounts", "description": "The total discounts applied to the price of the order in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_line_items_price": {"name": "total_line_items_price", "description": "The sum of all line item prices in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The sum of all the taxes applied to the order in th shop currency. Must be positive).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_weight": {"name": "total_weight", "description": "The sum of all line item weights in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time (ISO 8601 format) when the order was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID of the user logged into Shopify POS who processed the order, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order`"}, "source.shopify_source.shopify.customer": {"fqn": ["shopify_source", "shopify", "customer"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.customer", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "customer", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "customer", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a customer in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accepts_marketing": {"name": "accepts_marketing", "description": "Whether the customer has consented to receive marketing material via email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time when the customer was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_address_id": {"name": "default_address_id", "description": "The default address for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The customer's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "A unique identifier for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The customer's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orders_count": {"name": "orders_count", "description": "The number of orders associated with this customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the customer's account with a shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_exempt": {"name": "tax_exempt", "description": "Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_spent": {"name": "total_spent", "description": "The total amount of money that the customer has spent across their order history.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the customer information was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "verified_email": {"name": "verified_email", "description": "Whether the customer has verified their email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`customer`"}, "source.shopify_source.shopify.order_line": {"fqn": ["shopify_source", "shopify", "order_line"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_line", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_line", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_line", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a line item for an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillable_quantity": {"name": "fulfillable_quantity", "description": "The amount available to fulfill, calculated as follows: quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The service provider that's fulfilling the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "How far along an order is in terms line items fulfilled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gift_card": {"name": "gift_card", "description": "Whether the item is a gift card. If true, then the item is not taxed or considered for shipping charges.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the item in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The ID of the line item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the related order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the item before discounts have been applied in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The ID of the product that the line item belongs to. Can be null if the original product associated with the order is deleted at a later date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of items that were purchased.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requires_shipping": {"name": "requires_shipping", "description": "Whether the item requires shipping.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "The item's SKU (stock keeping unit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxable": {"name": "taxable", "description": "Whether the item was taxable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discount": {"name": "total_discount", "description": "The total amount of the discount allocated to the line item in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The ID of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the item's supplier.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order_line`"}, "source.shopify_source.shopify.order_line_refund": {"fqn": ["shopify_source", "shopify", "order_line_refund"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_line_refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_line_refund", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_line_refund", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a line item refund in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The unique identifier of the line item in the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "TThe unique identifier of the location where the items will be restockedBD", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the related line item in the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the associated line item that was returned.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID of the related refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock_type": {"name": "restock_type", "description": "How this refund line item affects inventory levels.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal": {"name": "subtotal", "description": "Subtotal amount of the order line refund", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The total tax applied to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order_line_refund`"}, "source.shopify_source.shopify.product": {"fqn": ["shopify_source", "shopify", "product"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.product", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "product", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "product", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a product in Shopify.", "columns": {"_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Whether the record has been deleted in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time when the product was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "handle": {"name": "handle", "description": "A unique human-friendly string for the product. Automatically generated from the product's title.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "An unsigned 64-bit integer that's used as a unique identifier for the product. Each id is unique across the Shopify system. No two products will have the same id, even if they're from different shops.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_type": {"name": "product_type", "description": "A categorization for the product used for filtering and searching products.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_at": {"name": "published_at", "description": "The date and time (ISO 8601 format) when the product was published. Can be set to null to unpublish the product from the Online Store channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_scope": {"name": "published_scope", "description": "Whether the product is published to the Point of Sale channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The name of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the product was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the product's vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`product`"}, "source.shopify_source.shopify.product_variant": {"fqn": ["shopify_source", "shopify", "product_variant"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.product_variant", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "product_variant", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "product_variant", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a product variant in Shopify", "columns": {"barcode": {"name": "barcode", "description": "The barcode, UPC, or ISBN number for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "compare_at_price": {"name": "compare_at_price", "description": "The original price of the item before an adjustment or a sale.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time (ISO 8601 format) when the product variant was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The fulfillment service associated with the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the product variant in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The unique numeric identifier for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "image_id": {"name": "image_id", "description": "The unique numeric identifier for a product's image. The image must be associated to the same product as the variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_item_id": {"name": "inventory_item_id", "description": "The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_management": {"name": "inventory_management", "description": "The fulfillment service that tracks the number of items in stock for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_policy": {"name": "inventory_policy", "description": "Whether customers are allowed to place an order for the product variant when it's out of stock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_quantity": {"name": "inventory_quantity", "description": "An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "old_inventory_quantity": {"name": "old_inventory_quantity", "description": "This property is deprecated. Use the InventoryLevel resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_1": {"name": "option_1", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_2": {"name": "option_2", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_3": {"name": "option_3", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The order of the product variant in the list of product variants. The first position in the list is 1. The position of variants is indicated by the order in which they are listed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The unique numeric identifier for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requires_shipping": {"name": "requires_shipping", "description": "This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxable": {"name": "taxable", "description": "Whether a tax is charged when the product variant is sold.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_code": {"name": "tax_code", "description": "This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product variant. The title field is a concatenation of the option1, option2, and option3 fields. You can only update title indirectly using the option fields.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the product variant was last modified. Gets returned in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight": {"name": "weight", "description": "The weight of the product variant in the unit system specified with weight_unit.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight_unit": {"name": "weight_unit", "description": "The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_shipping_price_set": {"name": "total_shipping_price_set", "description": "The total shipping price set for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "index": {"name": "index", "description": "The index associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pre_tax_price": {"name": "pre_tax_price", "description": "The total pre tax price of the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`product_variant`"}, "source.shopify_source.shopify.transaction": {"fqn": ["shopify_source", "shopify", "transaction"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.transaction", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "transaction", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "transaction", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a transaction in Shopify.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The ID for the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID for the order that the transaction is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID associated with a refund in the refund table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of money included in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authorization": {"name": "authorization", "description": "The authorization code associated with the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the transaction was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when a transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device_id": {"name": "device_id", "description": "The ID for the device.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gateway": {"name": "gateway", "description": "The name of the gateway the transaction was issued through.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "The origin of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "message": {"name": "message", "description": "A string generated by the payment provider with additional information about why the transaction succeeded or failed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code (ISO 4217 format) for the currency used for the payment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The ID of an associated transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_avs_result_code": {"name": "payment_avs_result_code", "description": "The response code from the address verification system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_bin": {"name": "payment_credit_card_bin", "description": "The issuer identification number (IIN), formerly known as bank identification number (BIN) of the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_cvv_result_code": {"name": "payment_cvv_result_code", "description": "The response code from the credit card company indicating whether the customer entered the card security code, or card verification value, correctly.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_number": {"name": "payment_credit_card_number", "description": "The customer's credit card number, with most of the leading digits redacted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_company": {"name": "payment_credit_card_company", "description": "The name of the company that issued the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The transaction's type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "receipt": {"name": "receipt", "description": "A transaction receipt attached to the transaction by the gateway.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_id": {"name": "currency_exchange_id", "description": "The ID of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_adjustment": {"name": "currency_exchange_adjustment", "description": "The difference between the amounts on the associated transaction and the parent transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_original_amount": {"name": "currency_exchange_original_amount", "description": "The amount of the parent transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_final_amount": {"name": "currency_exchange_final_amount", "description": "The amount of the associated transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_currency": {"name": "currency_exchange_currency", "description": "The shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "error_code": {"name": "error_code", "description": "A standardized error code, independent of the payment provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether the transaction is a test transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`transaction`"}, "source.shopify_source.shopify.refund": {"fqn": ["shopify_source", "shopify", "refund"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "refund", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "refund", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a refund within Shopify.", "columns": {"id": {"name": "id", "description": "The unique numeric identifier for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of the date when the refund was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "Timestamp of the date when the refund was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "User generated note attached to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock": {"name": "restock", "description": "Boolean indicating if the refund is a result of a restock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Reference to the user id which generated the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_duties_set": {"name": "total_duties_set", "description": "Record representing total duties set for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the refund is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`refund`"}, "source.shopify_source.shopify.order_adjustment": {"fqn": ["shopify_source", "shopify", "order_adjustment"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_adjustment", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_adjustment", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_adjustment", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents and adjustment to and order within Shopify.", "columns": {"id": {"name": "id", "description": "The unique numeric identifier for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "Reference to the refund which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Amount of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount": {"name": "tax_amount", "description": "Tax amount applied to the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The kind of order adjustment (eg. refund, restock, etc.).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "The reason for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount_set": {"name": "amount_set", "description": "Amount set towards the order adjustment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount_set": {"name": "tax_amount_set", "description": "Tax amount set towards the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order_adjustment`"}}, "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.shopify_source.get_order_columns": {"unique_id": "macro.shopify_source.get_order_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_columns", "macro_sql": "{% macro get_order_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"billing_address_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_address_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_latitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_longitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_province\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_province_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"browser_ip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"buyer_accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_buyer_accepted_marketing\"},\n {\"name\": \"cancel_reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"cancelled_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"cancelled_timestamp\"},\n {\"name\": \"cart_token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"checkout_token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"closed_timestamp\"},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customer_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"financial_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_id\"},\n {\"name\": \"landing_site_base_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"note\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"number\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"order_number\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"processing_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"referring_site\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_shipping_price_set\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_address_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_latitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_longitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_province\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_province_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"source_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subtotal_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"taxes_included\", \"datatype\": \"boolean\", \"alias\": \"has_taxes_included\"},\n {\"name\": \"test\", \"datatype\": \"boolean\", \"alias\": \"is_test_order\"},\n {\"name\": \"token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_discounts\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_line_items_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_tax\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_weight\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()}\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.shopify_source.get_customer_columns": {"unique_id": "macro.shopify_source.get_customer_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_customer_columns", "macro_sql": "{% macro get_customer_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_accepted_marketing\"},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"default_address_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"customer_id\"},\n {\"name\": \"last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"orders_count\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string(), \"alias\": \"account_state\"},\n {\"name\": \"tax_exempt\", \"datatype\": \"boolean\", \"alias\": \"is_tax_exempt\"},\n {\"name\": \"total_spent\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"verified_email\", \"datatype\": \"boolean\", \"alias\": \"is_verified_email\"}\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.shopify_source.get_order_line_refund_columns": {"unique_id": "macro.shopify_source.get_order_line_refund_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_line_refund_columns", "macro_sql": "{% macro get_order_line_refund_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_line_refund_id\"},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"order_line_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"subtotal\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"total_tax\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"restock_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.shopify_source.get_order_line_columns": {"unique_id": "macro.shopify_source.get_order_line_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_line_columns", "macro_sql": "{% macro get_order_line_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"fulfillable_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"gift_card\", \"datatype\": \"boolean\", \"alias\": \"is_gift_card\"},\n {\"name\": \"grams\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_line_id\"},\n {\"name\": \"index\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"pre_tax_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"product_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_charge_interval_frequency\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_for_shipping_jan_3_rd_2020\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"property_shipping_interval_frequency\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_shipping_interval_unit_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"property_subscription_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"requires_shipping\", \"datatype\": \"boolean\", \"alias\": \"is_requiring_shipping\"},\n {\"name\": \"sku\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_discount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"variant_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"vendor\", \"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.shopify_source.get_product_columns": {"unique_id": "macro.shopify_source.get_product_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_product_columns", "macro_sql": "{% macro get_product_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"handle\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"product_id\"},\n {\"name\": \"product_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"published_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"published_timestamp\"},\n {\"name\": \"published_scope\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"vendor\", \"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.shopify_source.get_product_variant_columns": {"unique_id": "macro.shopify_source.get_product_variant_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_product_variant_columns", "macro_sql": "{% macro get_product_variant_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"variant_id\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"product_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"inventory_item_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"image_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"sku\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"position\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"inventory_policy\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"compare_at_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inventory_management\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"barcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"grams\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"inventory_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"weight\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"weight_unit\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_3\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"old_inventory_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"requires_shipping\", \"datatype\": \"boolean\", \"alias\": \"is_requiring_shipping\"}\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.shopify_source.get_transaction_columns": {"unique_id": "macro.shopify_source.get_transaction_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_transaction_columns", "macro_sql": "{% macro get_transaction_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"transaction_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"device_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"gateway\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"source_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"message\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"payment_avs_result_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_bin\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_cvv_result_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"kind\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"receipt\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency_exchange_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_adjustment\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_original_amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_final_amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"test\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{% if target.type in ('redshift','postgres') %}\n {{ columns.append({\"name\": \"authorization\", \"datatype\": dbt_utils.type_string(), \"quote\": True, \"alias\": \"authorization\"}) }}\n{% else %}\n {\"name\": \"authorization\", \"datatype\": dbt_utils.type_string()}\n{% endif %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.shopify_source.get_refund_columns": {"unique_id": "macro.shopify_source.get_refund_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_refund_columns", "macro_sql": "{% macro get_refund_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"refund_id\"},\n {\"name\": \"note\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"restock\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()}\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.shopify_source.get_order_adjustment_columns": {"unique_id": "macro.shopify_source.get_order_adjustment_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_adjustment_columns", "macro_sql": "{% macro get_order_adjustment_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_adjustment_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"kind\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()}\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.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/geo/haversine_distance.sql", "original_file_path": "macros/geo/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1,lon1,lat2,lon2) -%}\n {{ return(adapter.dispatch('haversine_distance', packages = dbt_utils._get_utils_namespaces())(lat1,lon1,lat2,lon2)) }}\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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/geo/haversine_distance.sql", "original_file_path": "macros/geo/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1,lon1,lat2,lon2) -%}\n\n 2 * 3961 * asin(sqrt((sin(radians(({{lat2}} - {{lat1}}) / 2))) ^ 2 +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n (sin(radians(({{lon2}} - {{lon1}}) / 2))) ^ 2))\n\n{%- endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 {{ column_name }}\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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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\nwith meet_condition as (\n\n select * from {{ model }} where {{ condition }}\n\n),\nvalidation_errors as (\n\n select\n *\n from meet_condition\n where not({{expression}})\n\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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') %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', packages = dbt_utils._get_utils_namespaces())(model, lower_bound_column, upper_bound_column, partition_by, gaps)) }}\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/Shopify/dbt_shopify_source/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') %}\n\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }},\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions nore cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound < upper_bound,\n false\n ) as lower_bound_less_than_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_less_than_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect count(*) from validation_errors\n{% endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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({{ col.column }} as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.spark_utils.spark__type_numeric": {"unique_id": "macro.spark_utils.spark__type_numeric", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "name": "spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__dateadd": {"unique_id": "macro.spark_utils.spark__dateadd", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "name": "spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }}, {{interval}} * {{multiplier}})\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n {{interval}} * {{multiplier}}\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + {{interval}} * {{multiplier}}\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__datediff": {"unique_id": "macro.spark_utils.spark__datediff", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "name": "spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', second_date) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', first_date) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', second_date) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', first_date) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__current_timestamp": {"unique_id": "macro.spark_utils.spark__current_timestamp", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__current_timestamp_in_utc": {"unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__split_part": {"unique_id": "macro.spark_utils.spark__split_part", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "name": "spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_relations_by_pattern": {"unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_relations_by_prefix": {"unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_tables_by_pattern": {"unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_tables_by_prefix": {"unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.assert_not_null": {"unique_id": "macro.spark_utils.assert_not_null", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__convert_timezone": {"unique_id": "macro.spark_utils.spark__convert_timezone", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "name": "spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 explode(from_json( {{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.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 == 'bigquery' %}\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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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."}, "shopify_source._fivetran_synced": {"unique_id": "shopify_source._fivetran_synced", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "_fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "selectors": {}, "disabled": [], "parent_map": {"seed.shopify_source_integration_tests.shopify_order_data": [], "seed.shopify_source_integration_tests.shopify_order_line_refund_data": [], "seed.shopify_source_integration_tests.shopify_order_adjustment_data": [], "seed.shopify_source_integration_tests.shopify_product_variant_data": [], "seed.shopify_source_integration_tests.shopify_refund_data": [], "seed.shopify_source_integration_tests.shopify_transaction_data": [], "seed.shopify_source_integration_tests.shopify_product_data": [], "seed.shopify_source_integration_tests.shopify_customer_data": [], "seed.shopify_source_integration_tests.shopify_order_line_data": [], "model.shopify_source.stg_shopify__order_line": ["model.shopify_source.stg_shopify__order_line_tmp", "model.shopify_source.stg_shopify__order_line_tmp"], "model.shopify_source.stg_shopify__refund": ["model.shopify_source.stg_shopify__refund_tmp", "model.shopify_source.stg_shopify__refund_tmp"], "model.shopify_source.stg_shopify__product": ["model.shopify_source.stg_shopify__product_tmp", "model.shopify_source.stg_shopify__product_tmp"], "model.shopify_source.stg_shopify__product_variant": ["model.shopify_source.stg_shopify__product_variant_tmp", "model.shopify_source.stg_shopify__product_variant_tmp"], "model.shopify_source.stg_shopify__order": ["model.shopify_source.stg_shopify__order_tmp", "model.shopify_source.stg_shopify__order_tmp"], "model.shopify_source.stg_shopify__transaction": ["model.shopify_source.stg_shopify__transaction_tmp", "model.shopify_source.stg_shopify__transaction_tmp"], "model.shopify_source.stg_shopify__order_adjustment": ["model.shopify_source.stg_shopify__order_adjustment_tmp", "model.shopify_source.stg_shopify__order_adjustment_tmp"], "model.shopify_source.stg_shopify__customer": ["model.shopify_source.stg_shopify__customer_tmp", "model.shopify_source.stg_shopify__customer_tmp"], "model.shopify_source.stg_shopify__order_line_refund": ["model.shopify_source.stg_shopify__order_line_refund_tmp", "model.shopify_source.stg_shopify__order_line_refund_tmp"], "model.shopify_source.stg_shopify__customer_tmp": ["seed.shopify_source_integration_tests.shopify_customer_data"], "model.shopify_source.stg_shopify__order_line_tmp": ["seed.shopify_source_integration_tests.shopify_order_line_data"], "model.shopify_source.stg_shopify__refund_tmp": ["seed.shopify_source_integration_tests.shopify_refund_data"], "model.shopify_source.stg_shopify__product_tmp": ["seed.shopify_source_integration_tests.shopify_product_data"], "model.shopify_source.stg_shopify__order_adjustment_tmp": ["seed.shopify_source_integration_tests.shopify_order_adjustment_data"], "model.shopify_source.stg_shopify__order_line_refund_tmp": ["seed.shopify_source_integration_tests.shopify_order_line_refund_data"], "model.shopify_source.stg_shopify__transaction_tmp": ["seed.shopify_source_integration_tests.shopify_transaction_data"], "model.shopify_source.stg_shopify__product_variant_tmp": ["seed.shopify_source_integration_tests.shopify_product_variant_data"], "model.shopify_source.stg_shopify__order_tmp": ["seed.shopify_source_integration_tests.shopify_order_data"], "test.shopify_source.unique_stg_shopify__customer_customer_id": ["model.shopify_source.stg_shopify__customer"], "test.shopify_source.not_null_stg_shopify__customer_customer_id": ["model.shopify_source.stg_shopify__customer"], "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id": ["model.shopify_source.stg_shopify__order_line_refund"], "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id": ["model.shopify_source.stg_shopify__order_line_refund"], "test.shopify_source.unique_stg_shopify__order_line_order_line_id": ["model.shopify_source.stg_shopify__order_line"], "test.shopify_source.not_null_stg_shopify__order_line_order_line_id": ["model.shopify_source.stg_shopify__order_line"], "test.shopify_source.unique_stg_shopify__order_order_id": ["model.shopify_source.stg_shopify__order"], "test.shopify_source.not_null_stg_shopify__order_order_id": ["model.shopify_source.stg_shopify__order"], "test.shopify_source.unique_stg_shopify__product_product_id": ["model.shopify_source.stg_shopify__product"], "test.shopify_source.not_null_stg_shopify__product_product_id": ["model.shopify_source.stg_shopify__product"], "test.shopify_source.not_null_stg_shopify__product_variant_variant_id": ["model.shopify_source.stg_shopify__product_variant"], "test.shopify_source.unique_stg_shopify__product_variant_variant_id": ["model.shopify_source.stg_shopify__product_variant"], "test.shopify_source.unique_stg_shopify__transaction_transaction_id": ["model.shopify_source.stg_shopify__transaction"], "test.shopify_source.not_null_stg_shopify__transaction_transaction_id": ["model.shopify_source.stg_shopify__transaction"], "test.shopify_source.unique_stg_shopify__refund_refund_id": ["model.shopify_source.stg_shopify__refund"], "test.shopify_source.not_null_stg_shopify__refund_refund_id": ["model.shopify_source.stg_shopify__refund"], "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id": ["model.shopify_source.stg_shopify__order_adjustment"], "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id": ["model.shopify_source.stg_shopify__order_adjustment"], "source.shopify_source.shopify.order": [], "source.shopify_source.shopify.customer": [], "source.shopify_source.shopify.order_line": [], "source.shopify_source.shopify.order_line_refund": [], "source.shopify_source.shopify.product": [], "source.shopify_source.shopify.product_variant": [], "source.shopify_source.shopify.transaction": [], "source.shopify_source.shopify.refund": [], "source.shopify_source.shopify.order_adjustment": []}, "child_map": {"seed.shopify_source_integration_tests.shopify_order_data": ["model.shopify_source.stg_shopify__order_tmp"], "seed.shopify_source_integration_tests.shopify_order_line_refund_data": ["model.shopify_source.stg_shopify__order_line_refund_tmp"], "seed.shopify_source_integration_tests.shopify_order_adjustment_data": ["model.shopify_source.stg_shopify__order_adjustment_tmp"], "seed.shopify_source_integration_tests.shopify_product_variant_data": ["model.shopify_source.stg_shopify__product_variant_tmp"], "seed.shopify_source_integration_tests.shopify_refund_data": ["model.shopify_source.stg_shopify__refund_tmp"], "seed.shopify_source_integration_tests.shopify_transaction_data": ["model.shopify_source.stg_shopify__transaction_tmp"], "seed.shopify_source_integration_tests.shopify_product_data": ["model.shopify_source.stg_shopify__product_tmp"], "seed.shopify_source_integration_tests.shopify_customer_data": ["model.shopify_source.stg_shopify__customer_tmp"], "seed.shopify_source_integration_tests.shopify_order_line_data": ["model.shopify_source.stg_shopify__order_line_tmp"], "model.shopify_source.stg_shopify__order_line": ["test.shopify_source.not_null_stg_shopify__order_line_order_line_id", "test.shopify_source.unique_stg_shopify__order_line_order_line_id"], "model.shopify_source.stg_shopify__refund": ["test.shopify_source.not_null_stg_shopify__refund_refund_id", "test.shopify_source.unique_stg_shopify__refund_refund_id"], "model.shopify_source.stg_shopify__product": ["test.shopify_source.not_null_stg_shopify__product_product_id", "test.shopify_source.unique_stg_shopify__product_product_id"], "model.shopify_source.stg_shopify__product_variant": ["test.shopify_source.not_null_stg_shopify__product_variant_variant_id", "test.shopify_source.unique_stg_shopify__product_variant_variant_id"], "model.shopify_source.stg_shopify__order": ["test.shopify_source.not_null_stg_shopify__order_order_id", "test.shopify_source.unique_stg_shopify__order_order_id"], "model.shopify_source.stg_shopify__transaction": ["test.shopify_source.not_null_stg_shopify__transaction_transaction_id", "test.shopify_source.unique_stg_shopify__transaction_transaction_id"], "model.shopify_source.stg_shopify__order_adjustment": ["test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id", "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id"], "model.shopify_source.stg_shopify__customer": ["test.shopify_source.not_null_stg_shopify__customer_customer_id", "test.shopify_source.unique_stg_shopify__customer_customer_id"], "model.shopify_source.stg_shopify__order_line_refund": ["test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id", "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id"], "model.shopify_source.stg_shopify__customer_tmp": ["model.shopify_source.stg_shopify__customer", "model.shopify_source.stg_shopify__customer"], "model.shopify_source.stg_shopify__order_line_tmp": ["model.shopify_source.stg_shopify__order_line", "model.shopify_source.stg_shopify__order_line"], "model.shopify_source.stg_shopify__refund_tmp": ["model.shopify_source.stg_shopify__refund", "model.shopify_source.stg_shopify__refund"], "model.shopify_source.stg_shopify__product_tmp": ["model.shopify_source.stg_shopify__product", "model.shopify_source.stg_shopify__product"], "model.shopify_source.stg_shopify__order_adjustment_tmp": ["model.shopify_source.stg_shopify__order_adjustment", "model.shopify_source.stg_shopify__order_adjustment"], "model.shopify_source.stg_shopify__order_line_refund_tmp": ["model.shopify_source.stg_shopify__order_line_refund", "model.shopify_source.stg_shopify__order_line_refund"], "model.shopify_source.stg_shopify__transaction_tmp": ["model.shopify_source.stg_shopify__transaction", "model.shopify_source.stg_shopify__transaction"], "model.shopify_source.stg_shopify__product_variant_tmp": ["model.shopify_source.stg_shopify__product_variant", "model.shopify_source.stg_shopify__product_variant"], "model.shopify_source.stg_shopify__order_tmp": ["model.shopify_source.stg_shopify__order", "model.shopify_source.stg_shopify__order"], "test.shopify_source.unique_stg_shopify__customer_customer_id": [], "test.shopify_source.not_null_stg_shopify__customer_customer_id": [], "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id": [], "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id": [], "test.shopify_source.unique_stg_shopify__order_line_order_line_id": [], "test.shopify_source.not_null_stg_shopify__order_line_order_line_id": [], "test.shopify_source.unique_stg_shopify__order_order_id": [], "test.shopify_source.not_null_stg_shopify__order_order_id": [], "test.shopify_source.unique_stg_shopify__product_product_id": [], "test.shopify_source.not_null_stg_shopify__product_product_id": [], "test.shopify_source.not_null_stg_shopify__product_variant_variant_id": [], "test.shopify_source.unique_stg_shopify__product_variant_variant_id": [], "test.shopify_source.unique_stg_shopify__transaction_transaction_id": [], "test.shopify_source.not_null_stg_shopify__transaction_transaction_id": [], "test.shopify_source.unique_stg_shopify__refund_refund_id": [], "test.shopify_source.not_null_stg_shopify__refund_refund_id": [], "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id": [], "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id": [], "source.shopify_source.shopify.order": [], "source.shopify_source.shopify.customer": [], "source.shopify_source.shopify.order_line": [], "source.shopify_source.shopify.order_line_refund": [], "source.shopify_source.shopify.product": [], "source.shopify_source.shopify.product_variant": [], "source.shopify_source.shopify.transaction": [], "source.shopify_source.shopify.refund": [], "source.shopify_source.shopify.order_adjustment": []}} \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index ccf73d1..db4db08 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -5,15 +5,15 @@ config-version: 2 vars: shopify_source: - customer_source: "{{ ref('shopify_customer_data') }}" - order_line_refund_source: "{{ ref('shopify_order_line_refund_data') }}" - order_line_source: "{{ ref('shopify_order_line_data') }}" - order_source: "{{ ref('shopify_order_data') }}" - product_source: "{{ ref('shopify_product_data') }}" - order_adjustment_source: "{{ ref('shopify_order_adjustment_data') }}" - product_variant_source: "{{ ref('shopify_product_variant_data') }}" - refund_source: "{{ ref('shopify_refund_data') }}" - transaction_source: "{{ ref('shopify_transaction_data') }}" + shopify_customer_identifier: "shopify_customer_data" + shopify_order_line_refund_identifier: "shopify_order_line_refund_data" + shopify_order_line_identifier: "shopify_order_line_data" + shopify_order_identifier: "shopify_order_data" + shopify_product_identifier: "shopify_product_data" + shopify_order_adjustment_identifier: "shopify_order_adjustment_data" + shopify_product_variant_identifier: "shopify_product_variant_data" + shopify_refund_identifier: "shopify_refund_data" + shopify_transaction_identifier: "shopify_transaction_data" dispatch: - macro_namespace: dbt_utils diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 34dd321..6d00e72 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -6,6 +6,7 @@ sources: database: "{% if target.type != 'spark'%}{{ var('shopify_database', target.database) }}{% endif %}" tables: - name: order + identifier: "{{ var('shopify_order_identifier', 'order') }}" description: Each record represents an order in Shopify. identifier: "{%- if target.type == 'snowflake' -%} ORDER {%- else -%} order {%- endif -%}" quoting: @@ -144,6 +145,7 @@ sources: - name: user_id description: The ID of the user logged into Shopify POS who processed the order, if applicable. - name: customer + identifier: "{{ var('shopify_customer_identifier', 'customer') }}" description: Each record represents a customer in Shopify. columns: - name: _fivetran_synced @@ -177,6 +179,7 @@ sources: - name: verified_email description: Whether the customer has verified their email address. - name: order_line + identifier: "{{ var('shopify_order_line_identifier', 'order_line') }}" description: Each record represents a line item for an order in Shopify. columns: - name: _fivetran_synced @@ -218,6 +221,7 @@ sources: - name: vendor description: The name of the item's supplier. - name: order_line_refund + identifier: "{{ var('shopify_order_line_refund_identifier', 'order_line_refund') }}" description: Each record represents a line item refund in Shopify. columns: - name: _fivetran_synced @@ -239,6 +243,7 @@ sources: - name: total_tax description: The total tax applied to the refund. - name: product + identifier: "{{ var('shopify_product_identifier', 'product') }}" description: Each record represents a product in Shopify. columns: - name: _fivetran_deleted @@ -264,6 +269,7 @@ sources: - name: vendor description: The name of the product's vendor. - name: product_variant + identifier: "{{ var('shopify_product_variant_identifier', 'product_variant') }}" description: Each record represents a product variant in Shopify columns: - name: barcode @@ -327,6 +333,7 @@ sources: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: transaction + identifier: "{{ var('shopify_transaction_identifier', 'transaction') }}" description: Each record represents a transaction in Shopify. columns: - name: transaction_id @@ -392,6 +399,7 @@ sources: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: refund + identifier: "{{ var('shopify_refund_identifier', 'refund') }}" description: Each record represents a refund within Shopify. columns: - name: id @@ -413,6 +421,7 @@ sources: - name: order_id description: Reference to the order which the refund is associated. - name: order_adjustment + identifier: "{{ var('shopify_order_adjustment_identifier', 'order_adjustment') }}" description: Each record represents and adjustment to and order within Shopify. columns: - name: id From 7cec3be77736ba042d00b593d03dac558c78f018 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Mon, 16 May 2022 16:23:04 -0700 Subject: [PATCH 006/137] schema var --- integration_tests/dbt_project.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index db4db08..cd44fd6 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -15,6 +15,8 @@ vars: shopify_refund_identifier: "shopify_refund_data" shopify_transaction_identifier: "shopify_transaction_data" + shopify_schema: shopify_source_integration_tests + dispatch: - macro_namespace: dbt_utils search_order: ['spark_utils', 'dbt_utils'] From abd5ed7ae6fd6d3eec9ee8fed75b724c72cab520 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Tue, 17 May 2022 16:55:48 -0700 Subject: [PATCH 007/137] try --- integration_tests/dbt_project.yml | 1 - models/tmp/stg_shopify__order_tmp.sql | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index cd44fd6..fd89112 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -14,7 +14,6 @@ vars: shopify_product_variant_identifier: "shopify_product_variant_data" shopify_refund_identifier: "shopify_refund_data" shopify_transaction_identifier: "shopify_transaction_data" - shopify_schema: shopify_source_integration_tests dispatch: diff --git a/models/tmp/stg_shopify__order_tmp.sql b/models/tmp/stg_shopify__order_tmp.sql index 81a23ad..910812b 100644 --- a/models/tmp/stg_shopify__order_tmp.sql +++ b/models/tmp/stg_shopify__order_tmp.sql @@ -1,6 +1,6 @@ {{ fivetran_utils.union_data( - table_identifier='order', + table_identifier='shopify_order_identifier', database_variable='shopify_database', schema_variable='shopify_schema', default_database=target.database, From af563a22a98195a5f0fdba2bc2816282269e11cf Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Wed, 18 May 2022 11:12:25 -0700 Subject: [PATCH 008/137] revert --- models/tmp/stg_shopify__order_tmp.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/tmp/stg_shopify__order_tmp.sql b/models/tmp/stg_shopify__order_tmp.sql index 910812b..6c0bbc1 100644 --- a/models/tmp/stg_shopify__order_tmp.sql +++ b/models/tmp/stg_shopify__order_tmp.sql @@ -1,6 +1,6 @@ {{ fivetran_utils.union_data( - table_identifier='shopify_order_identifier', + table_identifier='order', database_variable='shopify_database', schema_variable='shopify_schema', default_database=target.database, From f35c2b1152862bfbb6622408606a25a3b9dc0b3c Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Wed, 18 May 2022 11:21:58 -0700 Subject: [PATCH 009/137] order fix --- models/src_shopify.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 6d00e72..e2ba1fe 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -6,9 +6,8 @@ sources: database: "{% if target.type != 'spark'%}{{ var('shopify_database', target.database) }}{% endif %}" tables: - name: order - identifier: "{{ var('shopify_order_identifier', 'order') }}" description: Each record represents an order in Shopify. - identifier: "{%- if target.type == 'snowflake' -%} ORDER {%- else -%} order {%- endif -%}" + identifier: "{%- if target.type == 'snowflake' -%} {{var('shopify_order_identifier', 'ORDER') }} {%- else -%} {{ var('shopify_order_identifier', 'order') }} {%- endif -%}" quoting: identifier: true columns: From 254dad045841aa500806eb5e6303d821d2274058 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Wed, 18 May 2022 13:09:29 -0700 Subject: [PATCH 010/137] add column to seed --- integration_tests/seeds/shopify_order_data.csv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration_tests/seeds/shopify_order_data.csv b/integration_tests/seeds/shopify_order_data.csv index 83dbb5e..e082060 100644 --- a/integration_tests/seeds/shopify_order_data.csv +++ b/integration_tests/seeds/shopify_order_data.csv @@ -1,4 +1,4 @@ -id,note,email,taxes_included,currency,subtotal_price,total_tax,total_price,created_at,updated_at,name,shipping_address_name,shipping_address_first_name,shipping_address_last_name,shipping_address_company,shipping_address_phone,shipping_address_address_1,shipping_address_address_2,shipping_address_city,shipping_address_country,shipping_address_country_code,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_address_latitude,shipping_address_longitude,billing_address_name,billing_address_first_name,billing_address_last_name,billing_address_company,billing_address_phone,billing_address_address_1,billing_address_address_2,billing_address_city,billing_address_country,billing_address_country_code,billing_address_province,billing_address_province_code,billing_address_zip,billing_address_latitude,billing_address_longitude,customer_id,location_id,user_id,number,order_number,financial_status,fulfillment_status,processed_at,processing_method,referring_site,cancel_reason,cancelled_at,closed_at,total_discounts,total_line_items_price,total_weight,source_name,browser_ip,buyer_accepts_marketing,token,cart_token,checkout_token,test,landing_site_base_url,_fivetran_synced -2674098602081,71509c29301d2cc14e37ecb53f735608,021cb20b5c78751fc7ddc091b6b69b3e,TRUE,GBP,2.8,0,2.8,2020-09-11 19:35:42.000 ,2020-09-11 19:35:46.000 ,d1743fc58a1e4d78769eaac49994a994,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,3589760876641,,,4135,5135,paid,,2020-09-11 19:35:42.000 ,,,,,,2.8,5.6,0,294517,,TRUE,0f9c2880de17f71511eee5542c29b999,,,FALSE,,2020-09-12 00:15:10.199 -2669516488801,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,2.8,0,3.79,2020-09-09 23:01:54.000 ,2020-09-10 15:38:26.000 ,4fcb884b5b46413bae526a6e7e49d706,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4066,5066,paid,fulfilled,2020-09-09 23:01:53.000 ,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:26.000 ,0,2.8,0,web,109.249.185.68,FALSE,fb489b3ccc0ae36ce47744d7595e9746,b1ff04883dfeab658cd5211050476729,7bdb994e1196de3e4f34586e357613f9,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.536 -2669509541985,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,4.4,0,5.39,2020-09-09 22:57:51.000 ,2020-09-10 15:38:25.000 ,9e346f2e912c60e16679f4a4c8d29422,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4065,5065,paid,fulfilled,2020-09-09 22:57:50.000 ,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:25.000 ,0,4.4,0,web,109.249.185.68,FALSE,e44b7f04610a8f4032530cc7f12663de,9600543f4d4613db59ac58a1009ecbb9,cf0a9fe2c7c606b86559007dbb890a62,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.037 \ No newline at end of file +id,note,email,taxes_included,currency,subtotal_price,total_tax,total_price,created_at,updated_at,name,shipping_address_name,shipping_address_first_name,shipping_address_last_name,shipping_address_company,shipping_address_phone,shipping_address_address_1,shipping_address_address_2,shipping_address_city,shipping_address_country,shipping_address_country_code,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_address_latitude,shipping_address_longitude,billing_address_name,billing_address_first_name,billing_address_last_name,billing_address_company,billing_address_phone,billing_address_address_1,billing_address_address_2,billing_address_city,billing_address_country,billing_address_country_code,billing_address_province,billing_address_province_code,billing_address_zip,billing_address_latitude,billing_address_longitude,customer_id,location_id,user_id,number,order_number,financial_status,fulfillment_status,processed_at,processing_method,referring_site,cancel_reason,cancelled_at,closed_at,total_discounts,total_line_items_price,total_weight,source_name,browser_ip,buyer_accepts_marketing,token,cart_token,checkout_token,test,landing_site_base_url,_fivetran_synced, total_shipping_price_set +2674098602081,71509c29301d2cc14e37ecb53f735608,021cb20b5c78751fc7ddc091b6b69b3e,TRUE,GBP,2.8,0,2.8,2020-09-11 19:35:42.000 ,2020-09-11 19:35:46.000 ,d1743fc58a1e4d78769eaac49994a994,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,3589760876641,,,4135,5135,paid,,2020-09-11 19:35:42.000 ,,,,,,2.8,5.6,0,294517,,TRUE,0f9c2880de17f71511eee5542c29b999,,,FALSE,,2020-09-12 00:15:10.199,one +2669516488801,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,2.8,0,3.79,2020-09-09 23:01:54.000 ,2020-09-10 15:38:26.000 ,4fcb884b5b46413bae526a6e7e49d706,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4066,5066,paid,fulfilled,2020-09-09 23:01:53.000 ,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:26.000 ,0,2.8,0,web,109.249.185.68,FALSE,fb489b3ccc0ae36ce47744d7595e9746,b1ff04883dfeab658cd5211050476729,7bdb994e1196de3e4f34586e357613f9,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.536,one +2669509541985,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,4.4,0,5.39,2020-09-09 22:57:51.000 ,2020-09-10 15:38:25.000 ,9e346f2e912c60e16679f4a4c8d29422,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4065,5065,paid,fulfilled,2020-09-09 22:57:50.000 ,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:25.000 ,0,4.4,0,web,109.249.185.68,FALSE,e44b7f04610a8f4032530cc7f12663de,9600543f4d4613db59ac58a1009ecbb9,cf0a9fe2c7c606b86559007dbb890a62,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.037,one \ No newline at end of file From 22a5012769d53f3a5509bca370475e42019f3c57 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Wed, 18 May 2022 13:57:11 -0700 Subject: [PATCH 011/137] try order table fix --- integration_tests/dbt_project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index fd89112..73bb5c8 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -8,7 +8,7 @@ vars: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" shopify_order_line_identifier: "shopify_order_line_data" - shopify_order_identifier: "shopify_order_data" + shopify_order_identifier: "{{ ref('shopify_order_data') }}" shopify_product_identifier: "shopify_product_data" shopify_order_adjustment_identifier: "shopify_order_adjustment_data" shopify_product_variant_identifier: "shopify_product_variant_data" From 487da60fe4b42d2d1b76c8b66521fd3b1bae46ed Mon Sep 17 00:00:00 2001 From: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> Date: Wed, 18 May 2022 16:57:53 -0500 Subject: [PATCH 012/137] Update dbt_project.yml --- integration_tests/dbt_project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 73bb5c8..e98d918 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -8,7 +8,7 @@ vars: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" shopify_order_line_identifier: "shopify_order_line_data" - shopify_order_identifier: "{{ ref('shopify_order_data') }}" + order: "{{ ref('shopify_order_data') }}" shopify_product_identifier: "shopify_product_data" shopify_order_adjustment_identifier: "shopify_order_adjustment_data" shopify_product_variant_identifier: "shopify_product_variant_data" From 3c2b17aae0a6ac40a42c83845ff60137d2ffebe4 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Wed, 18 May 2022 14:59:35 -0700 Subject: [PATCH 013/137] fix --- integration_tests/dbt_project.yml | 2 +- models/src_shopify.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 73bb5c8..523a2e1 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -8,7 +8,7 @@ vars: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" shopify_order_line_identifier: "shopify_order_line_data" - shopify_order_identifier: "{{ ref('shopify_order_data') }}" + order_source: "{{ ref('shopify_order_data') }}" shopify_product_identifier: "shopify_product_data" shopify_order_adjustment_identifier: "shopify_order_adjustment_data" shopify_product_variant_identifier: "shopify_product_variant_data" diff --git a/models/src_shopify.yml b/models/src_shopify.yml index e2ba1fe..6e7ee4e 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -7,7 +7,6 @@ sources: tables: - name: order description: Each record represents an order in Shopify. - identifier: "{%- if target.type == 'snowflake' -%} {{var('shopify_order_identifier', 'ORDER') }} {%- else -%} {{ var('shopify_order_identifier', 'order') }} {%- endif -%}" quoting: identifier: true columns: From 79544d913a414b88dd7faa8cde59171174c0d7cc Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Wed, 18 May 2022 15:27:16 -0700 Subject: [PATCH 014/137] new schema --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index bfcc85a..b7b35fb 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,7 +16,7 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 postgres: type: postgres @@ -25,14 +25,14 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 bigquery: type: bigquery method: service-account keyfile: "{{ env_var('GCLOUD_SERVICE_KEY_PATH') }}" project: 'dbt-package-testing' - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 snowflake: type: snowflake @@ -42,12 +42,12 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 spark: type: spark method: http - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 host: "{{ env_var('CI_SPARK_DBT_HOST') }}" organization: "{{ env_var('CI_SPARK_DBT_ORGANIZATION') }}" token: "{{ env_var('CI_SPARK_DBT_TOKEN') }}" diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 523a2e1..48ec16f 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -14,7 +14,7 @@ vars: shopify_product_variant_identifier: "shopify_product_variant_data" shopify_refund_identifier: "shopify_refund_data" shopify_transaction_identifier: "shopify_transaction_data" - shopify_schema: shopify_source_integration_tests + shopify_schema: shopify_source_integration_tests_1 dispatch: - macro_namespace: dbt_utils From 613acfff383b538dd9613bb78765c6f4cd4f7602 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Wed, 18 May 2022 15:48:45 -0700 Subject: [PATCH 015/137] fix order data --- integration_tests/seeds/shopify_order_data.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/seeds/shopify_order_data.csv b/integration_tests/seeds/shopify_order_data.csv index e082060..319131e 100644 --- a/integration_tests/seeds/shopify_order_data.csv +++ b/integration_tests/seeds/shopify_order_data.csv @@ -1,4 +1,4 @@ -id,note,email,taxes_included,currency,subtotal_price,total_tax,total_price,created_at,updated_at,name,shipping_address_name,shipping_address_first_name,shipping_address_last_name,shipping_address_company,shipping_address_phone,shipping_address_address_1,shipping_address_address_2,shipping_address_city,shipping_address_country,shipping_address_country_code,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_address_latitude,shipping_address_longitude,billing_address_name,billing_address_first_name,billing_address_last_name,billing_address_company,billing_address_phone,billing_address_address_1,billing_address_address_2,billing_address_city,billing_address_country,billing_address_country_code,billing_address_province,billing_address_province_code,billing_address_zip,billing_address_latitude,billing_address_longitude,customer_id,location_id,user_id,number,order_number,financial_status,fulfillment_status,processed_at,processing_method,referring_site,cancel_reason,cancelled_at,closed_at,total_discounts,total_line_items_price,total_weight,source_name,browser_ip,buyer_accepts_marketing,token,cart_token,checkout_token,test,landing_site_base_url,_fivetran_synced, total_shipping_price_set +id,note,email,taxes_included,currency,subtotal_price,total_tax,total_price,created_at,updated_at,name,shipping_address_name,shipping_address_first_name,shipping_address_last_name,shipping_address_company,shipping_address_phone,shipping_address_address_1,shipping_address_address_2,shipping_address_city,shipping_address_country,shipping_address_country_code,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_address_latitude,shipping_address_longitude,billing_address_name,billing_address_first_name,billing_address_last_name,billing_address_company,billing_address_phone,billing_address_address_1,billing_address_address_2,billing_address_city,billing_address_country,billing_address_country_code,billing_address_province,billing_address_province_code,billing_address_zip,billing_address_latitude,billing_address_longitude,customer_id,location_id,user_id,number,order_number,financial_status,fulfillment_status,processed_at,processing_method,referring_site,cancel_reason,cancelled_at,closed_at,total_discounts,total_line_items_price,total_weight,source_name,browser_ip,buyer_accepts_marketing,token,cart_token,checkout_token,test,landing_site_base_url,_fivetran_synced,total_shipping_price_set 2674098602081,71509c29301d2cc14e37ecb53f735608,021cb20b5c78751fc7ddc091b6b69b3e,TRUE,GBP,2.8,0,2.8,2020-09-11 19:35:42.000 ,2020-09-11 19:35:46.000 ,d1743fc58a1e4d78769eaac49994a994,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,3589760876641,,,4135,5135,paid,,2020-09-11 19:35:42.000 ,,,,,,2.8,5.6,0,294517,,TRUE,0f9c2880de17f71511eee5542c29b999,,,FALSE,,2020-09-12 00:15:10.199,one 2669516488801,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,2.8,0,3.79,2020-09-09 23:01:54.000 ,2020-09-10 15:38:26.000 ,4fcb884b5b46413bae526a6e7e49d706,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4066,5066,paid,fulfilled,2020-09-09 23:01:53.000 ,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:26.000 ,0,2.8,0,web,109.249.185.68,FALSE,fb489b3ccc0ae36ce47744d7595e9746,b1ff04883dfeab658cd5211050476729,7bdb994e1196de3e4f34586e357613f9,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.536,one 2669509541985,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,4.4,0,5.39,2020-09-09 22:57:51.000 ,2020-09-10 15:38:25.000 ,9e346f2e912c60e16679f4a4c8d29422,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4065,5065,paid,fulfilled,2020-09-09 22:57:50.000 ,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:25.000 ,0,4.4,0,web,109.249.185.68,FALSE,e44b7f04610a8f4032530cc7f12663de,9600543f4d4613db59ac58a1009ecbb9,cf0a9fe2c7c606b86559007dbb890a62,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.037,one \ No newline at end of file From f891ed480be01cc61e567f09f787f46b589458e5 Mon Sep 17 00:00:00 2001 From: Renee Li <91097070+fivetran-reneeli@users.noreply.github.com> Date: Thu, 19 May 2022 09:52:48 -0700 Subject: [PATCH 016/137] Update CHANGELOG.md Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aabf172..a49a41d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # dbt_shopify_source v0.7.0 -🎉 Applying Package Standardization 🎉 -We are applying standardization updates to be more consistent across our documentation. +## 🎉 Documentation and Feature Updates +- Updated README documentation updates for easier navigation and setup of the dbt package +- Included `shopify_[source_table_name]_identifier` variable for additional flexibility within the package when source tables are named differently. # dbt_shopify_source v0.6.0 🎉 dbt v1.0.0 Compatibility 🎉 ## 🚨 Breaking Changes 🚨 From 6d52968c4ad33b5e5029edf7f767870a072d4a2b Mon Sep 17 00:00:00 2001 From: Renee Li <91097070+fivetran-reneeli@users.noreply.github.com> Date: Thu, 19 May 2022 09:52:53 -0700 Subject: [PATCH 017/137] Update README.md Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a58e722..3efad46 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,6 @@ A small team of analytics engineers at Fivetran develops these dbt packages. How We highly encourage and welcome contributions to this package. Check out [this dbt Discourse article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) to learn how to contribute to a dbt package! # 🏪 Are there any resources available? -- If you have questions or want to reach out for help, please refer to the [GitHub Issue](https://github.com/fivetran/dbt_jira_source/issues/new/choose) section to find the right avenue of support for you. +- If you have questions or want to reach out for help, please refer to the [GitHub Issue](https://github.com/fivetran/dbt_shopify_source/issues/new/choose) section to find the right avenue of support for you. - If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our [Feedback Form](https://www.surveymonkey.com/r/DQ7K7WW). - Have questions or want to just say hi? Book a time during our office hours [on Calendly](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) or email us at solutions@fivetran.com. From 71847f05e55ec945e267658c91b5391427ac3236 Mon Sep 17 00:00:00 2001 From: Renee Li <91097070+fivetran-reneeli@users.noreply.github.com> Date: Thu, 19 May 2022 09:52:57 -0700 Subject: [PATCH 018/137] Update README.md Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3efad46..ec34f0c 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ packages: # 🙌 How is this package maintained and can I contribute? ## Package Maintenance -The Fivetran team maintaining this package _only_ maintains the latest version of the package. We highly recommend that you stay consistent with the [latest version](https://hub.getdbt.com/fivetran/jira_source/latest/) of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_jira_source/blob/main/CHANGELOG.md) and release notes for more information on changes across versions. +The Fivetran team maintaining this package _only_ maintains the latest version of the package. We highly recommend that you stay consistent with the [latest version](https://hub.getdbt.com/fivetran/shopify_source/latest/) of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_shopify_source/blob/main/CHANGELOG.md) and release notes for more information on changes across versions. ## Contributions A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions! From 72f4f373fce1698bac49ec450d4927c815cc07a5 Mon Sep 17 00:00:00 2001 From: fivetran-reneeli Date: Thu, 19 May 2022 15:47:56 -0700 Subject: [PATCH 019/137] docs --- docs/catalog.json | 2 +- docs/index.html | 32 ++++++++++++++++---------------- docs/manifest.json | 2 +- docs/run_results.json | 1 - 4 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 docs/run_results.json diff --git a/docs/catalog.json b/docs/catalog.json index 85496e4..e782e79 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-05-10T15:49:40.937225Z", "invocation_id": "25205f8f-a888-421f-a470-c817bc340294", "env": {}}, "nodes": {"model.shopify_source.stg_shopify__product_variant": {"metadata": {"type": "table", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__product_variant", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"variant_id": {"type": "INT64", "index": 1, "name": "variant_id", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_timestamp": {"type": "STRING", "index": 3, "name": "created_timestamp", "comment": null}, "updated_timestamp": {"type": "STRING", "index": 4, "name": "updated_timestamp", "comment": null}, "product_id": {"type": "INT64", "index": 5, "name": "product_id", "comment": null}, "inventory_item_id": {"type": "INT64", "index": 6, "name": "inventory_item_id", "comment": null}, "image_id": {"type": "INT64", "index": 7, "name": "image_id", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "price": {"type": "INT64", "index": 9, "name": "price", "comment": null}, "sku": {"type": "INT64", "index": 10, "name": "sku", "comment": null}, "position": {"type": "INT64", "index": 11, "name": "position", "comment": null}, "inventory_policy": {"type": "STRING", "index": 12, "name": "inventory_policy", "comment": null}, "compare_at_price": {"type": "INT64", "index": 13, "name": "compare_at_price", "comment": null}, "fulfillment_service": {"type": "STRING", "index": 14, "name": "fulfillment_service", "comment": null}, "inventory_management": {"type": "STRING", "index": 15, "name": "inventory_management", "comment": null}, "is_taxable": {"type": "BOOL", "index": 16, "name": "is_taxable", "comment": null}, "barcode": {"type": "INT64", "index": 17, "name": "barcode", "comment": null}, "grams": {"type": "INT64", "index": 18, "name": "grams", "comment": null}, "inventory_quantity": {"type": "INT64", "index": 19, "name": "inventory_quantity", "comment": null}, "weight": {"type": "INT64", "index": 20, "name": "weight", "comment": null}, "weight_unit": {"type": "STRING", "index": 21, "name": "weight_unit", "comment": null}, "option_1": {"type": "STRING", "index": 22, "name": "option_1", "comment": null}, "option_2": {"type": "INT64", "index": 23, "name": "option_2", "comment": null}, "option_3": {"type": "INT64", "index": 24, "name": "option_3", "comment": null}, "tax_code": {"type": "STRING", "index": 25, "name": "tax_code", "comment": null}, "old_inventory_quantity": {"type": "INT64", "index": 26, "name": "old_inventory_quantity", "comment": null}, "is_requiring_shipping": {"type": "BOOL", "index": 27, "name": "is_requiring_shipping", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1123.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.shopify_source.stg_shopify__product_variant"}, "model.shopify_source.stg_shopify__customer_tmp": {"metadata": {"type": "view", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__customer_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "STRING", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "STRING", "index": 3, "name": "last_name", "comment": null}, "email": {"type": "STRING", "index": 4, "name": "email", "comment": null}, "phone": {"type": "INT64", "index": 5, "name": "phone", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "orders_count": {"type": "INT64", "index": 7, "name": "orders_count", "comment": null}, "total_spent": {"type": "FLOAT64", "index": 8, "name": "total_spent", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 10, "name": "updated_at", "comment": null}, "accepts_marketing": {"type": "BOOL", "index": 11, "name": "accepts_marketing", "comment": null}, "tax_exempt": {"type": "BOOL", "index": 12, "name": "tax_exempt", "comment": null}, "verified_email": {"type": "BOOL", "index": 13, "name": "verified_email", "comment": null}, "default_address_id": {"type": "INT64", "index": 14, "name": "default_address_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 15, "name": "_fivetran_synced", "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.shopify_source.stg_shopify__customer_tmp"}, "model.shopify_source.stg_shopify__customer": {"metadata": {"type": "table", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__customer", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"_fivetran_synced": {"type": "TIMESTAMP", "index": 1, "name": "_fivetran_synced", "comment": null}, "has_accepted_marketing": {"type": "BOOL", "index": 2, "name": "has_accepted_marketing", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "created_timestamp", "comment": null}, "default_address_id": {"type": "INT64", "index": 4, "name": "default_address_id", "comment": null}, "email": {"type": "STRING", "index": 5, "name": "email", "comment": null}, "first_name": {"type": "STRING", "index": 6, "name": "first_name", "comment": null}, "customer_id": {"type": "INT64", "index": 7, "name": "customer_id", "comment": null}, "last_name": {"type": "STRING", "index": 8, "name": "last_name", "comment": null}, "orders_count": {"type": "INT64", "index": 9, "name": "orders_count", "comment": null}, "phone": {"type": "INT64", "index": 10, "name": "phone", "comment": null}, "account_state": {"type": "STRING", "index": 11, "name": "account_state", "comment": null}, "is_tax_exempt": {"type": "BOOL", "index": 12, "name": "is_tax_exempt", "comment": null}, "total_spent": {"type": "FLOAT64", "index": 13, "name": "total_spent", "comment": null}, "updated_timestamp": {"type": "TIMESTAMP", "index": 14, "name": "updated_timestamp", "comment": null}, "is_verified_email": {"type": "BOOL", "index": 15, "name": "is_verified_email", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 512.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.shopify_source.stg_shopify__customer"}, "model.shopify_source.stg_shopify__order": {"metadata": {"type": "table", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__order", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"_fivetran_synced": {"type": "TIMESTAMP", "index": 1, "name": "_fivetran_synced", "comment": null}, "billing_address_address_1": {"type": "STRING", "index": 2, "name": "billing_address_address_1", "comment": null}, "billing_address_address_2": {"type": "STRING", "index": 3, "name": "billing_address_address_2", "comment": null}, "billing_address_city": {"type": "STRING", "index": 4, "name": "billing_address_city", "comment": null}, "billing_address_company": {"type": "STRING", "index": 5, "name": "billing_address_company", "comment": null}, "billing_address_country": {"type": "STRING", "index": 6, "name": "billing_address_country", "comment": null}, "billing_address_country_code": {"type": "STRING", "index": 7, "name": "billing_address_country_code", "comment": null}, "billing_address_first_name": {"type": "STRING", "index": 8, "name": "billing_address_first_name", "comment": null}, "billing_address_last_name": {"type": "STRING", "index": 9, "name": "billing_address_last_name", "comment": null}, "billing_address_latitude": {"type": "STRING", "index": 10, "name": "billing_address_latitude", "comment": null}, "billing_address_longitude": {"type": "STRING", "index": 11, "name": "billing_address_longitude", "comment": null}, "billing_address_name": {"type": "STRING", "index": 12, "name": "billing_address_name", "comment": null}, "billing_address_phone": {"type": "STRING", "index": 13, "name": "billing_address_phone", "comment": null}, "billing_address_province": {"type": "STRING", "index": 14, "name": "billing_address_province", "comment": null}, "billing_address_province_code": {"type": "INT64", "index": 15, "name": "billing_address_province_code", "comment": null}, "billing_address_zip": {"type": "STRING", "index": 16, "name": "billing_address_zip", "comment": null}, "browser_ip": {"type": "STRING", "index": 17, "name": "browser_ip", "comment": null}, "has_buyer_accepted_marketing": {"type": "BOOL", "index": 18, "name": "has_buyer_accepted_marketing", "comment": null}, "cancel_reason": {"type": "INT64", "index": 19, "name": "cancel_reason", "comment": null}, "cancelled_timestamp": {"type": "TIMESTAMP", "index": 20, "name": "cancelled_timestamp", "comment": null}, "cart_token": {"type": "STRING", "index": 21, "name": "cart_token", "comment": null}, "checkout_token": {"type": "STRING", "index": 22, "name": "checkout_token", "comment": null}, "closed_timestamp": {"type": "STRING", "index": 23, "name": "closed_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 24, "name": "created_timestamp", "comment": null}, "currency": {"type": "STRING", "index": 25, "name": "currency", "comment": null}, "customer_id": {"type": "INT64", "index": 26, "name": "customer_id", "comment": null}, "email": {"type": "STRING", "index": 27, "name": "email", "comment": null}, "financial_status": {"type": "STRING", "index": 28, "name": "financial_status", "comment": null}, "fulfillment_status": {"type": "STRING", "index": 29, "name": "fulfillment_status", "comment": null}, "order_id": {"type": "INT64", "index": 30, "name": "order_id", "comment": null}, "landing_site_base_url": {"type": "STRING", "index": 31, "name": "landing_site_base_url", "comment": null}, "location_id": {"type": "INT64", "index": 32, "name": "location_id", "comment": null}, "name": {"type": "STRING", "index": 33, "name": "name", "comment": null}, "note": {"type": "STRING", "index": 34, "name": "note", "comment": null}, "number": {"type": "INT64", "index": 35, "name": "number", "comment": null}, "order_number": {"type": "INT64", "index": 36, "name": "order_number", "comment": null}, "processed_timestamp": {"type": "TIMESTAMP", "index": 37, "name": "processed_timestamp", "comment": null}, "processing_method": {"type": "STRING", "index": 38, "name": "processing_method", "comment": null}, "referring_site": {"type": "STRING", "index": 39, "name": "referring_site", "comment": null}, "total_shipping_price_set": {"type": "STRING", "index": 40, "name": "total_shipping_price_set", "comment": null}, "shipping_address_address_1": {"type": "STRING", "index": 41, "name": "shipping_address_address_1", "comment": null}, "shipping_address_address_2": {"type": "STRING", "index": 42, "name": "shipping_address_address_2", "comment": null}, "shipping_address_city": {"type": "STRING", "index": 43, "name": "shipping_address_city", "comment": null}, "shipping_address_company": {"type": "STRING", "index": 44, "name": "shipping_address_company", "comment": null}, "shipping_address_country": {"type": "STRING", "index": 45, "name": "shipping_address_country", "comment": null}, "shipping_address_country_code": {"type": "STRING", "index": 46, "name": "shipping_address_country_code", "comment": null}, "shipping_address_first_name": {"type": "STRING", "index": 47, "name": "shipping_address_first_name", "comment": null}, "shipping_address_last_name": {"type": "STRING", "index": 48, "name": "shipping_address_last_name", "comment": null}, "shipping_address_latitude": {"type": "STRING", "index": 49, "name": "shipping_address_latitude", "comment": null}, "shipping_address_longitude": {"type": "STRING", "index": 50, "name": "shipping_address_longitude", "comment": null}, "shipping_address_name": {"type": "STRING", "index": 51, "name": "shipping_address_name", "comment": null}, "shipping_address_phone": {"type": "STRING", "index": 52, "name": "shipping_address_phone", "comment": null}, "shipping_address_province": {"type": "STRING", "index": 53, "name": "shipping_address_province", "comment": null}, "shipping_address_province_code": {"type": "INT64", "index": 54, "name": "shipping_address_province_code", "comment": null}, "shipping_address_zip": {"type": "STRING", "index": 55, "name": "shipping_address_zip", "comment": null}, "source_name": {"type": "STRING", "index": 56, "name": "source_name", "comment": null}, "subtotal_price": {"type": "FLOAT64", "index": 57, "name": "subtotal_price", "comment": null}, "has_taxes_included": {"type": "BOOL", "index": 58, "name": "has_taxes_included", "comment": null}, "is_test_order": {"type": "BOOL", "index": 59, "name": "is_test_order", "comment": null}, "token": {"type": "STRING", "index": 60, "name": "token", "comment": null}, "total_discounts": {"type": "FLOAT64", "index": 61, "name": "total_discounts", "comment": null}, "total_line_items_price": {"type": "FLOAT64", "index": 62, "name": "total_line_items_price", "comment": null}, "total_price": {"type": "FLOAT64", "index": 63, "name": "total_price", "comment": null}, "total_tax": {"type": "INT64", "index": 64, "name": "total_tax", "comment": null}, "total_weight": {"type": "INT64", "index": 65, "name": "total_weight", "comment": null}, "updated_timestamp": {"type": "TIMESTAMP", "index": 66, "name": "updated_timestamp", "comment": null}, "user_id": {"type": "INT64", "index": 67, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3850.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.shopify_source.stg_shopify__order"}, "model.shopify_source.stg_shopify__refund": {"metadata": {"type": "table", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__refund", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"_fivetran_synced": {"type": "STRING", "index": 1, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "STRING", "index": 2, "name": "created_at", "comment": null}, "refund_id": {"type": "INT64", "index": 3, "name": "refund_id", "comment": null}, "note": {"type": "STRING", "index": 4, "name": "note", "comment": null}, "order_id": {"type": "INT64", "index": 5, "name": "order_id", "comment": null}, "processed_at": {"type": "STRING", "index": 6, "name": "processed_at", "comment": null}, "restock": {"type": "BOOL", "index": 7, "name": "restock", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 606.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.shopify_source.stg_shopify__refund"}, "model.shopify_source.stg_shopify__order_line_refund": {"metadata": {"type": "table", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__order_line_refund", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"_fivetran_synced": {"type": "TIMESTAMP", "index": 1, "name": "_fivetran_synced", "comment": null}, "order_line_refund_id": {"type": "INT64", "index": 2, "name": "order_line_refund_id", "comment": null}, "location_id": {"type": "INT64", "index": 3, "name": "location_id", "comment": null}, "order_line_id": {"type": "INT64", "index": 4, "name": "order_line_id", "comment": null}, "subtotal": {"type": "INT64", "index": 5, "name": "subtotal", "comment": null}, "total_tax": {"type": "FLOAT64", "index": 6, "name": "total_tax", "comment": null}, "quantity": {"type": "INT64", "index": 7, "name": "quantity", "comment": null}, "refund_id": {"type": "INT64", "index": 8, "name": "refund_id", "comment": null}, "restock_type": {"type": "STRING", "index": 9, "name": "restock_type", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 352.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.shopify_source.stg_shopify__order_line_refund"}, "model.shopify_source.stg_shopify__product_tmp": {"metadata": {"type": "view", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__product_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "title": {"type": "STRING", "index": 2, "name": "title", "comment": null}, "handle": {"type": "STRING", "index": 3, "name": "handle", "comment": null}, "product_type": {"type": "STRING", "index": 4, "name": "product_type", "comment": null}, "vendor": {"type": "STRING", "index": 5, "name": "vendor", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 7, "name": "updated_at", "comment": null}, "published_at": {"type": "TIMESTAMP", "index": 8, "name": "published_at", "comment": null}, "published_scope": {"type": "STRING", "index": 9, "name": "published_scope", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 10, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 11, "name": "_fivetran_synced", "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.shopify_source.stg_shopify__product_tmp"}, "model.shopify_source.stg_shopify__product": {"metadata": {"type": "table", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__product", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"_fivetran_deleted": {"type": "BOOL", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "created_timestamp", "comment": null}, "handle": {"type": "STRING", "index": 4, "name": "handle", "comment": null}, "product_id": {"type": "INT64", "index": 5, "name": "product_id", "comment": null}, "product_type": {"type": "STRING", "index": 6, "name": "product_type", "comment": null}, "published_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "published_timestamp", "comment": null}, "published_scope": {"type": "STRING", "index": 8, "name": "published_scope", "comment": null}, "title": {"type": "STRING", "index": 9, "name": "title", "comment": null}, "updated_timestamp": {"type": "TIMESTAMP", "index": 10, "name": "updated_timestamp", "comment": null}, "vendor": {"type": "STRING", "index": 11, "name": "vendor", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 549.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.shopify_source.stg_shopify__product"}, "model.shopify_source.stg_shopify__product_variant_tmp": {"metadata": {"type": "view", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__product_variant_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "product_id": {"type": "INT64", "index": 2, "name": "product_id", "comment": null}, "inventory_item_id": {"type": "INT64", "index": 3, "name": "inventory_item_id", "comment": null}, "title": {"type": "STRING", "index": 4, "name": "title", "comment": null}, "price": {"type": "INT64", "index": 5, "name": "price", "comment": null}, "sku": {"type": "INT64", "index": 6, "name": "sku", "comment": null}, "position": {"type": "INT64", "index": 7, "name": "position", "comment": null}, "inventory_policy": {"type": "STRING", "index": 8, "name": "inventory_policy", "comment": null}, "compare_at_price": {"type": "INT64", "index": 9, "name": "compare_at_price", "comment": null}, "fulfillment_service": {"type": "STRING", "index": 10, "name": "fulfillment_service", "comment": null}, "inventory_management": {"type": "STRING", "index": 11, "name": "inventory_management", "comment": null}, "created_at": {"type": "STRING", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "STRING", "index": 13, "name": "updated_at", "comment": null}, "taxable": {"type": "BOOL", "index": 14, "name": "taxable", "comment": null}, "barcode": {"type": "INT64", "index": 15, "name": "barcode", "comment": null}, "grams": {"type": "INT64", "index": 16, "name": "grams", "comment": null}, "image_id": {"type": "INT64", "index": 17, "name": "image_id", "comment": null}, "inventory_quantity": {"type": "INT64", "index": 18, "name": "inventory_quantity", "comment": null}, "weight": {"type": "INT64", "index": 19, "name": "weight", "comment": null}, "weight_unit": {"type": "STRING", "index": 20, "name": "weight_unit", "comment": null}, "old_inventory_quantity": {"type": "INT64", "index": 21, "name": "old_inventory_quantity", "comment": null}, "requires_shipping": {"type": "BOOL", "index": 22, "name": "requires_shipping", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 23, "name": "_fivetran_synced", "comment": null}, "option_2": {"type": "INT64", "index": 24, "name": "option_2", "comment": null}, "tax_code": {"type": "STRING", "index": 25, "name": "tax_code", "comment": null}, "option_3": {"type": "INT64", "index": 26, "name": "option_3", "comment": null}, "option_1": {"type": "STRING", "index": 27, "name": "option_1", "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.shopify_source.stg_shopify__product_variant_tmp"}, "model.shopify_source.stg_shopify__order_line": {"metadata": {"type": "table", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__order_line", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"_fivetran_synced": {"type": "TIMESTAMP", "index": 1, "name": "_fivetran_synced", "comment": null}, "fulfillable_quantity": {"type": "INT64", "index": 2, "name": "fulfillable_quantity", "comment": null}, "fulfillment_service": {"type": "STRING", "index": 3, "name": "fulfillment_service", "comment": null}, "fulfillment_status": {"type": "STRING", "index": 4, "name": "fulfillment_status", "comment": null}, "is_gift_card": {"type": "BOOL", "index": 5, "name": "is_gift_card", "comment": null}, "grams": {"type": "INT64", "index": 6, "name": "grams", "comment": null}, "order_line_id": {"type": "INT64", "index": 7, "name": "order_line_id", "comment": null}, "index": {"type": "INT64", "index": 8, "name": "index", "comment": null}, "name": {"type": "STRING", "index": 9, "name": "name", "comment": null}, "order_id": {"type": "INT64", "index": 10, "name": "order_id", "comment": null}, "pre_tax_price": {"type": "INT64", "index": 11, "name": "pre_tax_price", "comment": null}, "price": {"type": "FLOAT64", "index": 12, "name": "price", "comment": null}, "product_id": {"type": "INT64", "index": 13, "name": "product_id", "comment": null}, "property_charge_interval_frequency": {"type": "NUMERIC", "index": 14, "name": "property_charge_interval_frequency", "comment": null}, "property_for_shipping_jan_3_rd_2020": {"type": "STRING", "index": 15, "name": "property_for_shipping_jan_3_rd_2020", "comment": null}, "property_shipping_interval_frequency": {"type": "NUMERIC", "index": 16, "name": "property_shipping_interval_frequency", "comment": null}, "property_shipping_interval_unit_type": {"type": "STRING", "index": 17, "name": "property_shipping_interval_unit_type", "comment": null}, "property_subscription_id": {"type": "NUMERIC", "index": 18, "name": "property_subscription_id", "comment": null}, "quantity": {"type": "INT64", "index": 19, "name": "quantity", "comment": null}, "is_requiring_shipping": {"type": "BOOL", "index": 20, "name": "is_requiring_shipping", "comment": null}, "sku": {"type": "STRING", "index": 21, "name": "sku", "comment": null}, "is_taxable": {"type": "BOOL", "index": 22, "name": "is_taxable", "comment": null}, "title": {"type": "STRING", "index": 23, "name": "title", "comment": null}, "total_discount": {"type": "INT64", "index": 24, "name": "total_discount", "comment": null}, "variant_id": {"type": "INT64", "index": 25, "name": "variant_id", "comment": null}, "vendor": {"type": "STRING", "index": 26, "name": "vendor", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 727.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.shopify_source.stg_shopify__order_line"}, "model.shopify_source.stg_shopify__order_line_tmp": {"metadata": {"type": "view", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__order_line_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INT64", "index": 1, "name": "order_id", "comment": null}, "id": {"type": "INT64", "index": 2, "name": "id", "comment": null}, "product_id": {"type": "INT64", "index": 3, "name": "product_id", "comment": null}, "variant_id": {"type": "INT64", "index": 4, "name": "variant_id", "comment": null}, "name": {"type": "STRING", "index": 5, "name": "name", "comment": null}, "title": {"type": "STRING", "index": 6, "name": "title", "comment": null}, "vendor": {"type": "STRING", "index": 7, "name": "vendor", "comment": null}, "price": {"type": "FLOAT64", "index": 8, "name": "price", "comment": null}, "quantity": {"type": "INT64", "index": 9, "name": "quantity", "comment": null}, "grams": {"type": "INT64", "index": 10, "name": "grams", "comment": null}, "sku": {"type": "STRING", "index": 11, "name": "sku", "comment": null}, "fulfillable_quantity": {"type": "INT64", "index": 12, "name": "fulfillable_quantity", "comment": null}, "fulfillment_service": {"type": "STRING", "index": 13, "name": "fulfillment_service", "comment": null}, "gift_card": {"type": "BOOL", "index": 14, "name": "gift_card", "comment": null}, "requires_shipping": {"type": "BOOL", "index": 15, "name": "requires_shipping", "comment": null}, "taxable": {"type": "BOOL", "index": 16, "name": "taxable", "comment": null}, "index": {"type": "INT64", "index": 17, "name": "index", "comment": null}, "total_discount": {"type": "INT64", "index": 18, "name": "total_discount", "comment": null}, "pre_tax_price": {"type": "INT64", "index": 19, "name": "pre_tax_price", "comment": null}, "fulfillment_status": {"type": "STRING", "index": 20, "name": "fulfillment_status", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 21, "name": "_fivetran_synced", "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.shopify_source.stg_shopify__order_line_tmp"}, "model.shopify_source.stg_shopify__order_tmp": {"metadata": {"type": "view", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__order_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "note": {"type": "STRING", "index": 2, "name": "note", "comment": null}, "email": {"type": "STRING", "index": 3, "name": "email", "comment": null}, "taxes_included": {"type": "BOOL", "index": 4, "name": "taxes_included", "comment": null}, "currency": {"type": "STRING", "index": 5, "name": "currency", "comment": null}, "subtotal_price": {"type": "FLOAT64", "index": 6, "name": "subtotal_price", "comment": null}, "total_tax": {"type": "INT64", "index": 7, "name": "total_tax", "comment": null}, "total_price": {"type": "FLOAT64", "index": 8, "name": "total_price", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 10, "name": "updated_at", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "shipping_address_name": {"type": "STRING", "index": 12, "name": "shipping_address_name", "comment": null}, "shipping_address_first_name": {"type": "STRING", "index": 13, "name": "shipping_address_first_name", "comment": null}, "shipping_address_last_name": {"type": "STRING", "index": 14, "name": "shipping_address_last_name", "comment": null}, "shipping_address_company": {"type": "STRING", "index": 15, "name": "shipping_address_company", "comment": null}, "shipping_address_phone": {"type": "STRING", "index": 16, "name": "shipping_address_phone", "comment": null}, "shipping_address_address_1": {"type": "STRING", "index": 17, "name": "shipping_address_address_1", "comment": null}, "shipping_address_address_2": {"type": "STRING", "index": 18, "name": "shipping_address_address_2", "comment": null}, "shipping_address_city": {"type": "STRING", "index": 19, "name": "shipping_address_city", "comment": null}, "shipping_address_country": {"type": "STRING", "index": 20, "name": "shipping_address_country", "comment": null}, "shipping_address_country_code": {"type": "STRING", "index": 21, "name": "shipping_address_country_code", "comment": null}, "shipping_address_province": {"type": "STRING", "index": 22, "name": "shipping_address_province", "comment": null}, "shipping_address_province_code": {"type": "INT64", "index": 23, "name": "shipping_address_province_code", "comment": null}, "shipping_address_zip": {"type": "STRING", "index": 24, "name": "shipping_address_zip", "comment": null}, "shipping_address_latitude": {"type": "STRING", "index": 25, "name": "shipping_address_latitude", "comment": null}, "shipping_address_longitude": {"type": "STRING", "index": 26, "name": "shipping_address_longitude", "comment": null}, "billing_address_name": {"type": "STRING", "index": 27, "name": "billing_address_name", "comment": null}, "billing_address_first_name": {"type": "STRING", "index": 28, "name": "billing_address_first_name", "comment": null}, "billing_address_last_name": {"type": "STRING", "index": 29, "name": "billing_address_last_name", "comment": null}, "billing_address_company": {"type": "STRING", "index": 30, "name": "billing_address_company", "comment": null}, "billing_address_phone": {"type": "STRING", "index": 31, "name": "billing_address_phone", "comment": null}, "billing_address_address_1": {"type": "STRING", "index": 32, "name": "billing_address_address_1", "comment": null}, "billing_address_address_2": {"type": "STRING", "index": 33, "name": "billing_address_address_2", "comment": null}, "billing_address_city": {"type": "STRING", "index": 34, "name": "billing_address_city", "comment": null}, "billing_address_country": {"type": "STRING", "index": 35, "name": "billing_address_country", "comment": null}, "billing_address_country_code": {"type": "STRING", "index": 36, "name": "billing_address_country_code", "comment": null}, "billing_address_province": {"type": "STRING", "index": 37, "name": "billing_address_province", "comment": null}, "billing_address_province_code": {"type": "INT64", "index": 38, "name": "billing_address_province_code", "comment": null}, "billing_address_zip": {"type": "STRING", "index": 39, "name": "billing_address_zip", "comment": null}, "billing_address_latitude": {"type": "STRING", "index": 40, "name": "billing_address_latitude", "comment": null}, "billing_address_longitude": {"type": "STRING", "index": 41, "name": "billing_address_longitude", "comment": null}, "customer_id": {"type": "INT64", "index": 42, "name": "customer_id", "comment": null}, "location_id": {"type": "INT64", "index": 43, "name": "location_id", "comment": null}, "user_id": {"type": "INT64", "index": 44, "name": "user_id", "comment": null}, "number": {"type": "INT64", "index": 45, "name": "number", "comment": null}, "order_number": {"type": "INT64", "index": 46, "name": "order_number", "comment": null}, "financial_status": {"type": "STRING", "index": 47, "name": "financial_status", "comment": null}, "fulfillment_status": {"type": "STRING", "index": 48, "name": "fulfillment_status", "comment": null}, "processed_at": {"type": "TIMESTAMP", "index": 49, "name": "processed_at", "comment": null}, "processing_method": {"type": "STRING", "index": 50, "name": "processing_method", "comment": null}, "referring_site": {"type": "STRING", "index": 51, "name": "referring_site", "comment": null}, "cancel_reason": {"type": "INT64", "index": 52, "name": "cancel_reason", "comment": null}, "cancelled_at": {"type": "TIMESTAMP", "index": 53, "name": "cancelled_at", "comment": null}, "closed_at": {"type": "STRING", "index": 54, "name": "closed_at", "comment": null}, "total_discounts": {"type": "FLOAT64", "index": 55, "name": "total_discounts", "comment": null}, "total_line_items_price": {"type": "FLOAT64", "index": 56, "name": "total_line_items_price", "comment": null}, "total_weight": {"type": "INT64", "index": 57, "name": "total_weight", "comment": null}, "source_name": {"type": "STRING", "index": 58, "name": "source_name", "comment": null}, "browser_ip": {"type": "STRING", "index": 59, "name": "browser_ip", "comment": null}, "buyer_accepts_marketing": {"type": "BOOL", "index": 60, "name": "buyer_accepts_marketing", "comment": null}, "token": {"type": "STRING", "index": 61, "name": "token", "comment": null}, "cart_token": {"type": "STRING", "index": 62, "name": "cart_token", "comment": null}, "checkout_token": {"type": "STRING", "index": 63, "name": "checkout_token", "comment": null}, "test": {"type": "BOOL", "index": 64, "name": "test", "comment": null}, "landing_site_base_url": {"type": "STRING", "index": 65, "name": "landing_site_base_url", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 66, "name": "_fivetran_synced", "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.shopify_source.stg_shopify__order_tmp"}, "model.shopify_source.stg_shopify__order_adjustment": {"metadata": {"type": "table", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__order_adjustment", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"order_adjustment_id": {"type": "INT64", "index": 1, "name": "order_adjustment_id", "comment": null}, "order_id": {"type": "INT64", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "INT64", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "INT64", "index": 4, "name": "amount", "comment": null}, "tax_amount": {"type": "FLOAT64", "index": 5, "name": "tax_amount", "comment": null}, "kind": {"type": "STRING", "index": 6, "name": "kind", "comment": null}, "reason": {"type": "STRING", "index": 7, "name": "reason", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 8, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 531.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.shopify_source.stg_shopify__order_adjustment"}, "model.shopify_source.stg_shopify__transaction": {"metadata": {"type": "table", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__transaction", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"transaction_id": {"type": "INT64", "index": 1, "name": "transaction_id", "comment": null}, "order_id": {"type": "INT64", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "INT64", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "FLOAT64", "index": 4, "name": "amount", "comment": null}, "created_timestamp": {"type": "STRING", "index": 5, "name": "created_timestamp", "comment": null}, "processed_timestamp": {"type": "STRING", "index": 6, "name": "processed_timestamp", "comment": null}, "device_id": {"type": "INT64", "index": 7, "name": "device_id", "comment": null}, "gateway": {"type": "STRING", "index": 8, "name": "gateway", "comment": null}, "source_name": {"type": "STRING", "index": 9, "name": "source_name", "comment": null}, "message": {"type": "STRING", "index": 10, "name": "message", "comment": null}, "currency": {"type": "STRING", "index": 11, "name": "currency", "comment": null}, "location_id": {"type": "INT64", "index": 12, "name": "location_id", "comment": null}, "parent_id": {"type": "INT64", "index": 13, "name": "parent_id", "comment": null}, "payment_avs_result_code": {"type": "STRING", "index": 14, "name": "payment_avs_result_code", "comment": null}, "payment_credit_card_bin": {"type": "INT64", "index": 15, "name": "payment_credit_card_bin", "comment": null}, "payment_cvv_result_code": {"type": "INT64", "index": 16, "name": "payment_cvv_result_code", "comment": null}, "payment_credit_card_number": {"type": "INT64", "index": 17, "name": "payment_credit_card_number", "comment": null}, "payment_credit_card_company": {"type": "INT64", "index": 18, "name": "payment_credit_card_company", "comment": null}, "kind": {"type": "STRING", "index": 19, "name": "kind", "comment": null}, "receipt": {"type": "INT64", "index": 20, "name": "receipt", "comment": null}, "currency_exchange_id": {"type": "INT64", "index": 21, "name": "currency_exchange_id", "comment": null}, "currency_exchange_adjustment": {"type": "INT64", "index": 22, "name": "currency_exchange_adjustment", "comment": null}, "currency_exchange_original_amount": {"type": "INT64", "index": 23, "name": "currency_exchange_original_amount", "comment": null}, "currency_exchange_final_amount": {"type": "INT64", "index": 24, "name": "currency_exchange_final_amount", "comment": null}, "currency_exchange_currency": {"type": "INT64", "index": 25, "name": "currency_exchange_currency", "comment": null}, "error_code": {"type": "INT64", "index": 26, "name": "error_code", "comment": null}, "status": {"type": "STRING", "index": 27, "name": "status", "comment": null}, "test": {"type": "BOOL", "index": 28, "name": "test", "comment": null}, "user_id": {"type": "INT64", "index": 29, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 30, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 904.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.shopify_source.stg_shopify__transaction"}, "model.shopify_source.stg_shopify__transaction_tmp": {"metadata": {"type": "view", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__transaction_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INT64", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "INT64", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "FLOAT64", "index": 4, "name": "amount", "comment": null}, "authorization": {"type": "STRING", "index": 5, "name": "authorization", "comment": null}, "created_at": {"type": "STRING", "index": 6, "name": "created_at", "comment": null}, "processed_at": {"type": "STRING", "index": 7, "name": "processed_at", "comment": null}, "device_id": {"type": "INT64", "index": 8, "name": "device_id", "comment": null}, "gateway": {"type": "STRING", "index": 9, "name": "gateway", "comment": null}, "source_name": {"type": "STRING", "index": 10, "name": "source_name", "comment": null}, "message": {"type": "STRING", "index": 11, "name": "message", "comment": null}, "currency": {"type": "STRING", "index": 12, "name": "currency", "comment": null}, "location_id": {"type": "INT64", "index": 13, "name": "location_id", "comment": null}, "parent_id": {"type": "INT64", "index": 14, "name": "parent_id", "comment": null}, "payment_avs_result_code": {"type": "STRING", "index": 15, "name": "payment_avs_result_code", "comment": null}, "kind": {"type": "STRING", "index": 16, "name": "kind", "comment": null}, "currency_exchange_id": {"type": "INT64", "index": 17, "name": "currency_exchange_id", "comment": null}, "currency_exchange_adjustment": {"type": "INT64", "index": 18, "name": "currency_exchange_adjustment", "comment": null}, "currency_exchange_original_amount": {"type": "INT64", "index": 19, "name": "currency_exchange_original_amount", "comment": null}, "currency_exchange_final_amount": {"type": "INT64", "index": 20, "name": "currency_exchange_final_amount", "comment": null}, "currency_exchange_currency": {"type": "INT64", "index": 21, "name": "currency_exchange_currency", "comment": null}, "error_code": {"type": "INT64", "index": 22, "name": "error_code", "comment": null}, "status": {"type": "STRING", "index": 23, "name": "status", "comment": null}, "test": {"type": "BOOL", "index": 24, "name": "test", "comment": null}, "user_id": {"type": "INT64", "index": 25, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 26, "name": "_fivetran_synced", "comment": null}, "payment_credit_card_bin": {"type": "INT64", "index": 27, "name": "payment_credit_card_bin", "comment": null}, "payment_cvv_result_code": {"type": "INT64", "index": 28, "name": "payment_cvv_result_code", "comment": null}, "payment_credit_card_number": {"type": "INT64", "index": 29, "name": "payment_credit_card_number", "comment": null}, "payment_credit_card_company": {"type": "INT64", "index": 30, "name": "payment_credit_card_company", "comment": null}, "receipt": {"type": "INT64", "index": 31, "name": "receipt", "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.shopify_source.stg_shopify__transaction_tmp"}, "model.shopify_source.stg_shopify__order_adjustment_tmp": {"metadata": {"type": "view", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__order_adjustment_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INT64", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "INT64", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "INT64", "index": 4, "name": "amount", "comment": null}, "tax_amount": {"type": "FLOAT64", "index": 5, "name": "tax_amount", "comment": null}, "kind": {"type": "STRING", "index": 6, "name": "kind", "comment": null}, "reason": {"type": "STRING", "index": 7, "name": "reason", "comment": null}, "amount_set": {"type": "INT64", "index": 8, "name": "amount_set", "comment": null}, "tax_amount_set": {"type": "INT64", "index": 9, "name": "tax_amount_set", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 10, "name": "_fivetran_synced", "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.shopify_source.stg_shopify__order_adjustment_tmp"}, "model.shopify_source.stg_shopify__order_line_refund_tmp": {"metadata": {"type": "view", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__order_line_refund_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "location_id": {"type": "INT64", "index": 2, "name": "location_id", "comment": null}, "refund_id": {"type": "INT64", "index": 3, "name": "refund_id", "comment": null}, "restock_type": {"type": "STRING", "index": 4, "name": "restock_type", "comment": null}, "quantity": {"type": "INT64", "index": 5, "name": "quantity", "comment": null}, "order_line_id": {"type": "INT64", "index": 6, "name": "order_line_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "subtotal": {"type": "INT64", "index": 8, "name": "subtotal", "comment": null}, "total_tax_set": {"type": "INT64", "index": 9, "name": "total_tax_set", "comment": null}, "subtotal_set": {"type": "INT64", "index": 10, "name": "subtotal_set", "comment": null}, "total_tax": {"type": "FLOAT64", "index": 11, "name": "total_tax", "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.shopify_source.stg_shopify__order_line_refund_tmp"}, "model.shopify_source.stg_shopify__refund_tmp": {"metadata": {"type": "view", "schema": "shopify_integration_tests_stg_shopify", "name": "stg_shopify__refund_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "STRING", "index": 2, "name": "created_at", "comment": null}, "processed_at": {"type": "STRING", "index": 3, "name": "processed_at", "comment": null}, "note": {"type": "STRING", "index": 4, "name": "note", "comment": null}, "restock": {"type": "BOOL", "index": 5, "name": "restock", "comment": null}, "user_id": {"type": "INT64", "index": 6, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 7, "name": "_fivetran_synced", "comment": null}, "total_duties_set": {"type": "INT64", "index": 8, "name": "total_duties_set", "comment": null}, "order_id": {"type": "INT64", "index": 9, "name": "order_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.shopify_source.stg_shopify__refund_tmp"}, "seed.shopify_source_integration_tests.shopify_customer_data": {"metadata": {"type": "table", "schema": "shopify_integration_tests", "name": "shopify_customer_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "STRING", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "STRING", "index": 3, "name": "last_name", "comment": null}, "email": {"type": "STRING", "index": 4, "name": "email", "comment": null}, "phone": {"type": "INT64", "index": 5, "name": "phone", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "orders_count": {"type": "INT64", "index": 7, "name": "orders_count", "comment": null}, "total_spent": {"type": "FLOAT64", "index": 8, "name": "total_spent", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 10, "name": "updated_at", "comment": null}, "accepts_marketing": {"type": "BOOL", "index": 11, "name": "accepts_marketing", "comment": null}, "tax_exempt": {"type": "BOOL", "index": 12, "name": "tax_exempt", "comment": null}, "verified_email": {"type": "BOOL", "index": 13, "name": "verified_email", "comment": null}, "default_address_id": {"type": "INT64", "index": 14, "name": "default_address_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 15, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 512.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.shopify_source_integration_tests.shopify_customer_data"}, "seed.shopify_source_integration_tests.shopify_order_line_refund_data": {"metadata": {"type": "table", "schema": "shopify_integration_tests", "name": "shopify_order_line_refund_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "location_id": {"type": "INT64", "index": 2, "name": "location_id", "comment": null}, "refund_id": {"type": "INT64", "index": 3, "name": "refund_id", "comment": null}, "restock_type": {"type": "INT64", "index": 4, "name": "restock_type", "comment": null}, "quantity": {"type": "INT64", "index": 5, "name": "quantity", "comment": null}, "order_line_id": {"type": "INT64", "index": 6, "name": "order_line_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "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": "seed.shopify_source_integration_tests.shopify_order_line_refund_data"}, "seed.shopify_source_integration_tests.shopify_order_line_data": {"metadata": {"type": "table", "schema": "shopify_integration_tests", "name": "shopify_order_line_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INT64", "index": 1, "name": "order_id", "comment": null}, "id": {"type": "INT64", "index": 2, "name": "id", "comment": null}, "product_id": {"type": "INT64", "index": 3, "name": "product_id", "comment": null}, "variant_id": {"type": "INT64", "index": 4, "name": "variant_id", "comment": null}, "name": {"type": "STRING", "index": 5, "name": "name", "comment": null}, "title": {"type": "STRING", "index": 6, "name": "title", "comment": null}, "vendor": {"type": "STRING", "index": 7, "name": "vendor", "comment": null}, "price": {"type": "FLOAT64", "index": 8, "name": "price", "comment": null}, "quantity": {"type": "INT64", "index": 9, "name": "quantity", "comment": null}, "grams": {"type": "INT64", "index": 10, "name": "grams", "comment": null}, "sku": {"type": "STRING", "index": 11, "name": "sku", "comment": null}, "fulfillable_quantity": {"type": "INT64", "index": 12, "name": "fulfillable_quantity", "comment": null}, "fulfillment_service": {"type": "STRING", "index": 13, "name": "fulfillment_service", "comment": null}, "gift_card": {"type": "BOOL", "index": 14, "name": "gift_card", "comment": null}, "requires_shipping": {"type": "BOOL", "index": 15, "name": "requires_shipping", "comment": null}, "taxable": {"type": "BOOL", "index": 16, "name": "taxable", "comment": null}, "index": {"type": "INT64", "index": 17, "name": "index", "comment": null}, "total_discount": {"type": "INT64", "index": 18, "name": "total_discount", "comment": null}, "pre_tax_price": {"type": "INT64", "index": 19, "name": "pre_tax_price", "comment": null}, "fulfillment_status": {"type": "STRING", "index": 20, "name": "fulfillment_status", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 21, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 727.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.shopify_source_integration_tests.shopify_order_line_data"}, "seed.shopify_source_integration_tests.shopify_product_variant_data": {"metadata": {"type": "table", "schema": "shopify_integration_tests", "name": "shopify_product_variant_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "product_id": {"type": "INT64", "index": 2, "name": "product_id", "comment": null}, "inventory_item_id": {"type": "INT64", "index": 3, "name": "inventory_item_id", "comment": null}, "title": {"type": "STRING", "index": 4, "name": "title", "comment": null}, "price": {"type": "INT64", "index": 5, "name": "price", "comment": null}, "sku": {"type": "INT64", "index": 6, "name": "sku", "comment": null}, "position": {"type": "INT64", "index": 7, "name": "position", "comment": null}, "inventory_policy": {"type": "STRING", "index": 8, "name": "inventory_policy", "comment": null}, "compare_at_price": {"type": "INT64", "index": 9, "name": "compare_at_price", "comment": null}, "fulfillment_service": {"type": "STRING", "index": 10, "name": "fulfillment_service", "comment": null}, "inventory_management": {"type": "STRING", "index": 11, "name": "inventory_management", "comment": null}, "created_at": {"type": "STRING", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "STRING", "index": 13, "name": "updated_at", "comment": null}, "taxable": {"type": "BOOL", "index": 14, "name": "taxable", "comment": null}, "barcode": {"type": "INT64", "index": 15, "name": "barcode", "comment": null}, "grams": {"type": "INT64", "index": 16, "name": "grams", "comment": null}, "image_id": {"type": "INT64", "index": 17, "name": "image_id", "comment": null}, "inventory_quantity": {"type": "INT64", "index": 18, "name": "inventory_quantity", "comment": null}, "weight": {"type": "INT64", "index": 19, "name": "weight", "comment": null}, "weight_unit": {"type": "STRING", "index": 20, "name": "weight_unit", "comment": null}, "old_inventory_quantity": {"type": "INT64", "index": 21, "name": "old_inventory_quantity", "comment": null}, "requires_shipping": {"type": "BOOL", "index": 22, "name": "requires_shipping", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 23, "name": "_fivetran_synced", "comment": null}, "option_2": {"type": "INT64", "index": 24, "name": "option_2", "comment": null}, "tax_code": {"type": "STRING", "index": 25, "name": "tax_code", "comment": null}, "option_3": {"type": "INT64", "index": 26, "name": "option_3", "comment": null}, "option_1": {"type": "STRING", "index": 27, "name": "option_1", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1123.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.shopify_source_integration_tests.shopify_product_variant_data"}, "seed.shopify_source_integration_tests.shopify_order_adjustment_data": {"metadata": {"type": "table", "schema": "shopify_integration_tests", "name": "shopify_order_adjustment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INT64", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "INT64", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "INT64", "index": 4, "name": "amount", "comment": null}, "tax_amount": {"type": "FLOAT64", "index": 5, "name": "tax_amount", "comment": null}, "kind": {"type": "STRING", "index": 6, "name": "kind", "comment": null}, "reason": {"type": "STRING", "index": 7, "name": "reason", "comment": null}, "amount_set": {"type": "INT64", "index": 8, "name": "amount_set", "comment": null}, "tax_amount_set": {"type": "INT64", "index": 9, "name": "tax_amount_set", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 10, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 531.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.shopify_source_integration_tests.shopify_order_adjustment_data"}, "seed.shopify_source_integration_tests.shopify_product_data": {"metadata": {"type": "table", "schema": "shopify_integration_tests", "name": "shopify_product_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "title": {"type": "STRING", "index": 2, "name": "title", "comment": null}, "handle": {"type": "STRING", "index": 3, "name": "handle", "comment": null}, "product_type": {"type": "STRING", "index": 4, "name": "product_type", "comment": null}, "vendor": {"type": "STRING", "index": 5, "name": "vendor", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 7, "name": "updated_at", "comment": null}, "published_at": {"type": "TIMESTAMP", "index": 8, "name": "published_at", "comment": null}, "published_scope": {"type": "STRING", "index": 9, "name": "published_scope", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 10, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 11, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 549.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.shopify_source_integration_tests.shopify_product_data"}, "seed.shopify_source_integration_tests.shopify_order_data": {"metadata": {"type": "table", "schema": "shopify_integration_tests", "name": "shopify_order_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "note": {"type": "STRING", "index": 2, "name": "note", "comment": null}, "email": {"type": "STRING", "index": 3, "name": "email", "comment": null}, "taxes_included": {"type": "BOOL", "index": 4, "name": "taxes_included", "comment": null}, "currency": {"type": "STRING", "index": 5, "name": "currency", "comment": null}, "subtotal_price": {"type": "FLOAT64", "index": 6, "name": "subtotal_price", "comment": null}, "total_tax": {"type": "INT64", "index": 7, "name": "total_tax", "comment": null}, "total_price": {"type": "FLOAT64", "index": 8, "name": "total_price", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 10, "name": "updated_at", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "shipping_address_name": {"type": "STRING", "index": 12, "name": "shipping_address_name", "comment": null}, "shipping_address_first_name": {"type": "STRING", "index": 13, "name": "shipping_address_first_name", "comment": null}, "shipping_address_last_name": {"type": "STRING", "index": 14, "name": "shipping_address_last_name", "comment": null}, "shipping_address_company": {"type": "STRING", "index": 15, "name": "shipping_address_company", "comment": null}, "shipping_address_phone": {"type": "STRING", "index": 16, "name": "shipping_address_phone", "comment": null}, "shipping_address_address_1": {"type": "STRING", "index": 17, "name": "shipping_address_address_1", "comment": null}, "shipping_address_address_2": {"type": "STRING", "index": 18, "name": "shipping_address_address_2", "comment": null}, "shipping_address_city": {"type": "STRING", "index": 19, "name": "shipping_address_city", "comment": null}, "shipping_address_country": {"type": "STRING", "index": 20, "name": "shipping_address_country", "comment": null}, "shipping_address_country_code": {"type": "STRING", "index": 21, "name": "shipping_address_country_code", "comment": null}, "shipping_address_province": {"type": "STRING", "index": 22, "name": "shipping_address_province", "comment": null}, "shipping_address_province_code": {"type": "INT64", "index": 23, "name": "shipping_address_province_code", "comment": null}, "shipping_address_zip": {"type": "STRING", "index": 24, "name": "shipping_address_zip", "comment": null}, "shipping_address_latitude": {"type": "STRING", "index": 25, "name": "shipping_address_latitude", "comment": null}, "shipping_address_longitude": {"type": "STRING", "index": 26, "name": "shipping_address_longitude", "comment": null}, "billing_address_name": {"type": "STRING", "index": 27, "name": "billing_address_name", "comment": null}, "billing_address_first_name": {"type": "STRING", "index": 28, "name": "billing_address_first_name", "comment": null}, "billing_address_last_name": {"type": "STRING", "index": 29, "name": "billing_address_last_name", "comment": null}, "billing_address_company": {"type": "STRING", "index": 30, "name": "billing_address_company", "comment": null}, "billing_address_phone": {"type": "STRING", "index": 31, "name": "billing_address_phone", "comment": null}, "billing_address_address_1": {"type": "STRING", "index": 32, "name": "billing_address_address_1", "comment": null}, "billing_address_address_2": {"type": "STRING", "index": 33, "name": "billing_address_address_2", "comment": null}, "billing_address_city": {"type": "STRING", "index": 34, "name": "billing_address_city", "comment": null}, "billing_address_country": {"type": "STRING", "index": 35, "name": "billing_address_country", "comment": null}, "billing_address_country_code": {"type": "STRING", "index": 36, "name": "billing_address_country_code", "comment": null}, "billing_address_province": {"type": "STRING", "index": 37, "name": "billing_address_province", "comment": null}, "billing_address_province_code": {"type": "INT64", "index": 38, "name": "billing_address_province_code", "comment": null}, "billing_address_zip": {"type": "STRING", "index": 39, "name": "billing_address_zip", "comment": null}, "billing_address_latitude": {"type": "STRING", "index": 40, "name": "billing_address_latitude", "comment": null}, "billing_address_longitude": {"type": "STRING", "index": 41, "name": "billing_address_longitude", "comment": null}, "customer_id": {"type": "INT64", "index": 42, "name": "customer_id", "comment": null}, "location_id": {"type": "INT64", "index": 43, "name": "location_id", "comment": null}, "user_id": {"type": "INT64", "index": 44, "name": "user_id", "comment": null}, "number": {"type": "INT64", "index": 45, "name": "number", "comment": null}, "order_number": {"type": "INT64", "index": 46, "name": "order_number", "comment": null}, "financial_status": {"type": "STRING", "index": 47, "name": "financial_status", "comment": null}, "fulfillment_status": {"type": "STRING", "index": 48, "name": "fulfillment_status", "comment": null}, "processed_at": {"type": "TIMESTAMP", "index": 49, "name": "processed_at", "comment": null}, "processing_method": {"type": "STRING", "index": 50, "name": "processing_method", "comment": null}, "referring_site": {"type": "STRING", "index": 51, "name": "referring_site", "comment": null}, "cancel_reason": {"type": "INT64", "index": 52, "name": "cancel_reason", "comment": null}, "cancelled_at": {"type": "TIMESTAMP", "index": 53, "name": "cancelled_at", "comment": null}, "closed_at": {"type": "STRING", "index": 54, "name": "closed_at", "comment": null}, "total_discounts": {"type": "FLOAT64", "index": 55, "name": "total_discounts", "comment": null}, "total_line_items_price": {"type": "FLOAT64", "index": 56, "name": "total_line_items_price", "comment": null}, "total_weight": {"type": "INT64", "index": 57, "name": "total_weight", "comment": null}, "source_name": {"type": "STRING", "index": 58, "name": "source_name", "comment": null}, "browser_ip": {"type": "STRING", "index": 59, "name": "browser_ip", "comment": null}, "buyer_accepts_marketing": {"type": "BOOL", "index": 60, "name": "buyer_accepts_marketing", "comment": null}, "token": {"type": "STRING", "index": 61, "name": "token", "comment": null}, "cart_token": {"type": "STRING", "index": 62, "name": "cart_token", "comment": null}, "checkout_token": {"type": "STRING", "index": 63, "name": "checkout_token", "comment": null}, "test": {"type": "BOOL", "index": 64, "name": "test", "comment": null}, "landing_site_base_url": {"type": "STRING", "index": 65, "name": "landing_site_base_url", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 66, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3850.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.shopify_source_integration_tests.shopify_order_data"}, "seed.shopify_source_integration_tests.shopify_refund_data": {"metadata": {"type": "table", "schema": "shopify_integration_tests", "name": "shopify_refund_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "STRING", "index": 2, "name": "created_at", "comment": null}, "processed_at": {"type": "STRING", "index": 3, "name": "processed_at", "comment": null}, "note": {"type": "STRING", "index": 4, "name": "note", "comment": null}, "restock": {"type": "BOOL", "index": 5, "name": "restock", "comment": null}, "user_id": {"type": "INT64", "index": 6, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 7, "name": "_fivetran_synced", "comment": null}, "total_duties_set": {"type": "INT64", "index": 8, "name": "total_duties_set", "comment": null}, "order_id": {"type": "INT64", "index": 9, "name": "order_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 606.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.shopify_source_integration_tests.shopify_refund_data"}, "seed.shopify_source_integration_tests.shopify_transaction_data": {"metadata": {"type": "table", "schema": "shopify_integration_tests", "name": "shopify_transaction_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INT64", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "INT64", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "FLOAT64", "index": 4, "name": "amount", "comment": null}, "authorization": {"type": "STRING", "index": 5, "name": "authorization", "comment": null}, "created_at": {"type": "STRING", "index": 6, "name": "created_at", "comment": null}, "processed_at": {"type": "STRING", "index": 7, "name": "processed_at", "comment": null}, "device_id": {"type": "INT64", "index": 8, "name": "device_id", "comment": null}, "gateway": {"type": "STRING", "index": 9, "name": "gateway", "comment": null}, "source_name": {"type": "STRING", "index": 10, "name": "source_name", "comment": null}, "message": {"type": "STRING", "index": 11, "name": "message", "comment": null}, "currency": {"type": "STRING", "index": 12, "name": "currency", "comment": null}, "location_id": {"type": "INT64", "index": 13, "name": "location_id", "comment": null}, "parent_id": {"type": "INT64", "index": 14, "name": "parent_id", "comment": null}, "payment_avs_result_code": {"type": "STRING", "index": 15, "name": "payment_avs_result_code", "comment": null}, "kind": {"type": "STRING", "index": 16, "name": "kind", "comment": null}, "currency_exchange_id": {"type": "INT64", "index": 17, "name": "currency_exchange_id", "comment": null}, "currency_exchange_adjustment": {"type": "INT64", "index": 18, "name": "currency_exchange_adjustment", "comment": null}, "currency_exchange_original_amount": {"type": "INT64", "index": 19, "name": "currency_exchange_original_amount", "comment": null}, "currency_exchange_final_amount": {"type": "INT64", "index": 20, "name": "currency_exchange_final_amount", "comment": null}, "currency_exchange_currency": {"type": "INT64", "index": 21, "name": "currency_exchange_currency", "comment": null}, "error_code": {"type": "INT64", "index": 22, "name": "error_code", "comment": null}, "status": {"type": "STRING", "index": 23, "name": "status", "comment": null}, "test": {"type": "BOOL", "index": 24, "name": "test", "comment": null}, "user_id": {"type": "INT64", "index": 25, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "STRING", "index": 26, "name": "_fivetran_synced", "comment": null}, "payment_credit_card_bin": {"type": "INT64", "index": 27, "name": "payment_credit_card_bin", "comment": null}, "payment_cvv_result_code": {"type": "INT64", "index": 28, "name": "payment_cvv_result_code", "comment": null}, "payment_credit_card_number": {"type": "INT64", "index": 29, "name": "payment_credit_card_number", "comment": null}, "payment_credit_card_company": {"type": "INT64", "index": 30, "name": "payment_credit_card_company", "comment": null}, "receipt": {"type": "STRING", "index": 31, "name": "receipt", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1399.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.shopify_source_integration_tests.shopify_transaction_data"}}, "sources": {}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.0.0", "generated_at": "2022-05-19T22:46:07.774945Z", "invocation_id": "01730690-279c-49fa-8104-ca67a1c36abc", "env": {}}, "nodes": {"model.develop.my_second_dbt_model": {"metadata": {"type": "view", "schema": "dbt_renee", "name": "my_second_dbt_model", "database": "bq-instance", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.develop.my_second_dbt_model"}, "model.develop.my_first_dbt_model": {"metadata": {"type": "table", "schema": "dbt_renee", "name": "my_first_dbt_model", "database": "bq-instance", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.develop.my_first_dbt_model"}}, "sources": {}, "errors": null} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 360349a..fa8b08b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,7 +8,7 @@ - + @@ -16,17 +16,17 @@ - + - +
icons
- diff --git a/docs/manifest.json b/docs/manifest.json index f71d42f..fcdc731 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-05-10T15:49:33.056218Z", "invocation_id": "25205f8f-a888-421f-a470-c817bc340294", "env": {}, "project_id": "f2f22d4d8db9dfa8a08831bb14141bc2", "user_id": "57178664-37b2-4047-9572-68ec8b488cd7", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.shopify_source_integration_tests.shopify_order_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "processed_at": "timestamp", "cancelled_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64", "customer_id": "INT64", "location_id": "INT64", "user_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_data.csv", "original_file_path": "data/shopify_order_data.csv", "name": "shopify_order_data", "alias": "shopify_order_data", "checksum": {"name": "sha256", "checksum": "4d0dd043a886a0d9e7680e7ee2cd132717490f75d3a06fe7c38956d901976146"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "processed_at": "timestamp", "cancelled_at": "timestamp", "_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "customer_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "location_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "user_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_data`"}, "seed.shopify_source_integration_tests.shopify_order_line_refund_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64", "location_id": "INT64", "refund_id": "INT64", "order_line_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_line_refund_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_refund_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_line_refund_data.csv", "original_file_path": "data/shopify_order_line_refund_data.csv", "name": "shopify_order_line_refund_data", "alias": "shopify_order_line_refund_data", "checksum": {"name": "sha256", "checksum": "52889a517b6610f539a77f9905805d67fbee62f0bcd63f3ca432efce9a328b45"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "location_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "refund_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_line_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_refund_data`"}, "seed.shopify_source_integration_tests.shopify_order_adjustment_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "refund_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_adjustment_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_adjustment_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_adjustment_data.csv", "original_file_path": "data/shopify_order_adjustment_data.csv", "name": "shopify_order_adjustment_data", "alias": "shopify_order_adjustment_data", "checksum": {"name": "sha256", "checksum": "99899b3532a7e74a67063723058528563d4fedc8114e99e930cfbc8598a16da8"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "refund_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_adjustment_data`"}, "seed.shopify_source_integration_tests.shopify_product_variant_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "product_id": "INT64", "inventory_item_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_product_variant_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_product_variant_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_product_variant_data.csv", "original_file_path": "data/shopify_product_variant_data.csv", "name": "shopify_product_variant_data", "alias": "shopify_product_variant_data", "checksum": {"name": "sha256", "checksum": "5fbf997eaa32d49016b0ba5acd2201e60309b0b7fb3a83e5a782542502426abc"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "product_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "inventory_item_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_product_variant_data`"}, "seed.shopify_source_integration_tests.shopify_refund_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "user_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_refund_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_refund_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_refund_data.csv", "original_file_path": "data/shopify_refund_data.csv", "name": "shopify_refund_data", "alias": "shopify_refund_data", "checksum": {"name": "sha256", "checksum": "1efcab5977150427c6c7ef2c3aff396384bdd80dfd5872752836b027ea78e404"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "user_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_refund_data`"}, "seed.shopify_source_integration_tests.shopify_transaction_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "refund_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_transaction_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_transaction_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_transaction_data.csv", "original_file_path": "data/shopify_transaction_data.csv", "name": "shopify_transaction_data", "alias": "shopify_transaction_data", "checksum": {"name": "sha256", "checksum": "353ca5206d7a0982439b57cda81d05e861b924f65071e3c2c2b6ad1ca7fccf75"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "refund_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_transaction_data`"}, "seed.shopify_source_integration_tests.shopify_product_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "published_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_product_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_product_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_product_data.csv", "original_file_path": "data/shopify_product_data.csv", "name": "shopify_product_data", "alias": "shopify_product_data", "checksum": {"name": "sha256", "checksum": "5cc03f90512ac04a6526220040085e4e0488b62ef22e8b201424c7d7cf1bf847"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "published_at": "timestamp", "_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_product_data`"}, "seed.shopify_source_integration_tests.shopify_customer_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64", "default_address_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_customer_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_customer_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_customer_data.csv", "original_file_path": "data/shopify_customer_data.csv", "name": "shopify_customer_data", "alias": "shopify_customer_data", "checksum": {"name": "sha256", "checksum": "79bc0a5972c321cefe2973acdd443ce1d42e36b3b23b2298151046d23bdf4bea"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "default_address_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_customer_data`"}, "seed.shopify_source_integration_tests.shopify_order_line_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "order_id": "INT64", "id": "INT64", "product_id": "INT64", "variant_id": "INT64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_line_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_data", "package_name": "shopify_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_line_data.csv", "original_file_path": "data/shopify_order_line_data.csv", "name": "shopify_order_line_data", "alias": "shopify_order_line_data", "checksum": {"name": "sha256", "checksum": "cabaa49c9bd299b34eb2154893a6dd399fbbad7e4ad7036293c8b4cb599199e0"}, "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 in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "order_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "product_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "variant_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_data`"}, "model.shopify_source.stg_shopify__order_line": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_line_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_line_tmp')),\n staging_columns=get_order_line_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_line_pass_through_columns') %}\n ,\n {{ var('order_line_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_line_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_line_tmp", "model.shopify_source.stg_shopify__order_line_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line"], "unique_id": "model.shopify_source.stg_shopify__order_line", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order_line.sql", "original_file_path": "models/stg_shopify__order_line.sql", "name": "stg_shopify__order_line", "alias": "stg_shopify__order_line", "checksum": {"name": "sha256", "checksum": "961391fa517a5bf84ab40e9a93d41909046267406b20a9a0eaeb01a69f143ec4"}, "tags": [], "refs": [["stg_shopify__order_line_tmp"], ["stg_shopify__order_line_tmp"]], "sources": [], "description": "Each record represents a line item from an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillable_quantity": {"name": "fulfillable_quantity", "description": "The amount available to fulfill, calculated as follows: quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The service provider that's fulfilling the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "How far along an order is in terms line items fulfilled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_gift_card": {"name": "is_gift_card", "description": "Whether the item is a gift card. If true, then the item is not taxed or considered for shipping charges.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the item in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the line item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the related order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the item before discounts have been applied in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The ID of the product that the line item belongs to. Can be null if the original product associated with the order is deleted at a later date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of items that were purchased.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_requiring_shipping": {"name": "is_requiring_shipping", "description": "Whether the item requires shipping.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "The item's SKU (stock keeping unit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_taxable": {"name": "is_taxable", "description": "Whether the item was taxable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discount": {"name": "total_discount", "description": "The total amount of the discount allocated to the line item in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The ID of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the item's supplier.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order_line.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n fulfillable_quantity\n \n as \n \n fulfillable_quantity\n \n, \n \n \n fulfillment_service\n \n as \n \n fulfillment_service\n \n, \n \n \n fulfillment_status\n \n as \n \n fulfillment_status\n \n, \n \n \n gift_card\n \n as is_gift_card , \n \n \n grams\n \n as \n \n grams\n \n, \n \n \n id\n \n as order_line_id , \n \n \n index\n \n as \n \n index\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n pre_tax_price\n \n as \n \n pre_tax_price\n \n, \n \n \n price\n \n as \n \n price\n \n, \n \n \n product_id\n \n as \n \n product_id\n \n, \n cast(null as \n numeric\n) as \n \n property_charge_interval_frequency\n \n , \n cast(null as \n string\n) as \n \n property_for_shipping_jan_3_rd_2020\n \n , \n cast(null as \n numeric\n) as \n \n property_shipping_interval_frequency\n \n , \n cast(null as \n string\n) as \n \n property_shipping_interval_unit_type\n \n , \n cast(null as \n numeric\n) as \n \n property_subscription_id\n \n , \n \n \n quantity\n \n as \n \n quantity\n \n, \n \n \n requires_shipping\n \n as is_requiring_shipping , \n \n \n sku\n \n as \n \n sku\n \n, \n \n \n taxable\n \n as is_taxable , \n \n \n title\n \n as \n \n title\n \n, \n \n \n total_discount\n \n as \n \n total_discount\n \n, \n \n \n variant_id\n \n as \n \n variant_id\n \n, \n \n \n vendor\n \n as \n \n vendor\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line`"}, "model.shopify_source.stg_shopify__refund": {"raw_sql": "with source as (\n\n select * \n from {{ ref('stg_shopify__refund_tmp') }}\n\n),\n\nrenamed as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__refund_tmp')),\n staging_columns=get_refund_columns()\n )\n }}\n \n from source\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_refund_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__refund_tmp", "model.shopify_source.stg_shopify__refund_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__refund"], "unique_id": "model.shopify_source.stg_shopify__refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__refund.sql", "original_file_path": "models/stg_shopify__refund.sql", "name": "stg_shopify__refund", "alias": "stg_shopify__refund", "checksum": {"name": "sha256", "checksum": "20ab47c1ea17b352a952dff3831bf0cc35a79e629e8a2fd26d1038dd9854d033"}, "tags": [], "refs": [["stg_shopify__refund_tmp"], ["stg_shopify__refund_tmp"]], "sources": [], "description": "Each record represents a refund within Shopify.", "columns": {"refund_id": {"name": "refund_id", "description": "The unique numeric identifier for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of the date when the refund was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "Timestamp of the date when the refund was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "User generated note attached to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock": {"name": "restock", "description": "Boolean indicating if the refund is a result of a restock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Reference to the user id which generated the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_duties_set": {"name": "total_duties_set", "description": "Record representing total duties set for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the refund is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__refund.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * \n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n id\n \n as refund_id , \n \n \n note\n \n as \n \n note\n \n, \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n processed_at\n \n as \n \n processed_at\n \n, \n \n \n restock\n \n as \n \n restock\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n \n from source\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund`"}, "model.shopify_source.stg_shopify__product": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__product_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__product_tmp')),\n staging_columns=get_product_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('product_pass_through_columns') %}\n ,\n {{ var('product_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_product_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__product_tmp", "model.shopify_source.stg_shopify__product_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product"], "unique_id": "model.shopify_source.stg_shopify__product", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__product.sql", "original_file_path": "models/stg_shopify__product.sql", "name": "stg_shopify__product", "alias": "stg_shopify__product", "checksum": {"name": "sha256", "checksum": "470f6430f6b7c22f0bbdfdf989c302463572c345232f3a7dfc033546f644689f"}, "tags": [], "refs": [["stg_shopify__product_tmp"], ["stg_shopify__product_tmp"]], "sources": [], "description": "Each record represents a product in Shopify.", "columns": {"_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Whether the record has been deleted in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the product was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "handle": {"name": "handle", "description": "A unique human-friendly string for the product. Automatically generated from the product's title.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "An unsigned 64-bit integer that's used as a unique identifier for the product. Each id is unique across the Shopify system. No two products will have the same id, even if they're from different shops.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_type": {"name": "product_type", "description": "A categorization for the product used for filtering and searching products.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_timestamp": {"name": "published_timestamp", "description": "The date and time (ISO 8601 format) when the product was published. Can be set to null to unpublish the product from the Online Store channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_scope": {"name": "published_scope", "description": "Whether the product is published to the Point of Sale channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The name of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the product was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the product's vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__product.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as created_timestamp , \n \n \n handle\n \n as \n \n handle\n \n, \n \n \n id\n \n as product_id , \n \n \n product_type\n \n as \n \n product_type\n \n, \n \n \n published_at\n \n as published_timestamp , \n \n \n published_scope\n \n as \n \n published_scope\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as updated_timestamp , \n \n \n vendor\n \n as \n \n vendor\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product`"}, "model.shopify_source.stg_shopify__product_variant": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__product_variant_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__product_variant_tmp')),\n staging_columns=get_product_variant_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('product_variant_pass_through_columns') %}\n ,\n {{ var('product_variant_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_product_variant_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__product_variant_tmp", "model.shopify_source.stg_shopify__product_variant_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product_variant"], "unique_id": "model.shopify_source.stg_shopify__product_variant", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__product_variant.sql", "original_file_path": "models/stg_shopify__product_variant.sql", "name": "stg_shopify__product_variant", "alias": "stg_shopify__product_variant", "checksum": {"name": "sha256", "checksum": "0bfac7e5aab433722634b674b7ac67d409184b9f8168d4cec962009ff3a3ce1e"}, "tags": [], "refs": [["stg_shopify__product_variant_tmp"], ["stg_shopify__product_variant_tmp"]], "sources": [], "description": "Each record represents a product variant in Shopify", "columns": {"barcode": {"name": "barcode", "description": "The barcode, UPC, or ISBN number for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "compare_at_price": {"name": "compare_at_price", "description": "The original price of the item before an adjustment or a sale.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time (ISO 8601 format) when the product variant was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The fulfillment service associated with the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the product variant in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The unique numeric identifier for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "image_id": {"name": "image_id", "description": "The unique numeric identifier for a product's image. The image must be associated to the same product as the variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_item_id": {"name": "inventory_item_id", "description": "The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_management": {"name": "inventory_management", "description": "The fulfillment service that tracks the number of items in stock for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_policy": {"name": "inventory_policy", "description": "Whether customers are allowed to place an order for the product variant when it's out of stock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_quantity": {"name": "inventory_quantity", "description": "An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "old_inventory_quantity": {"name": "old_inventory_quantity", "description": "This property is deprecated. Use the InventoryLevel resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_1": {"name": "option_1", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_2": {"name": "option_2", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_3": {"name": "option_3", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The order of the product variant in the list of product variants. The first position in the list is 1. The position of variants is indicated by the order in which they are listed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The unique numeric identifier for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_requiring_shipping": {"name": "is_requiring_shipping", "description": "This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_taxable": {"name": "is_taxable", "description": "Whether a tax is charged when the product variant is sold.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_code": {"name": "tax_code", "description": "This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product variant. The title field is a concatenation of the option1, option2, and option3 fields. You can only update title indirectly using the option fields.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the product variant was last modified. Gets returned in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight": {"name": "weight", "description": "The weight of the product variant in the unit system specified with weight_unit.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight_unit": {"name": "weight_unit", "description": "The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__product_variant.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n id\n \n as variant_id , \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as created_timestamp , \n \n \n updated_at\n \n as updated_timestamp , \n \n \n product_id\n \n as \n \n product_id\n \n, \n \n \n inventory_item_id\n \n as \n \n inventory_item_id\n \n, \n \n \n image_id\n \n as \n \n image_id\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n price\n \n as \n \n price\n \n, \n \n \n sku\n \n as \n \n sku\n \n, \n \n \n position\n \n as \n \n position\n \n, \n \n \n inventory_policy\n \n as \n \n inventory_policy\n \n, \n \n \n compare_at_price\n \n as \n \n compare_at_price\n \n, \n \n \n fulfillment_service\n \n as \n \n fulfillment_service\n \n, \n \n \n inventory_management\n \n as \n \n inventory_management\n \n, \n \n \n taxable\n \n as is_taxable , \n \n \n barcode\n \n as \n \n barcode\n \n, \n \n \n grams\n \n as \n \n grams\n \n, \n \n \n inventory_quantity\n \n as \n \n inventory_quantity\n \n, \n \n \n weight\n \n as \n \n weight\n \n, \n \n \n weight_unit\n \n as \n \n weight_unit\n \n, \n \n \n option_1\n \n as \n \n option_1\n \n, \n \n \n option_2\n \n as \n \n option_2\n \n, \n \n \n option_3\n \n as \n \n option_3\n \n, \n \n \n tax_code\n \n as \n \n tax_code\n \n, \n \n \n old_inventory_quantity\n \n as \n \n old_inventory_quantity\n \n, \n \n \n requires_shipping\n \n as is_requiring_shipping \n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant`"}, "model.shopify_source.stg_shopify__order": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_tmp')),\n staging_columns=get_order_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_pass_through_columns') %}\n ,\n {{ var('order_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_tmp", "model.shopify_source.stg_shopify__order_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order"], "unique_id": "model.shopify_source.stg_shopify__order", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order.sql", "original_file_path": "models/stg_shopify__order.sql", "name": "stg_shopify__order", "alias": "stg_shopify__order", "checksum": {"name": "sha256", "checksum": "92d39b99aabc22ec3997565a7ef8635a299738e18331d9e5a4f689a713ae14eb"}, "tags": [], "refs": [["stg_shopify__order_tmp"], ["stg_shopify__order_tmp"]], "sources": [], "description": "Each record represents an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The ID of the app that created the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_1": {"name": "billing_address_address_1", "description": "The street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_2": {"name": "billing_address_address_2", "description": "An optional additional field for the street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_city": {"name": "billing_address_city", "description": "The city, town, or village of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_company": {"name": "billing_address_company", "description": "The company of the person associated with the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country": {"name": "billing_address_country", "description": "The name of the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country_code": {"name": "billing_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_first_name": {"name": "billing_address_first_name", "description": "The first name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_last_name": {"name": "billing_address_last_name", "description": "The last name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_latitude": {"name": "billing_address_latitude", "description": "The latitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_longitude": {"name": "billing_address_longitude", "description": "The longitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_name": {"name": "billing_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_phone": {"name": "billing_address_phone", "description": "The phone number at the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province": {"name": "billing_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province_code": {"name": "billing_address_province_code", "description": "The two-letter abbreviation of the region of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_zip": {"name": "billing_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "browser_ip": {"name": "browser_ip", "description": "The IP address of the browser used by the customer when they placed the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_buyer_accepted_marketing": {"name": "has_buyer_accepted_marketing", "description": "Whether the customer consented to receive email updates from the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancel_reason": {"name": "cancel_reason", "description": "The reason why the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancelled_timestamp": {"name": "cancelled_timestamp", "description": "The date and time when the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cart_token": {"name": "cart_token", "description": "The ID of the cart that's associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_timestamp": {"name": "closed_timestamp", "description": "The date and time when the order was closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The autogenerated date and time when the order was created in Shopify.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code for the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "The ID of the order's customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The customer's email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "financial_status": {"name": "financial_status", "description": "The status of payments associated with the order. Can only be set when the order is created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "The order's status in terms of fulfilled line items.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the order, used for API purposes. This is different from the order_number property, which is the ID used by the shop owner and customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "landing_site_base_url": {"name": "landing_site_base_url", "description": "The URL for the page where the buyer landed when they entered the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the order was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The order name, generated by combining the order_number property with the order prefix and suffix that are set in the merchant's general settings.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "An optional note that a shop owner can attach to the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The order's position in the shop's count of orders. Numbers are sequential and start at 1.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "The order 's position in the shop's count of orders starting at 1001. Order numbers are sequential and start at 1001.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when an order was processed. This value is the date that appears on your orders and that's used in the analytic reports.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processing_method": {"name": "processing_method", "description": "How the payment was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "referring_site": {"name": "referring_site", "description": "The website where the customer clicked a link to the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_1": {"name": "shipping_address_address_1", "description": "The street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_2": {"name": "shipping_address_address_2", "description": "An optional additional field for the street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_city": {"name": "shipping_address_city", "description": "The city, town, or village of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_company": {"name": "shipping_address_company", "description": "The company of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country": {"name": "shipping_address_country", "description": "The name of the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country_code": {"name": "shipping_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_first_name": {"name": "shipping_address_first_name", "description": "The first name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_last_name": {"name": "shipping_address_last_name", "description": "The last name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_latitude": {"name": "shipping_address_latitude", "description": "The latitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_longitude": {"name": "shipping_address_longitude", "description": "The longitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_name": {"name": "shipping_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_phone": {"name": "shipping_address_phone", "description": "The phone number at the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province": {"name": "shipping_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province_code": {"name": "shipping_address_province_code", "description": "The two-letter abbreviation of the region of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_zip": {"name": "shipping_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "Where the order originated. Can be set only during order creation, and is not writeable afterwards.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal_price": {"name": "subtotal_price", "description": "The price of the order in the shop currency after discounts but before shipping, taxes, and tips.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_taxes_included": {"name": "has_taxes_included", "description": "Whether taxes are included in the order subtotal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_test_order": {"name": "is_test_order", "description": "Whether this is a test order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "token": {"name": "token", "description": "A unique token for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discounts": {"name": "total_discounts", "description": "The total discounts applied to the price of the order in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_line_items_price": {"name": "total_line_items_price", "description": "The sum of all line item prices in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The sum of all the taxes applied to the order in th shop currency. Must be positive).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_weight": {"name": "total_weight", "description": "The sum of all line item weights in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time (ISO 8601 format) when the order was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID of the user logged into Shopify POS who processed the order, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_shipping_price_set": {"name": "total_shipping_price_set", "description": "The total shipping price set for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "index": {"name": "index", "description": "The index associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pre_tax_price": {"name": "pre_tax_price", "description": "The total pre tax price of the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n billing_address_address_1\n \n as \n \n billing_address_address_1\n \n, \n \n \n billing_address_address_2\n \n as \n \n billing_address_address_2\n \n, \n \n \n billing_address_city\n \n as \n \n billing_address_city\n \n, \n \n \n billing_address_company\n \n as \n \n billing_address_company\n \n, \n \n \n billing_address_country\n \n as \n \n billing_address_country\n \n, \n \n \n billing_address_country_code\n \n as \n \n billing_address_country_code\n \n, \n \n \n billing_address_first_name\n \n as \n \n billing_address_first_name\n \n, \n \n \n billing_address_last_name\n \n as \n \n billing_address_last_name\n \n, \n \n \n billing_address_latitude\n \n as \n \n billing_address_latitude\n \n, \n \n \n billing_address_longitude\n \n as \n \n billing_address_longitude\n \n, \n \n \n billing_address_name\n \n as \n \n billing_address_name\n \n, \n \n \n billing_address_phone\n \n as \n \n billing_address_phone\n \n, \n \n \n billing_address_province\n \n as \n \n billing_address_province\n \n, \n \n \n billing_address_province_code\n \n as \n \n billing_address_province_code\n \n, \n \n \n billing_address_zip\n \n as \n \n billing_address_zip\n \n, \n \n \n browser_ip\n \n as \n \n browser_ip\n \n, \n \n \n buyer_accepts_marketing\n \n as has_buyer_accepted_marketing , \n \n \n cancel_reason\n \n as \n \n cancel_reason\n \n, \n \n \n cancelled_at\n \n as cancelled_timestamp , \n \n \n cart_token\n \n as \n \n cart_token\n \n, \n \n \n checkout_token\n \n as \n \n checkout_token\n \n, \n \n \n closed_at\n \n as closed_timestamp , \n \n \n created_at\n \n as created_timestamp , \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n customer_id\n \n as \n \n customer_id\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n financial_status\n \n as \n \n financial_status\n \n, \n \n \n fulfillment_status\n \n as \n \n fulfillment_status\n \n, \n \n \n id\n \n as order_id , \n \n \n landing_site_base_url\n \n as \n \n landing_site_base_url\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 \n \n note\n \n as \n \n note\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n order_number\n \n as \n \n order_number\n \n, \n \n \n processed_at\n \n as processed_timestamp , \n \n \n processing_method\n \n as \n \n processing_method\n \n, \n \n \n referring_site\n \n as \n \n referring_site\n \n, \n cast(null as \n string\n) as \n \n total_shipping_price_set\n \n , \n \n \n shipping_address_address_1\n \n as \n \n shipping_address_address_1\n \n, \n \n \n shipping_address_address_2\n \n as \n \n shipping_address_address_2\n \n, \n \n \n shipping_address_city\n \n as \n \n shipping_address_city\n \n, \n \n \n shipping_address_company\n \n as \n \n shipping_address_company\n \n, \n \n \n shipping_address_country\n \n as \n \n shipping_address_country\n \n, \n \n \n shipping_address_country_code\n \n as \n \n shipping_address_country_code\n \n, \n \n \n shipping_address_first_name\n \n as \n \n shipping_address_first_name\n \n, \n \n \n shipping_address_last_name\n \n as \n \n shipping_address_last_name\n \n, \n \n \n shipping_address_latitude\n \n as \n \n shipping_address_latitude\n \n, \n \n \n shipping_address_longitude\n \n as \n \n shipping_address_longitude\n \n, \n \n \n shipping_address_name\n \n as \n \n shipping_address_name\n \n, \n \n \n shipping_address_phone\n \n as \n \n shipping_address_phone\n \n, \n \n \n shipping_address_province\n \n as \n \n shipping_address_province\n \n, \n \n \n shipping_address_province_code\n \n as \n \n shipping_address_province_code\n \n, \n \n \n shipping_address_zip\n \n as \n \n shipping_address_zip\n \n, \n \n \n source_name\n \n as \n \n source_name\n \n, \n \n \n subtotal_price\n \n as \n \n subtotal_price\n \n, \n \n \n taxes_included\n \n as has_taxes_included , \n \n \n test\n \n as is_test_order , \n \n \n token\n \n as \n \n token\n \n, \n \n \n total_discounts\n \n as \n \n total_discounts\n \n, \n \n \n total_line_items_price\n \n as \n \n total_line_items_price\n \n, \n \n \n total_price\n \n as \n \n total_price\n \n, \n \n \n total_tax\n \n as \n \n total_tax\n \n, \n \n \n total_weight\n \n as \n \n total_weight\n \n, \n \n \n updated_at\n \n as updated_timestamp , \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order`"}, "model.shopify_source.stg_shopify__transaction": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__transaction_tmp') }}\n\n),\n\nrenamed as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__transaction_tmp')),\n staging_columns=get_transaction_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('transaction_pass_through_columns') %}\n ,\n {{ var('transaction_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n where not test\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_transaction_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__transaction_tmp", "model.shopify_source.stg_shopify__transaction_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__transaction"], "unique_id": "model.shopify_source.stg_shopify__transaction", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__transaction.sql", "original_file_path": "models/stg_shopify__transaction.sql", "name": "stg_shopify__transaction", "alias": "stg_shopify__transaction", "checksum": {"name": "sha256", "checksum": "f8f807ac9ac627ebd0cbb81ab4023242f02ba5724e1ecd2c10913335e7ff277b"}, "tags": [], "refs": [["stg_shopify__transaction_tmp"], ["stg_shopify__transaction_tmp"]], "sources": [], "description": "Each record represents a transaction in Shopify.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The ID for the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID for the order that the transaction is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID associated with a refund in the refund table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of money included in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authorization": {"name": "authorization", "description": "The authorization code associated with the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the transaction was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when a transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device_id": {"name": "device_id", "description": "The ID for the device.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gateway": {"name": "gateway", "description": "The name of the gateway the transaction was issued through.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "The origin of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "message": {"name": "message", "description": "A string generated by the payment provider with additional information about why the transaction succeeded or failed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code (ISO 4217 format) for the currency used for the payment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The ID of an associated transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_avs_result_code": {"name": "payment_avs_result_code", "description": "The response code from the address verification system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_bin": {"name": "payment_credit_card_bin", "description": "The issuer identification number (IIN), formerly known as bank identification number (BIN) of the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_cvv_result_code": {"name": "payment_cvv_result_code", "description": "The response code from the credit card company indicating whether the customer entered the card security code, or card verification value, correctly.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_number": {"name": "payment_credit_card_number", "description": "The customer's credit card number, with most of the leading digits redacted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_company": {"name": "payment_credit_card_company", "description": "The name of the company that issued the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The transaction's type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "receipt": {"name": "receipt", "description": "A transaction receipt attached to the transaction by the gateway.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_id": {"name": "currency_exchange_id", "description": "The ID of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_adjustment": {"name": "currency_exchange_adjustment", "description": "The difference between the amounts on the associated transaction and the parent transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_original_amount": {"name": "currency_exchange_original_amount", "description": "The amount of the parent transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_final_amount": {"name": "currency_exchange_final_amount", "description": "The amount of the associated transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_currency": {"name": "currency_exchange_currency", "description": "The shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "error_code": {"name": "error_code", "description": "A standardized error code, independent of the payment provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether the transaction is a test transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__transaction.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction_tmp`\n\n),\n\nrenamed as (\n\n select\n\n \n \n \n id\n \n as transaction_id , \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n refund_id\n \n as \n \n refund_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n created_at\n \n as created_timestamp , \n \n \n processed_at\n \n as processed_timestamp , \n \n \n device_id\n \n as \n \n device_id\n \n, \n \n \n gateway\n \n as \n \n gateway\n \n, \n \n \n source_name\n \n as \n \n source_name\n \n, \n \n \n message\n \n as \n \n message\n \n, \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n location_id\n \n as \n \n location_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n payment_avs_result_code\n \n as \n \n payment_avs_result_code\n \n, \n \n \n payment_credit_card_bin\n \n as \n \n payment_credit_card_bin\n \n, \n \n \n payment_cvv_result_code\n \n as \n \n payment_cvv_result_code\n \n, \n \n \n payment_credit_card_number\n \n as \n \n payment_credit_card_number\n \n, \n \n \n payment_credit_card_company\n \n as \n \n payment_credit_card_company\n \n, \n \n \n kind\n \n as \n \n kind\n \n, \n \n \n receipt\n \n as \n \n receipt\n \n, \n \n \n currency_exchange_id\n \n as \n \n currency_exchange_id\n \n, \n \n \n currency_exchange_adjustment\n \n as \n \n currency_exchange_adjustment\n \n, \n \n \n currency_exchange_original_amount\n \n as \n \n currency_exchange_original_amount\n \n, \n \n \n currency_exchange_final_amount\n \n as \n \n currency_exchange_final_amount\n \n, \n \n \n currency_exchange_currency\n \n as \n \n currency_exchange_currency\n \n, \n \n \n error_code\n \n as \n \n error_code\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n test\n \n as \n \n test\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n where not test\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction`"}, "model.shopify_source.stg_shopify__order_adjustment": {"raw_sql": "with source as (\n\n select * \n from {{ ref('stg_shopify__order_adjustment_tmp') }}\n\n),\n\nrenamed as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_adjustment_tmp')),\n staging_columns=get_order_adjustment_columns()\n )\n }}\n \n from source\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_adjustment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment_tmp", "model.shopify_source.stg_shopify__order_adjustment_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_adjustment"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order_adjustment.sql", "original_file_path": "models/stg_shopify__order_adjustment.sql", "name": "stg_shopify__order_adjustment", "alias": "stg_shopify__order_adjustment", "checksum": {"name": "sha256", "checksum": "46da70e0f39c656244e8fb915416eb195ba18729dd920ae10ee8e19fad0c0151"}, "tags": [], "refs": [["stg_shopify__order_adjustment_tmp"], ["stg_shopify__order_adjustment_tmp"]], "sources": [], "description": "Each record represents and adjustment to and order within Shopify.", "columns": {"order_adjustment_id": {"name": "order_adjustment_id", "description": "The unique numeric identifier for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "Reference to the refund which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Amount of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount": {"name": "tax_amount", "description": "Tax amount applied to the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The kind of order adjustment (eg. refund, restock, etc.).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "The reason for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount_set": {"name": "amount_set", "description": "Amount set towards the order adjustment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount_set": {"name": "tax_amount_set", "description": "Tax amount set towards the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order_adjustment.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * \n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n id\n \n as order_adjustment_id , \n \n \n order_id\n \n as \n \n order_id\n \n, \n \n \n refund_id\n \n as \n \n refund_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n tax_amount\n \n as \n \n tax_amount\n \n, \n \n \n kind\n \n as \n \n kind\n \n, \n \n \n reason\n \n as \n \n reason\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n\n\n\n \n from source\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`"}, "model.shopify_source.stg_shopify__customer": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__customer_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__customer_tmp')),\n staging_columns=get_customer_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('customer_pass_through_columns') %}\n ,\n {{ var('customer_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_customer_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__customer_tmp", "model.shopify_source.stg_shopify__customer_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__customer"], "unique_id": "model.shopify_source.stg_shopify__customer", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__customer.sql", "original_file_path": "models/stg_shopify__customer.sql", "name": "stg_shopify__customer", "alias": "stg_shopify__customer", "checksum": {"name": "sha256", "checksum": "266d051984b96bb4f699dacb99811ddbcc05078ec34cd7ce2f0f117163d78e28"}, "tags": [], "refs": [["stg_shopify__customer_tmp"], ["stg_shopify__customer_tmp"]], "sources": [], "description": "Each record represents a customer in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_accepted_marketing": {"name": "has_accepted_marketing", "description": "Whether the customer has consented to receive marketing material via email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the customer was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_address_id": {"name": "default_address_id", "description": "The default address for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The customer's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "A unique identifier for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The customer's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orders_count": {"name": "orders_count", "description": "The number of orders associated with this customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_state": {"name": "account_state", "description": "The state of the customer's account with a shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_tax_exempt": {"name": "is_tax_exempt", "description": "Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_spent": {"name": "total_spent", "description": "The total amount of money that the customer has spent across their order history.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the customer information was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_verified_email": {"name": "is_verified_email", "description": "Whether the customer has verified their email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__customer.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n accepts_marketing\n \n as has_accepted_marketing , \n \n \n created_at\n \n as created_timestamp , \n \n \n default_address_id\n \n as \n \n default_address_id\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n id\n \n as customer_id , \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n orders_count\n \n as \n \n orders_count\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n state\n \n as account_state , \n \n \n tax_exempt\n \n as is_tax_exempt , \n \n \n total_spent\n \n as \n \n total_spent\n \n, \n \n \n updated_at\n \n as updated_timestamp , \n \n \n verified_email\n \n as is_verified_email \n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer`"}, "model.shopify_source.stg_shopify__order_line_refund": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_line_refund_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_line_refund_tmp')),\n staging_columns=get_order_line_refund_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_line_refund_pass_through_columns') %}\n ,\n {{ var('order_line_refund_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_line_refund_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund_tmp", "model.shopify_source.stg_shopify__order_line_refund_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line_refund"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "stg_shopify__order_line_refund.sql", "original_file_path": "models/stg_shopify__order_line_refund.sql", "name": "stg_shopify__order_line_refund", "alias": "stg_shopify__order_line_refund", "checksum": {"name": "sha256", "checksum": "299d1175d39aa9b204dc1cc358faa49285944c1955f34209cadfe4e97936a065"}, "tags": [], "refs": [["stg_shopify__order_line_refund_tmp"], ["stg_shopify__order_line_refund_tmp"]], "sources": [], "description": "Each record represents a line item from an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_refund_id": {"name": "order_line_refund_id", "description": "The unique identifier of the line item in the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "TThe unique identifier of the location where the items will be restockedBD", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the related line item in the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the associated line item that was returned.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID of the related refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock_type": {"name": "restock_type", "description": "How this refund line item affects inventory levels.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal": {"name": "subtotal", "description": "Subtotal amount of the order line refund", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The total tax applied to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/stg_shopify.yml", "build_path": "target/compiled/shopify_source/models/stg_shopify__order_line_refund.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "compiled_sql": "with source as (\n\n select * from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n id\n \n as order_line_refund_id , \n \n \n location_id\n \n as \n \n location_id\n \n, \n \n \n order_line_id\n \n as \n \n order_line_id\n \n, \n \n \n subtotal\n \n as \n \n subtotal\n \n, \n \n \n total_tax\n \n as \n \n total_tax\n \n, \n \n \n quantity\n \n as \n \n quantity\n \n, \n \n \n refund_id\n \n as \n \n refund_id\n \n, \n \n \n restock_type\n \n as \n \n restock_type\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`"}, "model.shopify_source.stg_shopify__customer_tmp": {"raw_sql": "select * \nfrom {{ var('customer_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_customer_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__customer_tmp"], "unique_id": "model.shopify_source.stg_shopify__customer_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__customer_tmp.sql", "original_file_path": "models/tmp/stg_shopify__customer_tmp.sql", "name": "stg_shopify__customer_tmp", "alias": "stg_shopify__customer_tmp", "checksum": {"name": "sha256", "checksum": "deaf49343836d3356ee206649fef0d98b18ec5bc641986c22f62023da7fff775"}, "tags": [], "refs": [["shopify_customer_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__customer_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_customer_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer_tmp`"}, "model.shopify_source.stg_shopify__order_line_tmp": {"raw_sql": "select * \nfrom {{ var('order_line_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_line_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_line_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_line_tmp.sql", "name": "stg_shopify__order_line_tmp", "alias": "stg_shopify__order_line_tmp", "checksum": {"name": "sha256", "checksum": "4f88b0914ec43445b81faff6b8be89de161ef6df43072b89abbecee6579406f8"}, "tags": [], "refs": [["shopify_order_line_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_line_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_tmp`"}, "model.shopify_source.stg_shopify__refund_tmp": {"raw_sql": "select * from {{ var('refund_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_refund_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__refund_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__refund_tmp.sql", "original_file_path": "models/tmp/stg_shopify__refund_tmp.sql", "name": "stg_shopify__refund_tmp", "alias": "stg_shopify__refund_tmp", "checksum": {"name": "sha256", "checksum": "b3f28d92902436cbadbd58025984940667683f3464d32b4ed4af9e4fee62b63f"}, "tags": [], "refs": [["shopify_refund_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__refund_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * from `dbt-package-testing`.`shopify_integration_tests`.`shopify_refund_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund_tmp`"}, "model.shopify_source.stg_shopify__product_tmp": {"raw_sql": "select * \nfrom {{ var('product_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_product_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__product_tmp.sql", "original_file_path": "models/tmp/stg_shopify__product_tmp.sql", "name": "stg_shopify__product_tmp", "alias": "stg_shopify__product_tmp", "checksum": {"name": "sha256", "checksum": "dffc13a21ff254e1da0215bf970c1a017dc97b3ce01213de77f5d9ec5ad55058"}, "tags": [], "refs": [["shopify_product_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__product_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_product_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_tmp`"}, "model.shopify_source.stg_shopify__order_adjustment_tmp": {"raw_sql": "select * from {{ var('order_adjustment_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_adjustment_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_adjustment_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_adjustment_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_adjustment_tmp.sql", "name": "stg_shopify__order_adjustment_tmp", "alias": "stg_shopify__order_adjustment_tmp", "checksum": {"name": "sha256", "checksum": "101e5ba755fa6754726a19e618a84d69b19292c1798cf7a95ff626403a6391fb"}, "tags": [], "refs": [["shopify_order_adjustment_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_adjustment_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * from `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_adjustment_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment_tmp`"}, "model.shopify_source.stg_shopify__order_line_refund_tmp": {"raw_sql": "select * \nfrom {{ var('order_line_refund_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_line_refund_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_line_refund_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_line_refund_tmp.sql", "name": "stg_shopify__order_line_refund_tmp", "alias": "stg_shopify__order_line_refund_tmp", "checksum": {"name": "sha256", "checksum": "c8fbe437524231390da877b9938924ba3c35eb512e66cd8170effef15f4c833d"}, "tags": [], "refs": [["shopify_order_line_refund_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_line_refund_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_line_refund_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund_tmp`"}, "model.shopify_source.stg_shopify__transaction_tmp": {"raw_sql": "select *\nfrom {{ var('transaction_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_transaction_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__transaction_tmp"], "unique_id": "model.shopify_source.stg_shopify__transaction_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__transaction_tmp.sql", "original_file_path": "models/tmp/stg_shopify__transaction_tmp.sql", "name": "stg_shopify__transaction_tmp", "alias": "stg_shopify__transaction_tmp", "checksum": {"name": "sha256", "checksum": "1ff90d82e3717cc2fed52f012d44b32b056f4557d7eacbf7bbd9939db945d218"}, "tags": [], "refs": [["shopify_transaction_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__transaction_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select *\nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_transaction_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction_tmp`"}, "model.shopify_source.stg_shopify__product_variant_tmp": {"raw_sql": "select * \nfrom {{ var('product_variant_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_product_variant_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_variant_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_variant_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__product_variant_tmp.sql", "original_file_path": "models/tmp/stg_shopify__product_variant_tmp.sql", "name": "stg_shopify__product_variant_tmp", "alias": "stg_shopify__product_variant_tmp", "checksum": {"name": "sha256", "checksum": "2fc5d907ac6851ad0c903c4582ad191688fb04b6d0675d69f26704a6bb52d1ce"}, "tags": [], "refs": [["shopify_product_variant_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__product_variant_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_product_variant_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant_tmp`"}, "model.shopify_source.stg_shopify__order_tmp": {"raw_sql": "select * \nfrom {{ var('order_source') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.shopify_source_integration_tests.shopify_order_data"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_tmp", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "tmp/stg_shopify__order_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_tmp.sql", "name": "stg_shopify__order_tmp", "alias": "stg_shopify__order_tmp", "checksum": {"name": "sha256", "checksum": "6366abc8eea74fea0832c0ad9084a1ddeb3f38409990d2cfdeff83c8b01f1e5f"}, "tags": [], "refs": [["shopify_order_data"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`shopify_integration_tests`.`shopify_order_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_tmp`"}, "test.shopify_source.unique_stg_shopify__customer_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_shopify__customer') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__customer"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__customer_customer_id"], "unique_id": "test.shopify_source.unique_stg_shopify__customer_customer_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__customer_customer_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__customer_customer_id", "alias": "unique_stg_shopify__customer_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__customer"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__customer_customer_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "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`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer`\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.shopify_source.not_null_stg_shopify__customer_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_shopify__customer') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__customer"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__customer_customer_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__customer_customer_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__customer_customer_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__customer_customer_id", "alias": "not_null_stg_shopify__customer_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__customer"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__customer_customer_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__customer`\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_line_refund_id", "model": "{{ ref('stg_shopify__order_line_refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_line_refund_order_line_refund_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_line_refund_order_line_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_line_refund_order_line_refund_id", "alias": "unique_stg_shopify__order_line_refund_order_line_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line_refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_line_refund_order_line_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_line_refund_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`\n where order_line_refund_id is not null\n group by order_line_refund_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_refund_id"}, "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_line_refund_id", "model": "{{ ref('stg_shopify__order_line_refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_line_refund_order_line_refund_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_line_refund_order_line_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_line_refund_order_line_refund_id", "alias": "not_null_stg_shopify__order_line_refund_order_line_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line_refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_line_refund_order_line_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`\nwhere order_line_refund_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_refund_id"}, "test.shopify_source.unique_stg_shopify__order_line_order_line_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_line_id", "model": "{{ ref('stg_shopify__order_line') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order_line"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_line_order_line_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_line_order_line_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_line_order_line_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_line_order_line_id", "alias": "unique_stg_shopify__order_line_order_line_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_line_order_line_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_line_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line`\n where order_line_id is not null\n group by order_line_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_id"}, "test.shopify_source.not_null_stg_shopify__order_line_order_line_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_line_id", "model": "{{ ref('stg_shopify__order_line') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order_line"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_line_order_line_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_line_order_line_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_line_order_line_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_line_order_line_id", "alias": "not_null_stg_shopify__order_line_order_line_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_line"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_line_order_line_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_line`\nwhere order_line_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_line_id"}, "test.shopify_source.unique_stg_shopify__order_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ ref('stg_shopify__order') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_order_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_order_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_order_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_order_id", "alias": "unique_stg_shopify__order_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_order_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order`\n where order_id is not null\n group by order_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.shopify_source.not_null_stg_shopify__order_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ ref('stg_shopify__order') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_order_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_order_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_order_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_order_id", "alias": "not_null_stg_shopify__order_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_order_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order`\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.shopify_source.unique_stg_shopify__product_product_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "product_id", "model": "{{ ref('stg_shopify__product') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__product"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__product_product_id"], "unique_id": "test.shopify_source.unique_stg_shopify__product_product_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__product_product_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__product_product_id", "alias": "unique_stg_shopify__product_product_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__product_product_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n product_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product`\n where product_id is not null\n group by product_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "product_id"}, "test.shopify_source.not_null_stg_shopify__product_product_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "product_id", "model": "{{ ref('stg_shopify__product') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__product"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__product_product_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__product_product_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__product_product_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__product_product_id", "alias": "not_null_stg_shopify__product_product_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__product_product_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product`\nwhere product_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "product_id"}, "test.shopify_source.not_null_stg_shopify__product_variant_variant_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "variant_id", "model": "{{ ref('stg_shopify__product_variant') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__product_variant"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__product_variant_variant_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__product_variant_variant_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__product_variant_variant_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__product_variant_variant_id", "alias": "not_null_stg_shopify__product_variant_variant_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product_variant"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__product_variant_variant_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant`\nwhere variant_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "variant_id"}, "test.shopify_source.unique_stg_shopify__product_variant_variant_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "variant_id", "model": "{{ ref('stg_shopify__product_variant') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__product_variant"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__product_variant_variant_id"], "unique_id": "test.shopify_source.unique_stg_shopify__product_variant_variant_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__product_variant_variant_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__product_variant_variant_id", "alias": "unique_stg_shopify__product_variant_variant_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__product_variant"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__product_variant_variant_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n variant_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__product_variant`\n where variant_id is not null\n group by variant_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "variant_id"}, "test.shopify_source.unique_stg_shopify__transaction_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_shopify__transaction') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__transaction"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__transaction_transaction_id"], "unique_id": "test.shopify_source.unique_stg_shopify__transaction_transaction_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__transaction_transaction_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__transaction_transaction_id", "alias": "unique_stg_shopify__transaction_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__transaction"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__transaction_transaction_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "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`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction`\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.shopify_source.not_null_stg_shopify__transaction_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_shopify__transaction') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__transaction"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__transaction_transaction_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__transaction_transaction_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__transaction_transaction_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__transaction_transaction_id", "alias": "not_null_stg_shopify__transaction_transaction_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__transaction"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__transaction_transaction_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__transaction`\nwhere transaction_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "transaction_id"}, "test.shopify_source.unique_stg_shopify__refund_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "refund_id", "model": "{{ ref('stg_shopify__refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__refund_refund_id"], "unique_id": "test.shopify_source.unique_stg_shopify__refund_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__refund_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__refund_refund_id", "alias": "unique_stg_shopify__refund_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__refund_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n refund_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund`\n where refund_id is not null\n group by refund_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "refund_id"}, "test.shopify_source.not_null_stg_shopify__refund_refund_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "refund_id", "model": "{{ ref('stg_shopify__refund') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__refund"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__refund_refund_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__refund_refund_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__refund_refund_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__refund_refund_id", "alias": "not_null_stg_shopify__refund_refund_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__refund_refund_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__refund`\nwhere refund_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "refund_id"}, "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_adjustment_id", "model": "{{ ref('stg_shopify__order_adjustment') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "unique_stg_shopify__order_adjustment_order_adjustment_id"], "unique_id": "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/unique_stg_shopify__order_adjustment_order_adjustment_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "unique_stg_shopify__order_adjustment_order_adjustment_id", "alias": "unique_stg_shopify__order_adjustment_order_adjustment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_adjustment"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/unique_stg_shopify__order_adjustment_order_adjustment_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n order_adjustment_id\n\n from `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`\n where order_adjustment_id is not null\n group by order_adjustment_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_adjustment_id"}, "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_adjustment_id", "model": "{{ ref('stg_shopify__order_adjustment') }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_integration_tests_stg_shopify", "fqn": ["shopify_source", "schema_test", "not_null_stg_shopify__order_adjustment_order_adjustment_id"], "unique_id": "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "schema_test/not_null_stg_shopify__order_adjustment_order_adjustment_id.sql", "original_file_path": "models/stg_shopify.yml", "name": "not_null_stg_shopify__order_adjustment_order_adjustment_id", "alias": "not_null_stg_shopify__order_adjustment_order_adjustment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_shopify__order_adjustment"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/shopify_source/models/stg_shopify.yml/schema_test/not_null_stg_shopify__order_adjustment_order_adjustment_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`shopify_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`\nwhere order_adjustment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_adjustment_id"}}, "sources": {"source.shopify_source.shopify.order": {"fqn": ["shopify_source", "shopify", "order"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": true, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The ID of the app that created the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_1": {"name": "billing_address_address_1", "description": "The street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_2": {"name": "billing_address_address_2", "description": "An optional additional field for the street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_city": {"name": "billing_address_city", "description": "The city, town, or village of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_company": {"name": "billing_address_company", "description": "The company of the person associated with the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country": {"name": "billing_address_country", "description": "The name of the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country_code": {"name": "billing_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_first_name": {"name": "billing_address_first_name", "description": "The first name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_last_name": {"name": "billing_address_last_name", "description": "The last name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_latitude": {"name": "billing_address_latitude", "description": "The latitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_longitude": {"name": "billing_address_longitude", "description": "The longitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_name": {"name": "billing_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_phone": {"name": "billing_address_phone", "description": "The phone number at the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province": {"name": "billing_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province_code": {"name": "billing_address_province_code", "description": "The two-letter abbreviation of the region of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_zip": {"name": "billing_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "browser_ip": {"name": "browser_ip", "description": "The IP address of the browser used by the customer when they placed the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "buyer_accepts_marketing": {"name": "buyer_accepts_marketing", "description": "Whether the customer consented to receive email updates from the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancel_reason": {"name": "cancel_reason", "description": "The reason why the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancelled_at": {"name": "cancelled_at", "description": "The date and time when the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cart_token": {"name": "cart_token", "description": "The ID of the cart that's associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The date and time when the order was closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The autogenerated date and time when the order was created in Shopify.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code for the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "The ID of the order's customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The customer's email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "financial_status": {"name": "financial_status", "description": "The status of payments associated with the order. Can only be set when the order is created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "The order's status in terms of fulfilled line items.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The ID of the order, used for API purposes. This is different from the order_number property, which is the ID used by the shop owner and customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "landing_site_base_url": {"name": "landing_site_base_url", "description": "The URL for the page where the buyer landed when they entered the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the order was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The order name, generated by combining the order_number property with the order prefix and suffix that are set in the merchant's general settings.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "An optional note that a shop owner can attach to the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The order's position in the shop's count of orders. Numbers are sequential and start at 1.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "The order 's position in the shop's count of orders starting at 1001. Order numbers are sequential and start at 1001.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "The date and time when an order was processed. This value is the date that appears on your orders and that's used in the analytic reports.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processing_method": {"name": "processing_method", "description": "How the payment was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "referring_site": {"name": "referring_site", "description": "The website where the customer clicked a link to the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_1": {"name": "shipping_address_address_1", "description": "The street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_2": {"name": "shipping_address_address_2", "description": "An optional additional field for the street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_city": {"name": "shipping_address_city", "description": "The city, town, or village of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_company": {"name": "shipping_address_company", "description": "The company of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country": {"name": "shipping_address_country", "description": "The name of the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country_code": {"name": "shipping_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_first_name": {"name": "shipping_address_first_name", "description": "The first name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_last_name": {"name": "shipping_address_last_name", "description": "The last name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_latitude": {"name": "shipping_address_latitude", "description": "The latitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_longitude": {"name": "shipping_address_longitude", "description": "The longitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_name": {"name": "shipping_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_phone": {"name": "shipping_address_phone", "description": "The phone number at the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province": {"name": "shipping_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province_code": {"name": "shipping_address_province_code", "description": "The two-letter abbreviation of the region of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_zip": {"name": "shipping_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "Where the order originated. Can be set only during order creation, and is not writeable afterwards.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal_price": {"name": "subtotal_price", "description": "The price of the order in the shop currency after discounts but before shipping, taxes, and tips.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxes_included": {"name": "taxes_included", "description": "Whether taxes are included in the order subtotal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether this is a test order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "token": {"name": "token", "description": "A unique token for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discounts": {"name": "total_discounts", "description": "The total discounts applied to the price of the order in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_line_items_price": {"name": "total_line_items_price", "description": "The sum of all line item prices in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The sum of all the taxes applied to the order in th shop currency. Must be positive).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_weight": {"name": "total_weight", "description": "The sum of all line item weights in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time (ISO 8601 format) when the order was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID of the user logged into Shopify POS who processed the order, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order`"}, "source.shopify_source.shopify.customer": {"fqn": ["shopify_source", "shopify", "customer"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.customer", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "customer", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "customer", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a customer in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accepts_marketing": {"name": "accepts_marketing", "description": "Whether the customer has consented to receive marketing material via email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time when the customer was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_address_id": {"name": "default_address_id", "description": "The default address for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The customer's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "A unique identifier for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The customer's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orders_count": {"name": "orders_count", "description": "The number of orders associated with this customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the customer's account with a shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_exempt": {"name": "tax_exempt", "description": "Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_spent": {"name": "total_spent", "description": "The total amount of money that the customer has spent across their order history.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the customer information was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "verified_email": {"name": "verified_email", "description": "Whether the customer has verified their email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`customer`"}, "source.shopify_source.shopify.order_line": {"fqn": ["shopify_source", "shopify", "order_line"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_line", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_line", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_line", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a line item for an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillable_quantity": {"name": "fulfillable_quantity", "description": "The amount available to fulfill, calculated as follows: quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The service provider that's fulfilling the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "How far along an order is in terms line items fulfilled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gift_card": {"name": "gift_card", "description": "Whether the item is a gift card. If true, then the item is not taxed or considered for shipping charges.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the item in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The ID of the line item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the related order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the item before discounts have been applied in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The ID of the product that the line item belongs to. Can be null if the original product associated with the order is deleted at a later date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of items that were purchased.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requires_shipping": {"name": "requires_shipping", "description": "Whether the item requires shipping.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "The item's SKU (stock keeping unit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxable": {"name": "taxable", "description": "Whether the item was taxable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discount": {"name": "total_discount", "description": "The total amount of the discount allocated to the line item in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The ID of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the item's supplier.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order_line`"}, "source.shopify_source.shopify.order_line_refund": {"fqn": ["shopify_source", "shopify", "order_line_refund"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_line_refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_line_refund", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_line_refund", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a line item refund in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The unique identifier of the line item in the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "TThe unique identifier of the location where the items will be restockedBD", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the related line item in the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the associated line item that was returned.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID of the related refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock_type": {"name": "restock_type", "description": "How this refund line item affects inventory levels.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal": {"name": "subtotal", "description": "Subtotal amount of the order line refund", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The total tax applied to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order_line_refund`"}, "source.shopify_source.shopify.product": {"fqn": ["shopify_source", "shopify", "product"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.product", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "product", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "product", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a product in Shopify.", "columns": {"_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Whether the record has been deleted in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time when the product was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "handle": {"name": "handle", "description": "A unique human-friendly string for the product. Automatically generated from the product's title.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "An unsigned 64-bit integer that's used as a unique identifier for the product. Each id is unique across the Shopify system. No two products will have the same id, even if they're from different shops.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_type": {"name": "product_type", "description": "A categorization for the product used for filtering and searching products.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_at": {"name": "published_at", "description": "The date and time (ISO 8601 format) when the product was published. Can be set to null to unpublish the product from the Online Store channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_scope": {"name": "published_scope", "description": "Whether the product is published to the Point of Sale channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The name of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the product was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the product's vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`product`"}, "source.shopify_source.shopify.product_variant": {"fqn": ["shopify_source", "shopify", "product_variant"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.product_variant", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "product_variant", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "product_variant", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a product variant in Shopify", "columns": {"barcode": {"name": "barcode", "description": "The barcode, UPC, or ISBN number for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "compare_at_price": {"name": "compare_at_price", "description": "The original price of the item before an adjustment or a sale.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time (ISO 8601 format) when the product variant was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The fulfillment service associated with the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the product variant in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The unique numeric identifier for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "image_id": {"name": "image_id", "description": "The unique numeric identifier for a product's image. The image must be associated to the same product as the variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_item_id": {"name": "inventory_item_id", "description": "The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_management": {"name": "inventory_management", "description": "The fulfillment service that tracks the number of items in stock for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_policy": {"name": "inventory_policy", "description": "Whether customers are allowed to place an order for the product variant when it's out of stock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_quantity": {"name": "inventory_quantity", "description": "An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "old_inventory_quantity": {"name": "old_inventory_quantity", "description": "This property is deprecated. Use the InventoryLevel resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_1": {"name": "option_1", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_2": {"name": "option_2", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_3": {"name": "option_3", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The order of the product variant in the list of product variants. The first position in the list is 1. The position of variants is indicated by the order in which they are listed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The unique numeric identifier for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requires_shipping": {"name": "requires_shipping", "description": "This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxable": {"name": "taxable", "description": "Whether a tax is charged when the product variant is sold.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_code": {"name": "tax_code", "description": "This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product variant. The title field is a concatenation of the option1, option2, and option3 fields. You can only update title indirectly using the option fields.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the product variant was last modified. Gets returned in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight": {"name": "weight", "description": "The weight of the product variant in the unit system specified with weight_unit.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight_unit": {"name": "weight_unit", "description": "The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_shipping_price_set": {"name": "total_shipping_price_set", "description": "The total shipping price set for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "index": {"name": "index", "description": "The index associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pre_tax_price": {"name": "pre_tax_price", "description": "The total pre tax price of the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`product_variant`"}, "source.shopify_source.shopify.transaction": {"fqn": ["shopify_source", "shopify", "transaction"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.transaction", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "transaction", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "transaction", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a transaction in Shopify.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The ID for the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID for the order that the transaction is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID associated with a refund in the refund table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of money included in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authorization": {"name": "authorization", "description": "The authorization code associated with the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the transaction was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when a transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device_id": {"name": "device_id", "description": "The ID for the device.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gateway": {"name": "gateway", "description": "The name of the gateway the transaction was issued through.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "The origin of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "message": {"name": "message", "description": "A string generated by the payment provider with additional information about why the transaction succeeded or failed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code (ISO 4217 format) for the currency used for the payment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The ID of an associated transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_avs_result_code": {"name": "payment_avs_result_code", "description": "The response code from the address verification system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_bin": {"name": "payment_credit_card_bin", "description": "The issuer identification number (IIN), formerly known as bank identification number (BIN) of the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_cvv_result_code": {"name": "payment_cvv_result_code", "description": "The response code from the credit card company indicating whether the customer entered the card security code, or card verification value, correctly.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_number": {"name": "payment_credit_card_number", "description": "The customer's credit card number, with most of the leading digits redacted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_company": {"name": "payment_credit_card_company", "description": "The name of the company that issued the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The transaction's type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "receipt": {"name": "receipt", "description": "A transaction receipt attached to the transaction by the gateway.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_id": {"name": "currency_exchange_id", "description": "The ID of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_adjustment": {"name": "currency_exchange_adjustment", "description": "The difference between the amounts on the associated transaction and the parent transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_original_amount": {"name": "currency_exchange_original_amount", "description": "The amount of the parent transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_final_amount": {"name": "currency_exchange_final_amount", "description": "The amount of the associated transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_currency": {"name": "currency_exchange_currency", "description": "The shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "error_code": {"name": "error_code", "description": "A standardized error code, independent of the payment provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether the transaction is a test transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`transaction`"}, "source.shopify_source.shopify.refund": {"fqn": ["shopify_source", "shopify", "refund"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.refund", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "refund", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "refund", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents a refund within Shopify.", "columns": {"id": {"name": "id", "description": "The unique numeric identifier for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of the date when the refund was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "Timestamp of the date when the refund was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "User generated note attached to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock": {"name": "restock", "description": "Boolean indicating if the refund is a result of a restock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Reference to the user id which generated the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_duties_set": {"name": "total_duties_set", "description": "Record representing total duties set for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the refund is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`refund`"}, "source.shopify_source.shopify.order_adjustment": {"fqn": ["shopify_source", "shopify", "order_adjustment"], "database": "dbt-package-testing", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_adjustment", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_adjustment", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_adjustment", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": null, "error_after": null, "filter": null}, "external": null, "description": "Each record represents and adjustment to and order within Shopify.", "columns": {"id": {"name": "id", "description": "The unique numeric identifier for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "Reference to the refund which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Amount of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount": {"name": "tax_amount", "description": "Tax amount applied to the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The kind of order adjustment (eg. refund, restock, etc.).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "The reason for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount_set": {"name": "amount_set", "description": "Amount set towards the order adjustment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount_set": {"name": "tax_amount_set", "description": "Tax amount set towards the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`shopify`.`order_adjustment`"}}, "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.shopify_source.get_order_columns": {"unique_id": "macro.shopify_source.get_order_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_columns", "macro_sql": "{% macro get_order_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"billing_address_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_address_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_latitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_longitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_province\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_province_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"browser_ip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"buyer_accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_buyer_accepted_marketing\"},\n {\"name\": \"cancel_reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"cancelled_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"cancelled_timestamp\"},\n {\"name\": \"cart_token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"checkout_token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"closed_timestamp\"},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customer_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"financial_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_id\"},\n {\"name\": \"landing_site_base_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"note\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"number\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"order_number\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"processing_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"referring_site\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_shipping_price_set\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_address_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_latitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_longitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_province\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_province_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"source_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subtotal_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"taxes_included\", \"datatype\": \"boolean\", \"alias\": \"has_taxes_included\"},\n {\"name\": \"test\", \"datatype\": \"boolean\", \"alias\": \"is_test_order\"},\n {\"name\": \"token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_discounts\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_line_items_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_tax\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_weight\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()}\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.shopify_source.get_customer_columns": {"unique_id": "macro.shopify_source.get_customer_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_customer_columns", "macro_sql": "{% macro get_customer_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_accepted_marketing\"},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"default_address_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"customer_id\"},\n {\"name\": \"last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"orders_count\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string(), \"alias\": \"account_state\"},\n {\"name\": \"tax_exempt\", \"datatype\": \"boolean\", \"alias\": \"is_tax_exempt\"},\n {\"name\": \"total_spent\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"verified_email\", \"datatype\": \"boolean\", \"alias\": \"is_verified_email\"}\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.shopify_source.get_order_line_refund_columns": {"unique_id": "macro.shopify_source.get_order_line_refund_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_line_refund_columns", "macro_sql": "{% macro get_order_line_refund_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_line_refund_id\"},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"order_line_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"subtotal\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"total_tax\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"restock_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.shopify_source.get_order_line_columns": {"unique_id": "macro.shopify_source.get_order_line_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_line_columns", "macro_sql": "{% macro get_order_line_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"fulfillable_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"gift_card\", \"datatype\": \"boolean\", \"alias\": \"is_gift_card\"},\n {\"name\": \"grams\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_line_id\"},\n {\"name\": \"index\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"pre_tax_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"product_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_charge_interval_frequency\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_for_shipping_jan_3_rd_2020\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"property_shipping_interval_frequency\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_shipping_interval_unit_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"property_subscription_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"requires_shipping\", \"datatype\": \"boolean\", \"alias\": \"is_requiring_shipping\"},\n {\"name\": \"sku\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_discount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"variant_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"vendor\", \"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.shopify_source.get_product_columns": {"unique_id": "macro.shopify_source.get_product_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_product_columns", "macro_sql": "{% macro get_product_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"handle\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"product_id\"},\n {\"name\": \"product_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"published_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"published_timestamp\"},\n {\"name\": \"published_scope\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"vendor\", \"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.shopify_source.get_product_variant_columns": {"unique_id": "macro.shopify_source.get_product_variant_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_product_variant_columns", "macro_sql": "{% macro get_product_variant_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"variant_id\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"product_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"inventory_item_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"image_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"sku\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"position\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"inventory_policy\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"compare_at_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inventory_management\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"barcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"grams\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"inventory_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"weight\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"weight_unit\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_3\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"old_inventory_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"requires_shipping\", \"datatype\": \"boolean\", \"alias\": \"is_requiring_shipping\"}\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.shopify_source.get_transaction_columns": {"unique_id": "macro.shopify_source.get_transaction_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_transaction_columns", "macro_sql": "{% macro get_transaction_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"transaction_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"device_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"gateway\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"source_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"message\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"payment_avs_result_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_bin\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_cvv_result_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"kind\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"receipt\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency_exchange_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_adjustment\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_original_amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_final_amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"test\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{% if target.type in ('redshift','postgres') %}\n {{ columns.append({\"name\": \"authorization\", \"datatype\": dbt_utils.type_string(), \"quote\": True, \"alias\": \"authorization\"}) }}\n{% else %}\n {\"name\": \"authorization\", \"datatype\": dbt_utils.type_string()}\n{% endif %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.shopify_source.get_refund_columns": {"unique_id": "macro.shopify_source.get_refund_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_refund_columns", "macro_sql": "{% macro get_refund_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"refund_id\"},\n {\"name\": \"note\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"restock\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()}\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.shopify_source.get_order_adjustment_columns": {"unique_id": "macro.shopify_source.get_order_adjustment_columns", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_adjustment_columns", "macro_sql": "{% macro get_order_adjustment_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_adjustment_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"kind\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()}\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.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/geo/haversine_distance.sql", "original_file_path": "macros/geo/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1,lon1,lat2,lon2) -%}\n {{ return(adapter.dispatch('haversine_distance', packages = dbt_utils._get_utils_namespaces())(lat1,lon1,lat2,lon2)) }}\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/Shopify/dbt_shopify_source/integration_tests/dbt_modules/dbt_utils", "path": "macros/geo/haversine_distance.sql", "original_file_path": "macros/geo/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1,lon1,lat2,lon2) -%}\n\n 2 * 3961 * asin(sqrt((sin(radians(({{lat2}} - {{lat1}}) / 2))) ^ 2 +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n (sin(radians(({{lon2}} - {{lon1}}) / 2))) ^ 2))\n\n{%- endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 {{ column_name }}\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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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\nwith meet_condition as (\n\n select * from {{ model }} where {{ condition }}\n\n),\nvalidation_errors as (\n\n select\n *\n from meet_condition\n where not({{expression}})\n\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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') %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', packages = dbt_utils._get_utils_namespaces())(model, lower_bound_column, upper_bound_column, partition_by, gaps)) }}\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/Shopify/dbt_shopify_source/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') %}\n\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }},\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions nore cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound < upper_bound,\n false\n ) as lower_bound_less_than_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_less_than_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect count(*) from validation_errors\n{% endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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({{ col.column }} as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.spark_utils.spark__type_numeric": {"unique_id": "macro.spark_utils.spark__type_numeric", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "name": "spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__dateadd": {"unique_id": "macro.spark_utils.spark__dateadd", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "name": "spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }}, {{interval}} * {{multiplier}})\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n {{interval}} * {{multiplier}}\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + {{interval}} * {{multiplier}}\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__datediff": {"unique_id": "macro.spark_utils.spark__datediff", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "name": "spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', second_date) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', first_date) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', second_date) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', first_date) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__current_timestamp": {"unique_id": "macro.spark_utils.spark__current_timestamp", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__current_timestamp_in_utc": {"unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__split_part": {"unique_id": "macro.spark_utils.spark__split_part", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "name": "spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_relations_by_pattern": {"unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_relations_by_prefix": {"unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_tables_by_pattern": {"unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__get_tables_by_prefix": {"unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.assert_not_null": {"unique_id": "macro.spark_utils.assert_not_null", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.spark_utils.spark__convert_timezone": {"unique_id": "macro.spark_utils.spark__convert_timezone", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "name": "spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 explode(from_json( {{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.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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 == 'bigquery' %}\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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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/Shopify/dbt_shopify_source/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."}, "shopify_source._fivetran_synced": {"unique_id": "shopify_source._fivetran_synced", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Shopify/dbt_shopify_source/integration_tests/dbt_modules/shopify_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "_fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "selectors": {}, "disabled": [], "parent_map": {"seed.shopify_source_integration_tests.shopify_order_data": [], "seed.shopify_source_integration_tests.shopify_order_line_refund_data": [], "seed.shopify_source_integration_tests.shopify_order_adjustment_data": [], "seed.shopify_source_integration_tests.shopify_product_variant_data": [], "seed.shopify_source_integration_tests.shopify_refund_data": [], "seed.shopify_source_integration_tests.shopify_transaction_data": [], "seed.shopify_source_integration_tests.shopify_product_data": [], "seed.shopify_source_integration_tests.shopify_customer_data": [], "seed.shopify_source_integration_tests.shopify_order_line_data": [], "model.shopify_source.stg_shopify__order_line": ["model.shopify_source.stg_shopify__order_line_tmp", "model.shopify_source.stg_shopify__order_line_tmp"], "model.shopify_source.stg_shopify__refund": ["model.shopify_source.stg_shopify__refund_tmp", "model.shopify_source.stg_shopify__refund_tmp"], "model.shopify_source.stg_shopify__product": ["model.shopify_source.stg_shopify__product_tmp", "model.shopify_source.stg_shopify__product_tmp"], "model.shopify_source.stg_shopify__product_variant": ["model.shopify_source.stg_shopify__product_variant_tmp", "model.shopify_source.stg_shopify__product_variant_tmp"], "model.shopify_source.stg_shopify__order": ["model.shopify_source.stg_shopify__order_tmp", "model.shopify_source.stg_shopify__order_tmp"], "model.shopify_source.stg_shopify__transaction": ["model.shopify_source.stg_shopify__transaction_tmp", "model.shopify_source.stg_shopify__transaction_tmp"], "model.shopify_source.stg_shopify__order_adjustment": ["model.shopify_source.stg_shopify__order_adjustment_tmp", "model.shopify_source.stg_shopify__order_adjustment_tmp"], "model.shopify_source.stg_shopify__customer": ["model.shopify_source.stg_shopify__customer_tmp", "model.shopify_source.stg_shopify__customer_tmp"], "model.shopify_source.stg_shopify__order_line_refund": ["model.shopify_source.stg_shopify__order_line_refund_tmp", "model.shopify_source.stg_shopify__order_line_refund_tmp"], "model.shopify_source.stg_shopify__customer_tmp": ["seed.shopify_source_integration_tests.shopify_customer_data"], "model.shopify_source.stg_shopify__order_line_tmp": ["seed.shopify_source_integration_tests.shopify_order_line_data"], "model.shopify_source.stg_shopify__refund_tmp": ["seed.shopify_source_integration_tests.shopify_refund_data"], "model.shopify_source.stg_shopify__product_tmp": ["seed.shopify_source_integration_tests.shopify_product_data"], "model.shopify_source.stg_shopify__order_adjustment_tmp": ["seed.shopify_source_integration_tests.shopify_order_adjustment_data"], "model.shopify_source.stg_shopify__order_line_refund_tmp": ["seed.shopify_source_integration_tests.shopify_order_line_refund_data"], "model.shopify_source.stg_shopify__transaction_tmp": ["seed.shopify_source_integration_tests.shopify_transaction_data"], "model.shopify_source.stg_shopify__product_variant_tmp": ["seed.shopify_source_integration_tests.shopify_product_variant_data"], "model.shopify_source.stg_shopify__order_tmp": ["seed.shopify_source_integration_tests.shopify_order_data"], "test.shopify_source.unique_stg_shopify__customer_customer_id": ["model.shopify_source.stg_shopify__customer"], "test.shopify_source.not_null_stg_shopify__customer_customer_id": ["model.shopify_source.stg_shopify__customer"], "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id": ["model.shopify_source.stg_shopify__order_line_refund"], "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id": ["model.shopify_source.stg_shopify__order_line_refund"], "test.shopify_source.unique_stg_shopify__order_line_order_line_id": ["model.shopify_source.stg_shopify__order_line"], "test.shopify_source.not_null_stg_shopify__order_line_order_line_id": ["model.shopify_source.stg_shopify__order_line"], "test.shopify_source.unique_stg_shopify__order_order_id": ["model.shopify_source.stg_shopify__order"], "test.shopify_source.not_null_stg_shopify__order_order_id": ["model.shopify_source.stg_shopify__order"], "test.shopify_source.unique_stg_shopify__product_product_id": ["model.shopify_source.stg_shopify__product"], "test.shopify_source.not_null_stg_shopify__product_product_id": ["model.shopify_source.stg_shopify__product"], "test.shopify_source.not_null_stg_shopify__product_variant_variant_id": ["model.shopify_source.stg_shopify__product_variant"], "test.shopify_source.unique_stg_shopify__product_variant_variant_id": ["model.shopify_source.stg_shopify__product_variant"], "test.shopify_source.unique_stg_shopify__transaction_transaction_id": ["model.shopify_source.stg_shopify__transaction"], "test.shopify_source.not_null_stg_shopify__transaction_transaction_id": ["model.shopify_source.stg_shopify__transaction"], "test.shopify_source.unique_stg_shopify__refund_refund_id": ["model.shopify_source.stg_shopify__refund"], "test.shopify_source.not_null_stg_shopify__refund_refund_id": ["model.shopify_source.stg_shopify__refund"], "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id": ["model.shopify_source.stg_shopify__order_adjustment"], "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id": ["model.shopify_source.stg_shopify__order_adjustment"], "source.shopify_source.shopify.order": [], "source.shopify_source.shopify.customer": [], "source.shopify_source.shopify.order_line": [], "source.shopify_source.shopify.order_line_refund": [], "source.shopify_source.shopify.product": [], "source.shopify_source.shopify.product_variant": [], "source.shopify_source.shopify.transaction": [], "source.shopify_source.shopify.refund": [], "source.shopify_source.shopify.order_adjustment": []}, "child_map": {"seed.shopify_source_integration_tests.shopify_order_data": ["model.shopify_source.stg_shopify__order_tmp"], "seed.shopify_source_integration_tests.shopify_order_line_refund_data": ["model.shopify_source.stg_shopify__order_line_refund_tmp"], "seed.shopify_source_integration_tests.shopify_order_adjustment_data": ["model.shopify_source.stg_shopify__order_adjustment_tmp"], "seed.shopify_source_integration_tests.shopify_product_variant_data": ["model.shopify_source.stg_shopify__product_variant_tmp"], "seed.shopify_source_integration_tests.shopify_refund_data": ["model.shopify_source.stg_shopify__refund_tmp"], "seed.shopify_source_integration_tests.shopify_transaction_data": ["model.shopify_source.stg_shopify__transaction_tmp"], "seed.shopify_source_integration_tests.shopify_product_data": ["model.shopify_source.stg_shopify__product_tmp"], "seed.shopify_source_integration_tests.shopify_customer_data": ["model.shopify_source.stg_shopify__customer_tmp"], "seed.shopify_source_integration_tests.shopify_order_line_data": ["model.shopify_source.stg_shopify__order_line_tmp"], "model.shopify_source.stg_shopify__order_line": ["test.shopify_source.not_null_stg_shopify__order_line_order_line_id", "test.shopify_source.unique_stg_shopify__order_line_order_line_id"], "model.shopify_source.stg_shopify__refund": ["test.shopify_source.not_null_stg_shopify__refund_refund_id", "test.shopify_source.unique_stg_shopify__refund_refund_id"], "model.shopify_source.stg_shopify__product": ["test.shopify_source.not_null_stg_shopify__product_product_id", "test.shopify_source.unique_stg_shopify__product_product_id"], "model.shopify_source.stg_shopify__product_variant": ["test.shopify_source.not_null_stg_shopify__product_variant_variant_id", "test.shopify_source.unique_stg_shopify__product_variant_variant_id"], "model.shopify_source.stg_shopify__order": ["test.shopify_source.not_null_stg_shopify__order_order_id", "test.shopify_source.unique_stg_shopify__order_order_id"], "model.shopify_source.stg_shopify__transaction": ["test.shopify_source.not_null_stg_shopify__transaction_transaction_id", "test.shopify_source.unique_stg_shopify__transaction_transaction_id"], "model.shopify_source.stg_shopify__order_adjustment": ["test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id", "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id"], "model.shopify_source.stg_shopify__customer": ["test.shopify_source.not_null_stg_shopify__customer_customer_id", "test.shopify_source.unique_stg_shopify__customer_customer_id"], "model.shopify_source.stg_shopify__order_line_refund": ["test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id", "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id"], "model.shopify_source.stg_shopify__customer_tmp": ["model.shopify_source.stg_shopify__customer", "model.shopify_source.stg_shopify__customer"], "model.shopify_source.stg_shopify__order_line_tmp": ["model.shopify_source.stg_shopify__order_line", "model.shopify_source.stg_shopify__order_line"], "model.shopify_source.stg_shopify__refund_tmp": ["model.shopify_source.stg_shopify__refund", "model.shopify_source.stg_shopify__refund"], "model.shopify_source.stg_shopify__product_tmp": ["model.shopify_source.stg_shopify__product", "model.shopify_source.stg_shopify__product"], "model.shopify_source.stg_shopify__order_adjustment_tmp": ["model.shopify_source.stg_shopify__order_adjustment", "model.shopify_source.stg_shopify__order_adjustment"], "model.shopify_source.stg_shopify__order_line_refund_tmp": ["model.shopify_source.stg_shopify__order_line_refund", "model.shopify_source.stg_shopify__order_line_refund"], "model.shopify_source.stg_shopify__transaction_tmp": ["model.shopify_source.stg_shopify__transaction", "model.shopify_source.stg_shopify__transaction"], "model.shopify_source.stg_shopify__product_variant_tmp": ["model.shopify_source.stg_shopify__product_variant", "model.shopify_source.stg_shopify__product_variant"], "model.shopify_source.stg_shopify__order_tmp": ["model.shopify_source.stg_shopify__order", "model.shopify_source.stg_shopify__order"], "test.shopify_source.unique_stg_shopify__customer_customer_id": [], "test.shopify_source.not_null_stg_shopify__customer_customer_id": [], "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id": [], "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id": [], "test.shopify_source.unique_stg_shopify__order_line_order_line_id": [], "test.shopify_source.not_null_stg_shopify__order_line_order_line_id": [], "test.shopify_source.unique_stg_shopify__order_order_id": [], "test.shopify_source.not_null_stg_shopify__order_order_id": [], "test.shopify_source.unique_stg_shopify__product_product_id": [], "test.shopify_source.not_null_stg_shopify__product_product_id": [], "test.shopify_source.not_null_stg_shopify__product_variant_variant_id": [], "test.shopify_source.unique_stg_shopify__product_variant_variant_id": [], "test.shopify_source.unique_stg_shopify__transaction_transaction_id": [], "test.shopify_source.not_null_stg_shopify__transaction_transaction_id": [], "test.shopify_source.unique_stg_shopify__refund_refund_id": [], "test.shopify_source.not_null_stg_shopify__refund_refund_id": [], "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id": [], "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id": [], "source.shopify_source.shopify.order": [], "source.shopify_source.shopify.customer": [], "source.shopify_source.shopify.order_line": [], "source.shopify_source.shopify.order_line_refund": [], "source.shopify_source.shopify.product": [], "source.shopify_source.shopify.product_variant": [], "source.shopify_source.shopify.transaction": [], "source.shopify_source.shopify.refund": [], "source.shopify_source.shopify.order_adjustment": []}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v4.json", "dbt_version": "1.0.0", "generated_at": "2022-05-19T22:46:29.363523Z", "invocation_id": "f94df570-e221-4bfd-af9e-b64be047c3b8", "env": {}, "project_id": "a19ea622182c63ddc19bb22cde982b82", "user_id": "e607f749-4294-4b15-833b-0ae4a87d4d24", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"model.develop.my_first_dbt_model": {"raw_sql": "/*\n Welcome to your first dbt model!\n Did you know that you can also configure models directly within SQL files?\n This will override configurations stated in dbt_project.yml\n\n Try changing \"table\" to \"view\" below\n*/\n\n{{ config(materialized='table') }}\n\nwith source_data as (\n\n select 1 as id\n union all\n select null as id\n\n)\n\nselect *\nfrom source_data\n\n/*\n Uncomment the line below to remove records with null `id` values\n*/\n\n-- where id is not null", "resource_type": "model", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee", "fqn": ["develop", "example", "my_first_dbt_model"], "unique_id": "model.develop.my_first_dbt_model", "package_name": "develop", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop", "path": "example/my_first_dbt_model.sql", "original_file_path": "models/example/my_first_dbt_model.sql", "name": "my_first_dbt_model", "alias": "my_first_dbt_model", "checksum": {"name": "sha256", "checksum": "842251f5ed1d97920d3748d9686b8c05a3a0071ec7990f948f36796491788aed"}, "tags": [], "refs": [], "sources": [], "description": "A starter dbt model", "columns": {"id": {"name": "id", "description": "The primary key for this table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "develop://models/example/schema.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1653000361.21139}, "model.develop.my_second_dbt_model": {"raw_sql": "-- Use the `ref` function to select from other models\n\nselect *\nfrom {{ ref('my_first_dbt_model') }}\nwhere id = 1", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.develop.my_first_dbt_model"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee", "fqn": ["develop", "example", "my_second_dbt_model"], "unique_id": "model.develop.my_second_dbt_model", "package_name": "develop", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop", "path": "example/my_second_dbt_model.sql", "original_file_path": "models/example/my_second_dbt_model.sql", "name": "my_second_dbt_model", "alias": "my_second_dbt_model", "checksum": {"name": "sha256", "checksum": "b3aa346f283f3c9c9a75936f3b80d2572ca9ab39aee4c02b30553d3fe2ba5692"}, "tags": [], "refs": [["my_first_dbt_model"]], "sources": [], "description": "A starter dbt model", "columns": {"id": {"name": "id", "description": "The primary key for this table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "develop://models/example/schema.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1653000361.212539}, "model.shopify_source.stg_shopify__order_line": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_line_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_line_tmp')),\n staging_columns=get_order_line_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_line_pass_through_columns') %}\n ,\n {{ var('order_line_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n {{ fivetran_utils.source_relation(\n union_schema_variable='shopify_union_schemas', \n union_database_variable='shopify_union_databases') \n }}\n\n from source\n\n)\n\nselect * from renamed", "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_line_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.shopify_source.stg_shopify__order_line_tmp", "model.shopify_source.stg_shopify__order_line_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line"], "unique_id": "model.shopify_source.stg_shopify__order_line", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "stg_shopify__order_line.sql", "original_file_path": "models/stg_shopify__order_line.sql", "name": "stg_shopify__order_line", "alias": "stg_shopify__order_line", "checksum": {"name": "sha256", "checksum": "bb641f0d784534dc9d6d86bda3391b7c905b0a739c6cf34ef60e4716b5fd86ce"}, "tags": [], "refs": [["stg_shopify__order_line_tmp"], ["stg_shopify__order_line_tmp"]], "sources": [], "description": "Each record represents a line item from an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillable_quantity": {"name": "fulfillable_quantity", "description": "The amount available to fulfill, calculated as follows: quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The service provider that's fulfilling the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "How far along an order is in terms line items fulfilled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_gift_card": {"name": "is_gift_card", "description": "Whether the item is a gift card. If true, then the item is not taxed or considered for shipping charges.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the item in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the line item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the related order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the item before discounts have been applied in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The ID of the product that the line item belongs to. Can be null if the original product associated with the order is deleted at a later date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of items that were purchased.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_requiring_shipping": {"name": "is_requiring_shipping", "description": "Whether the item requires shipping.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "The item's SKU (stock keeping unit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_taxable": {"name": "is_taxable", "description": "Whether the item was taxable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discount": {"name": "total_discount", "description": "The total amount of the discount allocated to the line item in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The ID of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the item's supplier.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1653000361.2544692}, "model.shopify_source.stg_shopify__refund": {"raw_sql": "--To disable this model, set the shopify__using_refund variable within your dbt_project.yml file to False.\n{{ config(enabled=var('shopify__using_refund', True)) }}\n\nwith source as (\n\n select * \n from {{ ref('stg_shopify__refund_tmp') }}\n\n),\n\nrenamed as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__refund_tmp')),\n staging_columns=get_refund_columns()\n )\n }}\n\n {{ fivetran_utils.source_relation(\n union_schema_variable='shopify_union_schemas', \n union_database_variable='shopify_union_databases') \n }}\n \n from source\n)\n\nselect * from renamed", "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_refund_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.shopify_source.stg_shopify__refund_tmp", "model.shopify_source.stg_shopify__refund_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "stg_shopify__refund"], "unique_id": "model.shopify_source.stg_shopify__refund", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "stg_shopify__refund.sql", "original_file_path": "models/stg_shopify__refund.sql", "name": "stg_shopify__refund", "alias": "stg_shopify__refund", "checksum": {"name": "sha256", "checksum": "db92848ca19e65385f44b51e662bc9a3c773fecefe896cbddd1f23d22d078e82"}, "tags": [], "refs": [["stg_shopify__refund_tmp"], ["stg_shopify__refund_tmp"]], "sources": [], "description": "Each record represents a refund within Shopify.", "columns": {"refund_id": {"name": "refund_id", "description": "The unique numeric identifier for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of the date when the refund was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "Timestamp of the date when the refund was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "User generated note attached to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock": {"name": "restock", "description": "Boolean indicating if the refund is a result of a restock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Reference to the user id which generated the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_duties_set": {"name": "total_duties_set", "description": "Record representing total duties set for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the refund is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "enabled": true}, "created_at": 1653000361.311957}, "model.shopify_source.stg_shopify__product": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__product_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__product_tmp')),\n staging_columns=get_product_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('product_pass_through_columns') %}\n ,\n {{ var('product_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n {{ fivetran_utils.source_relation(\n union_schema_variable='shopify_union_schemas', \n union_database_variable='shopify_union_databases') \n }}\n\n from source\n\n)\n\nselect * from renamed", "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_product_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.shopify_source.stg_shopify__product_tmp", "model.shopify_source.stg_shopify__product_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product"], "unique_id": "model.shopify_source.stg_shopify__product", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "stg_shopify__product.sql", "original_file_path": "models/stg_shopify__product.sql", "name": "stg_shopify__product", "alias": "stg_shopify__product", "checksum": {"name": "sha256", "checksum": "dd30ab5bbf28fc246f4d4625c8057bd05f59c9e8f115d8c72f301b22236b59eb"}, "tags": [], "refs": [["stg_shopify__product_tmp"], ["stg_shopify__product_tmp"]], "sources": [], "description": "Each record represents a product in Shopify.", "columns": {"_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Whether the record has been deleted in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the product was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "handle": {"name": "handle", "description": "A unique human-friendly string for the product. Automatically generated from the product's title.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "An unsigned 64-bit integer that's used as a unique identifier for the product. Each id is unique across the Shopify system. No two products will have the same id, even if they're from different shops.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_type": {"name": "product_type", "description": "A categorization for the product used for filtering and searching products.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_timestamp": {"name": "published_timestamp", "description": "The date and time (ISO 8601 format) when the product was published. Can be set to null to unpublish the product from the Online Store channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_scope": {"name": "published_scope", "description": "Whether the product is published to the Point of Sale channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The name of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the product was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the product's vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1653000361.28579}, "model.shopify_source.stg_shopify__product_variant": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__product_variant_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__product_variant_tmp')),\n staging_columns=get_product_variant_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('product_variant_pass_through_columns') %}\n ,\n {{ var('product_variant_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n {{ fivetran_utils.source_relation(\n union_schema_variable='shopify_union_schemas', \n union_database_variable='shopify_union_databases') \n }}\n\n from source\n\n)\n\nselect * from renamed", "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_product_variant_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.shopify_source.stg_shopify__product_variant_tmp", "model.shopify_source.stg_shopify__product_variant_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product_variant"], "unique_id": "model.shopify_source.stg_shopify__product_variant", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "stg_shopify__product_variant.sql", "original_file_path": "models/stg_shopify__product_variant.sql", "name": "stg_shopify__product_variant", "alias": "stg_shopify__product_variant", "checksum": {"name": "sha256", "checksum": "6d09962a9153df0f1b3220ecfe3ecd87997d5e5b87187a985a7c25006ca8b229"}, "tags": [], "refs": [["stg_shopify__product_variant_tmp"], ["stg_shopify__product_variant_tmp"]], "sources": [], "description": "Each record represents a product variant in Shopify", "columns": {"barcode": {"name": "barcode", "description": "The barcode, UPC, or ISBN number for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "compare_at_price": {"name": "compare_at_price", "description": "The original price of the item before an adjustment or a sale.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time (ISO 8601 format) when the product variant was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The fulfillment service associated with the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the product variant in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The unique numeric identifier for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "image_id": {"name": "image_id", "description": "The unique numeric identifier for a product's image. The image must be associated to the same product as the variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_item_id": {"name": "inventory_item_id", "description": "The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_management": {"name": "inventory_management", "description": "The fulfillment service that tracks the number of items in stock for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_policy": {"name": "inventory_policy", "description": "Whether customers are allowed to place an order for the product variant when it's out of stock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_quantity": {"name": "inventory_quantity", "description": "An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "old_inventory_quantity": {"name": "old_inventory_quantity", "description": "This property is deprecated. Use the InventoryLevel resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_1": {"name": "option_1", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_2": {"name": "option_2", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_3": {"name": "option_3", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The order of the product variant in the list of product variants. The first position in the list is 1. The position of variants is indicated by the order in which they are listed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The unique numeric identifier for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_requiring_shipping": {"name": "is_requiring_shipping", "description": "This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_taxable": {"name": "is_taxable", "description": "Whether a tax is charged when the product variant is sold.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_code": {"name": "tax_code", "description": "This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product variant. The title field is a concatenation of the option1, option2, and option3 fields. You can only update title indirectly using the option fields.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the product variant was last modified. Gets returned in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight": {"name": "weight", "description": "The weight of the product variant in the unit system specified with weight_unit.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight_unit": {"name": "weight_unit", "description": "The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1653000361.2961228}, "model.shopify_source.stg_shopify__order": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__order_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_tmp')),\n staging_columns=get_order_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_pass_through_columns') %}\n ,\n {{ var('order_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n {{ fivetran_utils.source_relation(\n union_schema_variable='shopify_union_schemas', \n union_database_variable='shopify_union_databases') \n }}\n\n from source\n\n)\n\nselect * from renamed", "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.shopify_source.stg_shopify__order_tmp", "model.shopify_source.stg_shopify__order_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order"], "unique_id": "model.shopify_source.stg_shopify__order", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "stg_shopify__order.sql", "original_file_path": "models/stg_shopify__order.sql", "name": "stg_shopify__order", "alias": "stg_shopify__order", "checksum": {"name": "sha256", "checksum": "a4b7cdee44f261fe11e487f1022c1f7bd57196220a453bff382c1876ee5a2192"}, "tags": [], "refs": [["stg_shopify__order_tmp"], ["stg_shopify__order_tmp"]], "sources": [], "description": "Each record represents an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The ID of the app that created the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_1": {"name": "billing_address_address_1", "description": "The street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_2": {"name": "billing_address_address_2", "description": "An optional additional field for the street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_city": {"name": "billing_address_city", "description": "The city, town, or village of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_company": {"name": "billing_address_company", "description": "The company of the person associated with the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country": {"name": "billing_address_country", "description": "The name of the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country_code": {"name": "billing_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_first_name": {"name": "billing_address_first_name", "description": "The first name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_last_name": {"name": "billing_address_last_name", "description": "The last name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_latitude": {"name": "billing_address_latitude", "description": "The latitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_longitude": {"name": "billing_address_longitude", "description": "The longitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_name": {"name": "billing_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_phone": {"name": "billing_address_phone", "description": "The phone number at the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province": {"name": "billing_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province_code": {"name": "billing_address_province_code", "description": "The two-letter abbreviation of the region of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_zip": {"name": "billing_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "browser_ip": {"name": "browser_ip", "description": "The IP address of the browser used by the customer when they placed the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_buyer_accepted_marketing": {"name": "has_buyer_accepted_marketing", "description": "Whether the customer consented to receive email updates from the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancel_reason": {"name": "cancel_reason", "description": "The reason why the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancelled_timestamp": {"name": "cancelled_timestamp", "description": "The date and time when the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cart_token": {"name": "cart_token", "description": "The ID of the cart that's associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_timestamp": {"name": "closed_timestamp", "description": "The date and time when the order was closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The autogenerated date and time when the order was created in Shopify.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code for the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "The ID of the order's customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The customer's email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "financial_status": {"name": "financial_status", "description": "The status of payments associated with the order. Can only be set when the order is created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "The order's status in terms of fulfilled line items.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the order, used for API purposes. This is different from the order_number property, which is the ID used by the shop owner and customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "landing_site_base_url": {"name": "landing_site_base_url", "description": "The URL for the page where the buyer landed when they entered the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the order was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The order name, generated by combining the order_number property with the order prefix and suffix that are set in the merchant's general settings.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "An optional note that a shop owner can attach to the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The order's position in the shop's count of orders. Numbers are sequential and start at 1.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "The order 's position in the shop's count of orders starting at 1001. Order numbers are sequential and start at 1001.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when an order was processed. This value is the date that appears on your orders and that's used in the analytic reports.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processing_method": {"name": "processing_method", "description": "How the payment was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "referring_site": {"name": "referring_site", "description": "The website where the customer clicked a link to the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_1": {"name": "shipping_address_address_1", "description": "The street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_2": {"name": "shipping_address_address_2", "description": "An optional additional field for the street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_city": {"name": "shipping_address_city", "description": "The city, town, or village of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_company": {"name": "shipping_address_company", "description": "The company of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country": {"name": "shipping_address_country", "description": "The name of the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country_code": {"name": "shipping_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_first_name": {"name": "shipping_address_first_name", "description": "The first name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_last_name": {"name": "shipping_address_last_name", "description": "The last name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_latitude": {"name": "shipping_address_latitude", "description": "The latitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_longitude": {"name": "shipping_address_longitude", "description": "The longitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_name": {"name": "shipping_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_phone": {"name": "shipping_address_phone", "description": "The phone number at the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province": {"name": "shipping_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province_code": {"name": "shipping_address_province_code", "description": "The two-letter abbreviation of the region of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_zip": {"name": "shipping_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "Where the order originated. Can be set only during order creation, and is not writeable afterwards.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal_price": {"name": "subtotal_price", "description": "The price of the order in the shop currency after discounts but before shipping, taxes, and tips.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_taxes_included": {"name": "has_taxes_included", "description": "Whether taxes are included in the order subtotal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_test_order": {"name": "is_test_order", "description": "Whether this is a test order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "token": {"name": "token", "description": "A unique token for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discounts": {"name": "total_discounts", "description": "The total discounts applied to the price of the order in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_line_items_price": {"name": "total_line_items_price", "description": "The sum of all line item prices in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The sum of all the taxes applied to the order in th shop currency. Must be positive).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_weight": {"name": "total_weight", "description": "The sum of all line item weights in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time (ISO 8601 format) when the order was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID of the user logged into Shopify POS who processed the order, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_shipping_price_set": {"name": "total_shipping_price_set", "description": "The total shipping price set for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "index": {"name": "index", "description": "The index associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pre_tax_price": {"name": "pre_tax_price", "description": "The total pre tax price of the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1653000361.281006}, "model.shopify_source.stg_shopify__transaction": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__transaction_tmp') }}\n\n),\n\nrenamed as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__transaction_tmp')),\n staging_columns=get_transaction_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('transaction_pass_through_columns') %}\n ,\n {{ var('transaction_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n {{ fivetran_utils.source_relation(\n union_schema_variable='shopify_union_schemas', \n union_database_variable='shopify_union_databases') \n }}\n\n from source\n where not test\n\n)\n\nselect * from renamed", "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_transaction_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.shopify_source.stg_shopify__transaction_tmp", "model.shopify_source.stg_shopify__transaction_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "stg_shopify__transaction"], "unique_id": "model.shopify_source.stg_shopify__transaction", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "stg_shopify__transaction.sql", "original_file_path": "models/stg_shopify__transaction.sql", "name": "stg_shopify__transaction", "alias": "stg_shopify__transaction", "checksum": {"name": "sha256", "checksum": "b837eb0c1661d2817ccb6a1c3123e7d146dbbd9a63ea1fe0ad52ba8a1742ecbe"}, "tags": [], "refs": [["stg_shopify__transaction_tmp"], ["stg_shopify__transaction_tmp"]], "sources": [], "description": "Each record represents a transaction in Shopify.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The ID for the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID for the order that the transaction is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID associated with a refund in the refund table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of money included in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authorization": {"name": "authorization", "description": "The authorization code associated with the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the transaction was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when a transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device_id": {"name": "device_id", "description": "The ID for the device.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gateway": {"name": "gateway", "description": "The name of the gateway the transaction was issued through.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "The origin of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "message": {"name": "message", "description": "A string generated by the payment provider with additional information about why the transaction succeeded or failed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code (ISO 4217 format) for the currency used for the payment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The ID of an associated transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_avs_result_code": {"name": "payment_avs_result_code", "description": "The response code from the address verification system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_bin": {"name": "payment_credit_card_bin", "description": "The issuer identification number (IIN), formerly known as bank identification number (BIN) of the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_cvv_result_code": {"name": "payment_cvv_result_code", "description": "The response code from the credit card company indicating whether the customer entered the card security code, or card verification value, correctly.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_number": {"name": "payment_credit_card_number", "description": "The customer's credit card number, with most of the leading digits redacted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_company": {"name": "payment_credit_card_company", "description": "The name of the company that issued the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The transaction's type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "receipt": {"name": "receipt", "description": "A transaction receipt attached to the transaction by the gateway.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_id": {"name": "currency_exchange_id", "description": "The ID of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_adjustment": {"name": "currency_exchange_adjustment", "description": "The difference between the amounts on the associated transaction and the parent transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_original_amount": {"name": "currency_exchange_original_amount", "description": "The amount of the parent transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_final_amount": {"name": "currency_exchange_final_amount", "description": "The amount of the associated transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_currency": {"name": "currency_exchange_currency", "description": "The shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "error_code": {"name": "error_code", "description": "A standardized error code, independent of the payment provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether the transaction is a test transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1653000361.30751}, "model.shopify_source.stg_shopify__order_adjustment": {"raw_sql": "--To disable this model, set the shopify__using_order_adjustment variable within your dbt_project.yml file to False.\n{{ config(enabled=var('shopify__using_order_adjustment', True)) }}\n\nwith source as (\n\n select * \n from {{ ref('stg_shopify__order_adjustment_tmp') }}\n\n),\n\nrenamed as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_adjustment_tmp')),\n staging_columns=get_order_adjustment_columns()\n )\n }}\n\n {{ fivetran_utils.source_relation(\n union_schema_variable='shopify_union_schemas', \n union_database_variable='shopify_union_databases') \n }}\n \n from source\n)\n\nselect * from renamed", "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_adjustment_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment_tmp", "model.shopify_source.stg_shopify__order_adjustment_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_adjustment"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "stg_shopify__order_adjustment.sql", "original_file_path": "models/stg_shopify__order_adjustment.sql", "name": "stg_shopify__order_adjustment", "alias": "stg_shopify__order_adjustment", "checksum": {"name": "sha256", "checksum": "b494a4c88cf235fb0b11c020d004bcf0904e9d1ae235144330d3d24b37ad4318"}, "tags": [], "refs": [["stg_shopify__order_adjustment_tmp"], ["stg_shopify__order_adjustment_tmp"]], "sources": [], "description": "Each record represents and adjustment to and order within Shopify.", "columns": {"order_adjustment_id": {"name": "order_adjustment_id", "description": "The unique numeric identifier for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "Reference to the refund which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Amount of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount": {"name": "tax_amount", "description": "Tax amount applied to the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The kind of order adjustment (eg. refund, restock, etc.).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "The reason for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount_set": {"name": "amount_set", "description": "Amount set towards the order adjustment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount_set": {"name": "tax_amount_set", "description": "Tax amount set towards the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "enabled": true}, "created_at": 1653000361.3156438}, "model.shopify_source.stg_shopify__customer": {"raw_sql": "with source as (\n\n select * from {{ ref('stg_shopify__customer_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__customer_tmp')),\n staging_columns=get_customer_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('customer_pass_through_columns') %}\n ,\n {{ var('customer_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n {{ fivetran_utils.source_relation(\n union_schema_variable='shopify_union_schemas', \n union_database_variable='shopify_union_databases') \n }}\n\n from source\n\n)\n\nselect * from renamed", "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_customer_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.shopify_source.stg_shopify__customer_tmp", "model.shopify_source.stg_shopify__customer_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "stg_shopify__customer"], "unique_id": "model.shopify_source.stg_shopify__customer", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "stg_shopify__customer.sql", "original_file_path": "models/stg_shopify__customer.sql", "name": "stg_shopify__customer", "alias": "stg_shopify__customer", "checksum": {"name": "sha256", "checksum": "e43df3b376bae7b581cfb9514f59c82263bbba83447e9bd440a214e8c2dca709"}, "tags": [], "refs": [["stg_shopify__customer_tmp"], ["stg_shopify__customer_tmp"]], "sources": [], "description": "Each record represents a customer in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_accepted_marketing": {"name": "has_accepted_marketing", "description": "Whether the customer has consented to receive marketing material via email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the customer was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_address_id": {"name": "default_address_id", "description": "The default address for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The customer's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "A unique identifier for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The customer's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orders_count": {"name": "orders_count", "description": "The number of orders associated with this customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_state": {"name": "account_state", "description": "The state of the customer's account with a shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_tax_exempt": {"name": "is_tax_exempt", "description": "Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_spent": {"name": "total_spent", "description": "The total amount of money that the customer has spent across their order history.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time when the customer information was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_verified_email": {"name": "is_verified_email", "description": "Whether the customer has verified their email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1653000361.241151}, "model.shopify_source.stg_shopify__order_line_refund": {"raw_sql": "--To disable this model, set the shopify__using_order_line_refund variable within your dbt_project.yml file to False.\n{{ config(enabled=var('shopify__using_order_line_refund', True)) }}\n\nwith source as (\n\n select * from {{ ref('stg_shopify__order_line_refund_tmp') }}\n\n),\n\nrenamed as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_line_refund_tmp')),\n staging_columns=get_order_line_refund_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('order_line_refund_pass_through_columns') %}\n ,\n {{ var('order_line_refund_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n {{ fivetran_utils.source_relation(\n union_schema_variable='shopify_union_schemas', \n union_database_variable='shopify_union_databases') \n }}\n\n from source\n\n)\n\nselect * from renamed", "resource_type": "model", "depends_on": {"macros": ["macro.shopify_source.get_order_line_refund_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund_tmp", "model.shopify_source.stg_shopify__order_line_refund_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line_refund"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "stg_shopify__order_line_refund.sql", "original_file_path": "models/stg_shopify__order_line_refund.sql", "name": "stg_shopify__order_line_refund", "alias": "stg_shopify__order_line_refund", "checksum": {"name": "sha256", "checksum": "0d7b02b07f95694dd5358ec919659f16bdccf708f906546b99f448355b1253cd"}, "tags": [], "refs": [["stg_shopify__order_line_refund_tmp"], ["stg_shopify__order_line_refund_tmp"]], "sources": [], "description": "Each record represents a line item from an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_refund_id": {"name": "order_line_refund_id", "description": "The unique identifier of the line item in the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "TThe unique identifier of the location where the items will be restockedBD", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the related line item in the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the associated line item that was returned.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID of the related refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock_type": {"name": "restock_type", "description": "How this refund line item affects inventory levels.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal": {"name": "subtotal", "description": "Subtotal amount of the order line refund", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The total tax applied to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "enabled": true}, "created_at": 1653000361.246721}, "model.shopify_source.stg_shopify__customer_tmp": {"raw_sql": "{{\n fivetran_utils.union_data(\n table_identifier='customer', \n database_variable='shopify_database', \n schema_variable='shopify_schema', \n default_database=target.database,\n default_schema='shopify',\n default_variable='customer_source',\n union_schema_variable='shopify_union_schemas',\n union_database_variable='shopify_union_databases'\n )\n}}", "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.shopify_source.shopify.customer"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__customer_tmp"], "unique_id": "model.shopify_source.stg_shopify__customer_tmp", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "tmp/stg_shopify__customer_tmp.sql", "original_file_path": "models/tmp/stg_shopify__customer_tmp.sql", "name": "stg_shopify__customer_tmp", "alias": "stg_shopify__customer_tmp", "checksum": {"name": "sha256", "checksum": "1f896e84164292f48db1c4eddfd6b3afef9ce4661ad2ab160c8721c8e620026c"}, "tags": [], "refs": [], "sources": [["shopify", "customer"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1653000361.103286}, "model.shopify_source.stg_shopify__order_line_tmp": {"raw_sql": "{{\n fivetran_utils.union_data(\n table_identifier='order_line', \n database_variable='shopify_database', \n schema_variable='shopify_schema', \n default_database=target.database,\n default_schema='shopify',\n default_variable='order_line_source',\n union_schema_variable='shopify_union_schemas',\n union_database_variable='shopify_union_databases'\n )\n}}", "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.shopify_source.shopify.order_line"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_tmp", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "tmp/stg_shopify__order_line_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_line_tmp.sql", "name": "stg_shopify__order_line_tmp", "alias": "stg_shopify__order_line_tmp", "checksum": {"name": "sha256", "checksum": "778359b2c17590b95d7b5709bfdd28b50d323b905e4277c74203416f08ee458e"}, "tags": [], "refs": [], "sources": [["shopify", "order_line"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1653000361.121928}, "model.shopify_source.stg_shopify__refund_tmp": {"raw_sql": "--To disable this model, set the shopify__using_refund variable within your dbt_project.yml file to False.\n{{ config(enabled=var('shopify__using_refund', True)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='refund', \n database_variable='shopify_database', \n schema_variable='shopify_schema', \n default_database=target.database,\n default_schema='shopify',\n default_variable='refund_source',\n union_schema_variable='shopify_union_schemas',\n union_database_variable='shopify_union_databases'\n )\n}}", "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.shopify_source.shopify.refund"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__refund_tmp", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "tmp/stg_shopify__refund_tmp.sql", "original_file_path": "models/tmp/stg_shopify__refund_tmp.sql", "name": "stg_shopify__refund_tmp", "alias": "stg_shopify__refund_tmp", "checksum": {"name": "sha256", "checksum": "2bcf1d64f126acc4d271984df2b6332286bf10a7345962f7037c391d8ecdbdbd"}, "tags": [], "refs": [], "sources": [["shopify", "refund"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view", "enabled": true}, "created_at": 1653000361.129329}, "model.shopify_source.stg_shopify__product_tmp": {"raw_sql": "{{\n fivetran_utils.union_data(\n table_identifier='product', \n database_variable='shopify_database', \n schema_variable='shopify_schema', \n default_database=target.database,\n default_schema='shopify',\n default_variable='product_source',\n union_schema_variable='shopify_union_schemas',\n union_database_variable='shopify_union_databases'\n )\n}}", "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.shopify_source.shopify.product"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_tmp", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "tmp/stg_shopify__product_tmp.sql", "original_file_path": "models/tmp/stg_shopify__product_tmp.sql", "name": "stg_shopify__product_tmp", "alias": "stg_shopify__product_tmp", "checksum": {"name": "sha256", "checksum": "4c88fa0dabe17fa99b7509af7b3518c844df1747e28e6c7ac4f0a8262424e91a"}, "tags": [], "refs": [], "sources": [["shopify", "product"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1653000361.1373398}, "model.shopify_source.stg_shopify__order_adjustment_tmp": {"raw_sql": "--To disable this model, set the shopify__using_order_adjustment variable within your dbt_project.yml file to False.\n{{ config(enabled=var('shopify__using_order_adjustment', True)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='order_adjustment', \n database_variable='shopify_database', \n schema_variable='shopify_schema', \n default_database=target.database,\n default_schema='shopify',\n default_variable='order_adjustment_source',\n union_schema_variable='shopify_union_schemas',\n union_database_variable='shopify_union_databases'\n )\n}}", "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.shopify_source.shopify.order_adjustment"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_adjustment_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment_tmp", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "tmp/stg_shopify__order_adjustment_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_adjustment_tmp.sql", "name": "stg_shopify__order_adjustment_tmp", "alias": "stg_shopify__order_adjustment_tmp", "checksum": {"name": "sha256", "checksum": "e3d5e7ba5a680437560ef21796b014718c45d20c52fbf4ac950d8eb687348d96"}, "tags": [], "refs": [], "sources": [["shopify", "order_adjustment"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view", "enabled": true}, "created_at": 1653000361.144408}, "model.shopify_source.stg_shopify__order_line_refund_tmp": {"raw_sql": "--To disable this model, set the shopify__using_order_line_refund variable within your dbt_project.yml file to False.\n{{ config(enabled=var('shopify__using_order_line_refund', True)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='order_line_refund', \n database_variable='shopify_database', \n schema_variable='shopify_schema', \n default_database=target.database,\n default_schema='shopify',\n default_variable='order_line_refund_source',\n union_schema_variable='shopify_union_schemas',\n union_database_variable='shopify_union_databases'\n )\n}}", "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.shopify_source.shopify.order_line_refund"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund_tmp", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "tmp/stg_shopify__order_line_refund_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_line_refund_tmp.sql", "name": "stg_shopify__order_line_refund_tmp", "alias": "stg_shopify__order_line_refund_tmp", "checksum": {"name": "sha256", "checksum": "33bb981405f33c32bbe9c2107a9ba93fd70b9e59578befc3c9e7f78a68c27eb2"}, "tags": [], "refs": [], "sources": [["shopify", "order_line_refund"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view", "enabled": true}, "created_at": 1653000361.15229}, "model.shopify_source.stg_shopify__transaction_tmp": {"raw_sql": "{{\n fivetran_utils.union_data(\n table_identifier='transaction', \n database_variable='shopify_database', \n schema_variable='shopify_schema', \n default_database=target.database,\n default_schema='shopify',\n default_variable='transaction_source',\n union_schema_variable='shopify_union_schemas',\n union_database_variable='shopify_union_databases'\n )\n}}", "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.shopify_source.shopify.transaction"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__transaction_tmp"], "unique_id": "model.shopify_source.stg_shopify__transaction_tmp", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "tmp/stg_shopify__transaction_tmp.sql", "original_file_path": "models/tmp/stg_shopify__transaction_tmp.sql", "name": "stg_shopify__transaction_tmp", "alias": "stg_shopify__transaction_tmp", "checksum": {"name": "sha256", "checksum": "9a4cf0c7a2495c01fd10f0d88655aaffe63ef8b3cc94883e10507b034285f978"}, "tags": [], "refs": [], "sources": [["shopify", "transaction"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1653000361.15963}, "model.shopify_source.stg_shopify__product_variant_tmp": {"raw_sql": "{{\n fivetran_utils.union_data(\n table_identifier='product_variant', \n database_variable='shopify_database', \n schema_variable='shopify_schema', \n default_database=target.database,\n default_schema='shopify',\n default_variable='product_variant_source',\n union_schema_variable='shopify_union_schemas',\n union_database_variable='shopify_union_databases'\n )\n}}", "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.shopify_source.shopify.product_variant"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_variant_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_variant_tmp", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "tmp/stg_shopify__product_variant_tmp.sql", "original_file_path": "models/tmp/stg_shopify__product_variant_tmp.sql", "name": "stg_shopify__product_variant_tmp", "alias": "stg_shopify__product_variant_tmp", "checksum": {"name": "sha256", "checksum": "cbb9a84c332f17d90ad953536a449714fac6f77f871da604d43ffb846f6d5621"}, "tags": [], "refs": [], "sources": [["shopify", "product_variant"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1653000361.166537}, "model.shopify_source.stg_shopify__order_tmp": {"raw_sql": "{{\n fivetran_utils.union_data(\n table_identifier='order',\n database_variable='shopify_database', \n schema_variable='shopify_schema', \n default_database=target.database,\n default_schema='shopify',\n default_variable='order_source',\n union_schema_variable='shopify_union_schemas',\n union_database_variable='shopify_union_databases'\n )\n}}", "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.shopify_source.shopify.order"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bq-instance", "schema": "dbt_renee_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_tmp", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "tmp/stg_shopify__order_tmp.sql", "original_file_path": "models/tmp/stg_shopify__order_tmp.sql", "name": "stg_shopify__order_tmp", "alias": "stg_shopify__order_tmp", "checksum": {"name": "sha256", "checksum": "15e3ee6de99527743387105e80865aa2566b898af1f8bb7d5593882a3119ca36"}, "tags": [], "refs": [], "sources": [["shopify", "order"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1653000361.174805}, "test.develop.unique_my_first_dbt_model_id.16e066b321": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('my_first_dbt_model')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.develop.my_first_dbt_model"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["develop", "example", "unique_my_first_dbt_model_id"], "unique_id": "test.develop.unique_my_first_dbt_model_id.16e066b321", "package_name": "develop", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop", "path": "unique_my_first_dbt_model_id.sql", "original_file_path": "models/example/schema.yml", "name": "unique_my_first_dbt_model_id", "alias": "unique_my_first_dbt_model_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["my_first_dbt_model"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1653000361.2216709, "column_name": "id", "file_key_name": "models.my_first_dbt_model"}, "test.develop.not_null_my_first_dbt_model_id.5fb22c2710": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('my_first_dbt_model')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.develop.my_first_dbt_model"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["develop", "example", "not_null_my_first_dbt_model_id"], "unique_id": "test.develop.not_null_my_first_dbt_model_id.5fb22c2710", "package_name": "develop", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop", "path": "not_null_my_first_dbt_model_id.sql", "original_file_path": "models/example/schema.yml", "name": "not_null_my_first_dbt_model_id", "alias": "not_null_my_first_dbt_model_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["my_first_dbt_model"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1653000361.2240179, "column_name": "id", "file_key_name": "models.my_first_dbt_model"}, "test.develop.unique_my_second_dbt_model_id.57a0f8c493": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('my_second_dbt_model')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.develop.my_second_dbt_model"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["develop", "example", "unique_my_second_dbt_model_id"], "unique_id": "test.develop.unique_my_second_dbt_model_id.57a0f8c493", "package_name": "develop", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop", "path": "unique_my_second_dbt_model_id.sql", "original_file_path": "models/example/schema.yml", "name": "unique_my_second_dbt_model_id", "alias": "unique_my_second_dbt_model_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["my_second_dbt_model"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1653000361.226002, "column_name": "id", "file_key_name": "models.my_second_dbt_model"}, "test.develop.not_null_my_second_dbt_model_id.151b76d778": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('my_second_dbt_model')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.develop.my_second_dbt_model"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["develop", "example", "not_null_my_second_dbt_model_id"], "unique_id": "test.develop.not_null_my_second_dbt_model_id.151b76d778", "package_name": "develop", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop", "path": "not_null_my_second_dbt_model_id.sql", "original_file_path": "models/example/schema.yml", "name": "not_null_my_second_dbt_model_id", "alias": "not_null_my_second_dbt_model_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["my_second_dbt_model"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1653000361.228003, "column_name": "id", "file_key_name": "models.my_second_dbt_model"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__customer_customer_id__source_relation.1b2185db25": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["customer_id", "source_relation"], "model": "{{ get_where_subquery(ref('stg_shopify__customer')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.shopify_source.stg_shopify__customer"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["shopify_source", "dbt_utils_unique_combination_of_columns_stg_shopify__customer_customer_id__source_relation"], "unique_id": "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__customer_customer_id__source_relation.1b2185db25", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be.sql", "original_file_path": "models/stg_shopify.yml", "name": "dbt_utils_unique_combination_of_columns_stg_shopify__customer_customer_id__source_relation", "alias": "dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_shopify__customer"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be"}, "created_at": 1653000361.316564, "column_name": null, "file_key_name": "models.stg_shopify__customer"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_line_refund_order_line_refund_id__source_relation.1877420c29": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["order_line_refund_id", "source_relation"], "model": "{{ get_where_subquery(ref('stg_shopify__order_line_refund')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.shopify_source.stg_shopify__order_line_refund"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["shopify_source", "dbt_utils_unique_combination_of_columns_stg_shopify__order_line_refund_order_line_refund_id__source_relation"], "unique_id": "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_line_refund_order_line_refund_id__source_relation.1877420c29", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3.sql", "original_file_path": "models/stg_shopify.yml", "name": "dbt_utils_unique_combination_of_columns_stg_shopify__order_line_refund_order_line_refund_id__source_relation", "alias": "dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_shopify__order_line_refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3"}, "created_at": 1653000361.3314052, "column_name": null, "file_key_name": "models.stg_shopify__order_line_refund"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_line_order_line_id__source_relation.c2797e7a9c": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["order_line_id", "source_relation"], "model": "{{ get_where_subquery(ref('stg_shopify__order_line')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.shopify_source.stg_shopify__order_line"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["shopify_source", "dbt_utils_unique_combination_of_columns_stg_shopify__order_line_order_line_id__source_relation"], "unique_id": "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_line_order_line_id__source_relation.c2797e7a9c", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec.sql", "original_file_path": "models/stg_shopify.yml", "name": "dbt_utils_unique_combination_of_columns_stg_shopify__order_line_order_line_id__source_relation", "alias": "dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_shopify__order_line"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec"}, "created_at": 1653000361.337714, "column_name": null, "file_key_name": "models.stg_shopify__order_line"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_order_id__source_relation.81d10381c1": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["order_id", "source_relation"], "model": "{{ get_where_subquery(ref('stg_shopify__order')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.shopify_source.stg_shopify__order"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["shopify_source", "dbt_utils_unique_combination_of_columns_stg_shopify__order_order_id__source_relation"], "unique_id": "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_order_id__source_relation.81d10381c1", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e.sql", "original_file_path": "models/stg_shopify.yml", "name": "dbt_utils_unique_combination_of_columns_stg_shopify__order_order_id__source_relation", "alias": "dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_shopify__order"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e"}, "created_at": 1653000361.3431199, "column_name": null, "file_key_name": "models.stg_shopify__order"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_product_id__source_relation.48b32ab6a2": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["product_id", "source_relation"], "model": "{{ get_where_subquery(ref('stg_shopify__product')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.shopify_source.stg_shopify__product"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["shopify_source", "dbt_utils_unique_combination_of_columns_stg_shopify__product_product_id__source_relation"], "unique_id": "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_product_id__source_relation.48b32ab6a2", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d.sql", "original_file_path": "models/stg_shopify.yml", "name": "dbt_utils_unique_combination_of_columns_stg_shopify__product_product_id__source_relation", "alias": "dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_shopify__product"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d"}, "created_at": 1653000361.347734, "column_name": null, "file_key_name": "models.stg_shopify__product"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_variant_variant_id__source_relation.7506695ec0": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["variant_id", "source_relation"], "model": "{{ get_where_subquery(ref('stg_shopify__product_variant')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.shopify_source.stg_shopify__product_variant"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["shopify_source", "dbt_utils_unique_combination_of_columns_stg_shopify__product_variant_variant_id__source_relation"], "unique_id": "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_variant_variant_id__source_relation.7506695ec0", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e.sql", "original_file_path": "models/stg_shopify.yml", "name": "dbt_utils_unique_combination_of_columns_stg_shopify__product_variant_variant_id__source_relation", "alias": "dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_shopify__product_variant"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e"}, "created_at": 1653000361.3525178, "column_name": null, "file_key_name": "models.stg_shopify__product_variant"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__transaction_transaction_id__source_relation.d55a33652a": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["transaction_id", "source_relation"], "model": "{{ get_where_subquery(ref('stg_shopify__transaction')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.shopify_source.stg_shopify__transaction"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["shopify_source", "dbt_utils_unique_combination_of_columns_stg_shopify__transaction_transaction_id__source_relation"], "unique_id": "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__transaction_transaction_id__source_relation.d55a33652a", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92.sql", "original_file_path": "models/stg_shopify.yml", "name": "dbt_utils_unique_combination_of_columns_stg_shopify__transaction_transaction_id__source_relation", "alias": "dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_shopify__transaction"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92"}, "created_at": 1653000361.357158, "column_name": null, "file_key_name": "models.stg_shopify__transaction"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__refund_refund_id__source_relation.cd4dbc2b35": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["refund_id", "source_relation"], "model": "{{ get_where_subquery(ref('stg_shopify__refund')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.shopify_source.stg_shopify__refund"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["shopify_source", "dbt_utils_unique_combination_of_columns_stg_shopify__refund_refund_id__source_relation"], "unique_id": "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__refund_refund_id__source_relation.cd4dbc2b35", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659.sql", "original_file_path": "models/stg_shopify.yml", "name": "dbt_utils_unique_combination_of_columns_stg_shopify__refund_refund_id__source_relation", "alias": "dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_shopify__refund"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659"}, "created_at": 1653000361.361532, "column_name": null, "file_key_name": "models.stg_shopify__refund"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_adjustment_order_adjustment_id__source_relation.00b7d10cb0": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["order_adjustment_id", "source_relation"], "model": "{{ get_where_subquery(ref('stg_shopify__order_adjustment')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.shopify_source.stg_shopify__order_adjustment"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bq-instance", "schema": "dbt_renee_dbt_test__audit", "fqn": ["shopify_source", "dbt_utils_unique_combination_of_columns_stg_shopify__order_adjustment_order_adjustment_id__source_relation"], "unique_id": "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_adjustment_order_adjustment_id__source_relation.00b7d10cb0", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207.sql", "original_file_path": "models/stg_shopify.yml", "name": "dbt_utils_unique_combination_of_columns_stg_shopify__order_adjustment_order_adjustment_id__source_relation", "alias": "dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_shopify__order_adjustment"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207"}, "created_at": 1653000361.366076, "column_name": null, "file_key_name": "models.stg_shopify__order_adjustment"}}, "sources": {"source.shopify_source.shopify.order": {"fqn": ["shopify_source", "shopify", "order"], "database": "bq-instance", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": true, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Each record represents an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The ID of the app that created the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_1": {"name": "billing_address_address_1", "description": "The street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_address_2": {"name": "billing_address_address_2", "description": "An optional additional field for the street address of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_city": {"name": "billing_address_city", "description": "The city, town, or village of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_company": {"name": "billing_address_company", "description": "The company of the person associated with the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country": {"name": "billing_address_country", "description": "The name of the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_country_code": {"name": "billing_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_first_name": {"name": "billing_address_first_name", "description": "The first name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_last_name": {"name": "billing_address_last_name", "description": "The last name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_latitude": {"name": "billing_address_latitude", "description": "The latitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_longitude": {"name": "billing_address_longitude", "description": "The longitude of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_name": {"name": "billing_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_phone": {"name": "billing_address_phone", "description": "The phone number at the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province": {"name": "billing_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_province_code": {"name": "billing_address_province_code", "description": "The two-letter abbreviation of the region of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billing_address_zip": {"name": "billing_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the billing address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "browser_ip": {"name": "browser_ip", "description": "The IP address of the browser used by the customer when they placed the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "buyer_accepts_marketing": {"name": "buyer_accepts_marketing", "description": "Whether the customer consented to receive email updates from the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancel_reason": {"name": "cancel_reason", "description": "The reason why the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cancelled_at": {"name": "cancelled_at", "description": "The date and time when the order was canceled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "cart_token": {"name": "cart_token", "description": "The ID of the cart that's associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The date and time when the order was closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The autogenerated date and time when the order was created in Shopify.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code for the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "The ID of the order's customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The customer's email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "financial_status": {"name": "financial_status", "description": "The status of payments associated with the order. Can only be set when the order is created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "The order's status in terms of fulfilled line items.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The ID of the order, used for API purposes. This is different from the order_number property, which is the ID used by the shop owner and customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "landing_site_base_url": {"name": "landing_site_base_url", "description": "The URL for the page where the buyer landed when they entered the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the order was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The order name, generated by combining the order_number property with the order prefix and suffix that are set in the merchant's general settings.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "An optional note that a shop owner can attach to the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The order's position in the shop's count of orders. Numbers are sequential and start at 1.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "The order 's position in the shop's count of orders starting at 1001. Order numbers are sequential and start at 1001.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "The date and time when an order was processed. This value is the date that appears on your orders and that's used in the analytic reports.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processing_method": {"name": "processing_method", "description": "How the payment was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "referring_site": {"name": "referring_site", "description": "The website where the customer clicked a link to the shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_1": {"name": "shipping_address_address_1", "description": "The street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_address_2": {"name": "shipping_address_address_2", "description": "An optional additional field for the street address of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_city": {"name": "shipping_address_city", "description": "The city, town, or village of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_company": {"name": "shipping_address_company", "description": "The company of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country": {"name": "shipping_address_country", "description": "The name of the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_country_code": {"name": "shipping_address_country_code", "description": "The two-letter code (ISO 3166-1 format) for the country of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_first_name": {"name": "shipping_address_first_name", "description": "The first name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_last_name": {"name": "shipping_address_last_name", "description": "The last name of the person associated with the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_latitude": {"name": "shipping_address_latitude", "description": "The latitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_longitude": {"name": "shipping_address_longitude", "description": "The longitude of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_name": {"name": "shipping_address_name", "description": "The full name of the person associated with the payment method.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_phone": {"name": "shipping_address_phone", "description": "The phone number at the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province": {"name": "shipping_address_province", "description": "The name of the region (province, state, prefecture, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_province_code": {"name": "shipping_address_province_code", "description": "The two-letter abbreviation of the region of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shipping_address_zip": {"name": "shipping_address_zip", "description": "The postal code (zip, postcode, Eircode, \u2026) of the shipping address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "Where the order originated. Can be set only during order creation, and is not writeable afterwards.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal_price": {"name": "subtotal_price", "description": "The price of the order in the shop currency after discounts but before shipping, taxes, and tips.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxes_included": {"name": "taxes_included", "description": "Whether taxes are included in the order subtotal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether this is a test order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "token": {"name": "token", "description": "A unique token for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discounts": {"name": "total_discounts", "description": "The total discounts applied to the price of the order in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_line_items_price": {"name": "total_line_items_price", "description": "The sum of all line item prices in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The sum of all the taxes applied to the order in th shop currency. Must be positive).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_weight": {"name": "total_weight", "description": "The sum of all line item weights in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time (ISO 8601 format) when the order was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID of the user logged into Shopify POS who processed the order, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bq-instance`.`shopify`.`order`", "created_at": 1653000361.456152}, "source.shopify_source.shopify.customer": {"fqn": ["shopify_source", "shopify", "customer"], "database": "bq-instance", "schema": "shopify", "unique_id": "source.shopify_source.shopify.customer", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "customer", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "customer", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Each record represents a customer in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accepts_marketing": {"name": "accepts_marketing", "description": "Whether the customer has consented to receive marketing material via email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time when the customer was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_address_id": {"name": "default_address_id", "description": "The default address for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The customer's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "A unique identifier for the customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The customer's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orders_count": {"name": "orders_count", "description": "The number of orders associated with this customer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the customer's account with a shop.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_exempt": {"name": "tax_exempt", "description": "Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_spent": {"name": "total_spent", "description": "The total amount of money that the customer has spent across their order history.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the customer information was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "verified_email": {"name": "verified_email", "description": "Whether the customer has verified their email address.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bq-instance`.`shopify`.`customer`", "created_at": 1653000361.456392}, "source.shopify_source.shopify.order_line": {"fqn": ["shopify_source", "shopify", "order_line"], "database": "bq-instance", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_line", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_line", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_line", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Each record represents a line item for an order in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillable_quantity": {"name": "fulfillable_quantity", "description": "The amount available to fulfill, calculated as follows: quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The service provider that's fulfilling the item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_status": {"name": "fulfillment_status", "description": "How far along an order is in terms line items fulfilled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gift_card": {"name": "gift_card", "description": "Whether the item is a gift card. If true, then the item is not taxed or considered for shipping charges.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the item in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The ID of the line item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID of the related order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the item before discounts have been applied in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The ID of the product that the line item belongs to. Can be null if the original product associated with the order is deleted at a later date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of items that were purchased.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requires_shipping": {"name": "requires_shipping", "description": "Whether the item requires shipping.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "The item's SKU (stock keeping unit).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxable": {"name": "taxable", "description": "Whether the item was taxable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_discount": {"name": "total_discount", "description": "The total amount of the discount allocated to the line item in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "variant_id": {"name": "variant_id", "description": "The ID of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the item's supplier.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bq-instance`.`shopify`.`order_line`", "created_at": 1653000361.4565709}, "source.shopify_source.shopify.order_line_refund": {"fqn": ["shopify_source", "shopify", "order_line_refund"], "database": "bq-instance", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_line_refund", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_line_refund", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_line_refund", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Each record represents a line item refund in Shopify.", "columns": {"_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The unique identifier of the line item in the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "TThe unique identifier of the location where the items will be restockedBD", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_line_id": {"name": "order_line_id", "description": "The ID of the related line item in the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the associated line item that was returned.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID of the related refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock_type": {"name": "restock_type", "description": "How this refund line item affects inventory levels.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subtotal": {"name": "subtotal", "description": "Subtotal amount of the order line refund", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_tax": {"name": "total_tax", "description": "The total tax applied to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bq-instance`.`shopify`.`order_line_refund`", "created_at": 1653000361.4567199}, "source.shopify_source.shopify.product": {"fqn": ["shopify_source", "shopify", "product"], "database": "bq-instance", "schema": "shopify", "unique_id": "source.shopify_source.shopify.product", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "product", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "product", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Each record represents a product in Shopify.", "columns": {"_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Whether the record has been deleted in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time when the product was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "handle": {"name": "handle", "description": "A unique human-friendly string for the product. Automatically generated from the product's title.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "An unsigned 64-bit integer that's used as a unique identifier for the product. Each id is unique across the Shopify system. No two products will have the same id, even if they're from different shops.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_type": {"name": "product_type", "description": "A categorization for the product used for filtering and searching products.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_at": {"name": "published_at", "description": "The date and time (ISO 8601 format) when the product was published. Can be set to null to unpublish the product from the Online Store channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "published_scope": {"name": "published_scope", "description": "Whether the product is published to the Point of Sale channel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The name of the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the product was last modified.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor": {"name": "vendor", "description": "The name of the product's vendor.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bq-instance`.`shopify`.`product`", "created_at": 1653000361.4568698}, "source.shopify_source.shopify.product_variant": {"fqn": ["shopify_source", "shopify", "product_variant"], "database": "bq-instance", "schema": "shopify", "unique_id": "source.shopify_source.shopify.product_variant", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "product_variant", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "product_variant", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Each record represents a product variant in Shopify", "columns": {"barcode": {"name": "barcode", "description": "The barcode, UPC, or ISBN number for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "compare_at_price": {"name": "compare_at_price", "description": "The original price of the item before an adjustment or a sale.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time (ISO 8601 format) when the product variant was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fulfillment_service": {"name": "fulfillment_service", "description": "The fulfillment service associated with the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grams": {"name": "grams", "description": "The weight of the product variant in grams.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "id": {"name": "id", "description": "The unique numeric identifier for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "image_id": {"name": "image_id", "description": "The unique numeric identifier for a product's image. The image must be associated to the same product as the variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_item_id": {"name": "inventory_item_id", "description": "The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_management": {"name": "inventory_management", "description": "The fulfillment service that tracks the number of items in stock for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_policy": {"name": "inventory_policy", "description": "Whether customers are allowed to place an order for the product variant when it's out of stock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inventory_quantity": {"name": "inventory_quantity", "description": "An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "old_inventory_quantity": {"name": "old_inventory_quantity", "description": "This property is deprecated. Use the InventoryLevel resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_1": {"name": "option_1", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_2": {"name": "option_2", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "option_3": {"name": "option_3", "description": "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The order of the product variant in the list of product variants. The first position in the list is 1. The position of variants is indicated by the order in which they are listed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "price": {"name": "price", "description": "The price of the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "product_id": {"name": "product_id", "description": "The unique numeric identifier for the product.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requires_shipping": {"name": "requires_shipping", "description": "This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sku": {"name": "sku", "description": "A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxable": {"name": "taxable", "description": "Whether a tax is charged when the product variant is sold.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_code": {"name": "tax_code", "description": "This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the product variant. The title field is a concatenation of the option1, option2, and option3 fields. You can only update title indirectly using the option fields.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time when the product variant was last modified. Gets returned in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight": {"name": "weight", "description": "The weight of the product variant in the unit system specified with weight_unit.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "weight_unit": {"name": "weight_unit", "description": "The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_shipping_price_set": {"name": "total_shipping_price_set", "description": "The total shipping price set for the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "index": {"name": "index", "description": "The index associated with the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pre_tax_price": {"name": "pre_tax_price", "description": "The total pre tax price of the order.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bq-instance`.`shopify`.`product_variant`", "created_at": 1653000361.457055}, "source.shopify_source.shopify.transaction": {"fqn": ["shopify_source", "shopify", "transaction"], "database": "bq-instance", "schema": "shopify", "unique_id": "source.shopify_source.shopify.transaction", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "transaction", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "transaction", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Each record represents a transaction in Shopify.", "columns": {"transaction_id": {"name": "transaction_id", "description": "The ID for the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "The ID for the order that the transaction is associated with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "The ID associated with a refund in the refund table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "The amount of money included in the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authorization": {"name": "authorization", "description": "The authorization code associated with the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time when the transaction was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_timestamp": {"name": "processed_timestamp", "description": "The date and time when a transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device_id": {"name": "device_id", "description": "The ID for the device.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gateway": {"name": "gateway", "description": "The name of the gateway the transaction was issued through.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_name": {"name": "source_name", "description": "The origin of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "message": {"name": "message", "description": "A string generated by the payment provider with additional information about why the transaction succeeded or failed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "The three-letter code (ISO 4217 format) for the currency used for the payment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "The ID of the physical location where the transaction was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The ID of an associated transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_avs_result_code": {"name": "payment_avs_result_code", "description": "The response code from the address verification system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_bin": {"name": "payment_credit_card_bin", "description": "The issuer identification number (IIN), formerly known as bank identification number (BIN) of the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_cvv_result_code": {"name": "payment_cvv_result_code", "description": "The response code from the credit card company indicating whether the customer entered the card security code, or card verification value, correctly.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_number": {"name": "payment_credit_card_number", "description": "The customer's credit card number, with most of the leading digits redacted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_credit_card_company": {"name": "payment_credit_card_company", "description": "The name of the company that issued the customer's credit card.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The transaction's type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "receipt": {"name": "receipt", "description": "A transaction receipt attached to the transaction by the gateway.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_id": {"name": "currency_exchange_id", "description": "The ID of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_adjustment": {"name": "currency_exchange_adjustment", "description": "The difference between the amounts on the associated transaction and the parent transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_original_amount": {"name": "currency_exchange_original_amount", "description": "The amount of the parent transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_final_amount": {"name": "currency_exchange_final_amount", "description": "The amount of the associated transaction in the shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency_exchange_currency": {"name": "currency_exchange_currency", "description": "The shop currency.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "error_code": {"name": "error_code", "description": "A standardized error code, independent of the payment provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test": {"name": "test", "description": "Whether the transaction is a test transaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bq-instance`.`shopify`.`transaction`", "created_at": 1653000361.457237}, "source.shopify_source.shopify.refund": {"fqn": ["shopify_source", "shopify", "refund"], "database": "bq-instance", "schema": "shopify", "unique_id": "source.shopify_source.shopify.refund", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "refund", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "refund", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Each record represents a refund within Shopify.", "columns": {"id": {"name": "id", "description": "The unique numeric identifier for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of the date when the refund was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "processed_at": {"name": "processed_at", "description": "Timestamp of the date when the refund was processed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "note": {"name": "note", "description": "User generated note attached to the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "restock": {"name": "restock", "description": "Boolean indicating if the refund is a result of a restock.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Reference to the user id which generated the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_duties_set": {"name": "total_duties_set", "description": "Record representing total duties set for the refund.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the refund is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bq-instance`.`shopify`.`refund`", "created_at": 1653000361.457452}, "source.shopify_source.shopify.order_adjustment": {"fqn": ["shopify_source", "shopify", "order_adjustment"], "database": "bq-instance", "schema": "shopify", "unique_id": "source.shopify_source.shopify.order_adjustment", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "models/src_shopify.yml", "original_file_path": "models/src_shopify.yml", "name": "order_adjustment", "source_name": "shopify", "source_description": "", "loader": "", "identifier": "order_adjustment", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Each record represents and adjustment to and order within Shopify.", "columns": {"id": {"name": "id", "description": "The unique numeric identifier for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_id": {"name": "order_id", "description": "Reference to the order which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "refund_id": {"name": "refund_id", "description": "Reference to the refund which the adjustment is associated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Amount of the adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount": {"name": "tax_amount", "description": "Tax amount applied to the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "kind": {"name": "kind", "description": "The kind of order adjustment (eg. refund, restock, etc.).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "The reason for the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount_set": {"name": "amount_set", "description": "Amount set towards the order adjustment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tax_amount_set": {"name": "tax_amount_set", "description": "Tax amount set towards the order adjustment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bq-instance`.`shopify`.`order_adjustment`", "created_at": 1653000361.457603}}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.306684}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.307295}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.308032}, "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.8/lib/python3.8/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": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.314558}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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": [], "created_at": 1653000359.324791}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.325791}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\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": [], "created_at": 1653000359.326745}, "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.8/lib/python3.8/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 {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.327441}, "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.8/lib/python3.8/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": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.329149}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.3298008}, "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.8/lib/python3.8/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_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.330658}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.331022}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.331371}, "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.8/lib/python3.8/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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.3319}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.332302}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.332892}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.333162}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.3338308}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.334327}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.3349051}, "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.8/lib/python3.8/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": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.3356779}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.3361092}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.3365388}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {{ return(run_query(sql)) }}\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": 1653000359.337646}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n \n {{ return(run_query(sql)) }}\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": 1653000359.338825}, "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.8/lib/python3.8/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 {#-- 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": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.340587}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n \n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.341032}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.341971}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.3424032}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.344054}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.3454971}, "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.8/lib/python3.8/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() %}\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": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.347363}, "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.8/lib/python3.8/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\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\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\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": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.385188}, "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.8/lib/python3.8/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 {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter's copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = '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": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.389055}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, sql) %}\n\n {% if '_dbt_max_partition' in sql %}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.393831}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.395278}, "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.8/lib/python3.8/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(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\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\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n \n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\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": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.3991559}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\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, target_relation, sql, unique_key, partition_by, partitions, dest_columns, on_schema_change\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.401932}, "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.8/lib/python3.8/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 {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\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 \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 \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 \n {% else %}\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' %} {# Check first, since otherwise we may not build a temp table #}\n {% do run_query(\n declare_dbt_max_partition(this, partition_by, sql) + create_table_as(True, tmp_relation, sql)\n ) %}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\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": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.409641}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.410988}, "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.8/lib/python3.8/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": [], "created_at": 1653000359.4114208}, "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.8/lib/python3.8/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": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.411786}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.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": 1653000359.414637}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.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": 1653000359.4152}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.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": 1653000359.415605}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.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": 1653000359.4160168}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.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": 1653000359.4164228}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.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": 1653000359.4175448}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.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": 1653000359.4183621}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.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": 1653000359.419189}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.4203892}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/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": 1653000359.4211478}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/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": 1653000359.4291751}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.429676}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/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": 1653000359.43029}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.43069}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/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": 1653000359.430963}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/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/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.4330502}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.433501}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/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": 1653000359.43397}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/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": 1653000359.436666}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/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": 1653000359.441833}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.448093}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.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": 1653000359.448891}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.44936}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.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": 1653000359.449606}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.45017}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.45248}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.453024}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.453738}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.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": 1653000359.45761}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/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": 1653000359.482412}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n \n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n \n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n \n {% do relations.append(target_relation) %}\n \n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n \n {{ adapter.commit() }}\n \n {% else %}\n\n {% set main_sql = sql %}\n \n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n \n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "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": 1653000359.489791}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.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', 'dbt')(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": 1653000359.491795}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.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": 1653000359.492872}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.494396}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.496066}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n \n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.499331}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n \n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n \n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.5013492}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n \n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }} \n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.503435}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/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', 'dbt')(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": 1653000359.512539}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/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": 1653000359.5175629}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/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', 'dbt')(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": 1653000359.518843}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/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\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": 1653000359.520576}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/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', 'dbt')(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": 1653000359.5215812}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/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": 1653000359.523915}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/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": 1653000359.5271811}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/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(target_relation) %}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n -- the intermediate_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {% set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) %} \n {% set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {# -- first check whether we want to full refresh for source view or config reasons #}\n {% set trigger_full_refresh = (full_refresh_mode or existing_relation.is_view) %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n{% elif trigger_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 {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\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 {% 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 {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = get_delete_insert_merge_sql(target_relation, tmp_relation, unique_key, dest_columns) %}\n \n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %} \n {% do adapter.rename_relation(target_relation, backup_relation) %} \n {% do adapter.rename_relation(intermediate_relation, target_relation) %} \n {% 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.make_temp_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.get_delete_insert_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.552459}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n \n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n \n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n \n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.5748339}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n \n {% set schema_changed = False %}\n \n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n \n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n \n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.580535}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n \n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n \n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %} \n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n \n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n \n {% do log(schema_change_message) %}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.5867789}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n \n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n \n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n \n {% if schema_changes_dict['schema_changed'] %}\n \n {% if on_schema_change == 'fail' %}\n \n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways: \n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n {% endset %}\n \n {% do exceptions.raise_compiler_error(fail_msg) %}\n \n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n \n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {% endif %}\n \n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.590505}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/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 -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\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 -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_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.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.603631}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.6055381}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.606442}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.607312}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.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{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.610353}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/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 -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\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 -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ 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(old_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.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.622119}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.62377}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.6247659}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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 {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks) }}\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.get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.630044}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.631928}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.632938}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.6338828}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.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": 1653000359.635207}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/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": 1653000359.648227}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.659436}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.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": 1653000359.663011}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.66391}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.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": 1653000359.665976}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.666517}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.6669388}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.6674938}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.667905}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.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": 1653000359.6695309}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.670337}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.674888}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.676924}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__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": 1653000359.677927}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.679832}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.68079}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/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": 1653000359.681771}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/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', 'dbt')(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": 1653000359.683434}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/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": 1653000359.684412}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/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": 1653000359.685735}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/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": 1653000359.686823}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/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": 1653000359.68818}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/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 {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.690866}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.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": 1653000359.694567}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.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": 1653000359.696579}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.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": 1653000359.6976728}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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": 1653000359.702622}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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": 1653000359.706869}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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": 1653000359.709619}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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": 1653000359.7105138}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.712008}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.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": 1653000359.712702}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.713341}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.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": 1653000359.71402}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.715682}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.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": 1653000359.7161899}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(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": 1653000359.7167418}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.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": 1653000359.718112}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.722655}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.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": 1653000359.723899}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.724997}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.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": 1653000359.726076}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(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": 1653000359.7267358}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.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": 1653000359.727318}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.728226}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.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": 1653000359.729172}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.729963}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.731749}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.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": 1653000359.732495}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.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": 1653000359.7331462}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.734849}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.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": 1653000359.73533}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.7360818}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/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 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": 1653000359.7375622}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.739838}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.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": 1653000359.7404459}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.741291}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.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": 1653000359.7421062}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.743072}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.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": 1653000359.7447581}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(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": [], "created_at": 1653000359.748899}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.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": 1653000359.749791}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.7504692}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.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": 1653000359.75104}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.751662}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.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": 1653000359.7524962}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.7532}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.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": 1653000359.7544708}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.755147}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.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": 1653000359.755905}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.76113}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.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": 1653000359.7616892}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.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": 1653000359.76272}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "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": 1653000359.7633338}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.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": 1653000359.764499}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.765277}, "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.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.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": 1653000359.76734}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.768298}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n \n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n \n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n \n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.7715368}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.7735832}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.774393}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.7753558}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.7762828}, "macro.shopify_source.get_order_columns": {"unique_id": "macro.shopify_source.get_order_columns", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_columns", "macro_sql": "{% macro get_order_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_id\"},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"total_discounts\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_line_items_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"total_tax\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"source_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subtotal_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"taxes_included\", \"datatype\": \"boolean\", \"alias\": \"has_taxes_included\"},\n {\"name\": \"total_weight\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"landing_site_base_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"note\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"number\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"order_number\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"cancel_reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"cancelled_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"cancelled_timestamp\"},\n {\"name\": \"cart_token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"checkout_token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"closed_timestamp\"},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customer_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"financial_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"processing_method\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"referring_site\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_address_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_latitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_longitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_province\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_province_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_address_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"browser_ip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"buyer_accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_buyer_accepted_marketing\"},\n {\"name\": \"total_shipping_price_set\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_address_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_latitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_longitude\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_province\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_province_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shipping_address_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"test\", \"datatype\": \"boolean\", \"alias\": \"is_test_order\"},\n {\"name\": \"token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_numeric", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_float", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.816113}, "macro.shopify_source.get_customer_columns": {"unique_id": "macro.shopify_source.get_customer_columns", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_customer_columns", "macro_sql": "{% macro get_customer_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_accepted_marketing\"},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"default_address_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"customer_id\"},\n {\"name\": \"last_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"orders_count\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"phone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string(), \"alias\": \"account_state\"},\n {\"name\": \"tax_exempt\", \"datatype\": \"boolean\", \"alias\": \"is_tax_exempt\"},\n {\"name\": \"total_spent\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"verified_email\", \"datatype\": \"boolean\", \"alias\": \"is_verified_email\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_numeric", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.821568}, "macro.shopify_source.get_order_line_refund_columns": {"unique_id": "macro.shopify_source.get_order_line_refund_columns", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_line_refund_columns", "macro_sql": "{% macro get_order_line_refund_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_line_refund_id\"},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"order_line_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"subtotal\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"total_tax\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"restock_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_timestamp", "macro.dbt_utils.type_numeric", "macro.dbt_utils.type_float", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.824715}, "macro.shopify_source.get_order_line_columns": {"unique_id": "macro.shopify_source.get_order_line_columns", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_line_columns", "macro_sql": "{% macro get_order_line_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"fulfillable_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"gift_card\", \"datatype\": \"boolean\", \"alias\": \"is_gift_card\"},\n {\"name\": \"grams\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_line_id\"},\n {\"name\": \"index\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"pre_tax_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"product_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_charge_interval_frequency\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_for_shipping_jan_3_rd_2020\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"property_shipping_interval_frequency\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"property_shipping_interval_unit_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"property_subscription_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"requires_shipping\", \"datatype\": \"boolean\", \"alias\": \"is_requiring_shipping\"},\n {\"name\": \"sku\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_discount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"variant_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"vendor\", \"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_numeric", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.832533}, "macro.shopify_source.get_product_columns": {"unique_id": "macro.shopify_source.get_product_columns", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_product_columns", "macro_sql": "{% macro get_product_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"handle\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"product_id\"},\n {\"name\": \"product_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"published_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"published_timestamp\"},\n {\"name\": \"published_scope\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"vendor\", \"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_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.836467}, "macro.shopify_source.get_product_variant_columns": {"unique_id": "macro.shopify_source.get_product_variant_columns", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_product_variant_columns", "macro_sql": "{% macro get_product_variant_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"variant_id\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"product_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"inventory_item_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"image_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"sku\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"position\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"inventory_policy\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"compare_at_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inventory_management\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"barcode\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"grams\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"inventory_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"weight\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"weight_unit\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_2\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"option_3\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tax_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"old_inventory_quantity\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"requires_shipping\", \"datatype\": \"boolean\", \"alias\": \"is_requiring_shipping\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_numeric", "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": 1653000359.844438}, "macro.shopify_source.get_transaction_columns": {"unique_id": "macro.shopify_source.get_transaction_columns", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_transaction_columns", "macro_sql": "{% macro get_transaction_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"transaction_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"device_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"gateway\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"source_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"message\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"payment_avs_result_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_bin\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_cvv_result_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_number\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"payment_credit_card_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"kind\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"receipt\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency_exchange_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_adjustment\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_original_amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_final_amount\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"currency_exchange_currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"test\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{% if target.type in ('redshift','postgres') %}\n {{ columns.append({\"name\": \"authorization\", \"datatype\": dbt_utils.type_string(), \"quote\": True, \"alias\": \"authorization\"}) }}\n{% else %}\n {\"name\": \"authorization\", \"datatype\": dbt_utils.type_string()}\n{% endif %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_numeric", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.85456}, "macro.shopify_source.get_refund_columns": {"unique_id": "macro.shopify_source.get_refund_columns", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_refund_columns", "macro_sql": "{% macro get_refund_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"refund_id\"},\n {\"name\": \"note\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"processed_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"restock\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_numeric()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_numeric", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.857431}, "macro.shopify_source.get_order_adjustment_columns": {"unique_id": "macro.shopify_source.get_order_adjustment_columns", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "macros/staging_columns.sql", "original_file_path": "macros/staging_columns.sql", "name": "get_order_adjustment_columns", "macro_sql": "{% macro get_order_adjustment_columns() %}\n\n{% set columns = [\n {\"name\": \"id\", \"datatype\": dbt_utils.type_numeric(), \"alias\": \"order_adjustment_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt_utils.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tax_amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"kind\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_numeric", "macro.dbt_utils.type_float", "macro.dbt_utils.type_string", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.860229}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.861425}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8618398}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.862135}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8635771}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.864188}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.865369}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8658078}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.867896}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.868182}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.868438}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.868695}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.868952}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.869496}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.869767}, "macro.dbt_utils.postgres__type_timestamp": {"unique_id": "macro.dbt_utils.postgres__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() %}\n timestamp without time zone\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.8700318}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.870284}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.870843}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8711019}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8713548}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.8718889}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8723269}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8725739}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.8731}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8733509}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.873593}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.874115}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.874363}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.874603}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.876228}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8772821}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.877627}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.877963}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.87971}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8802528}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.880785}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8813062}, "macro.dbt_utils.redshift__dateadd": {"unique_id": "macro.dbt_utils.redshift__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.881932}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.8829162}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.883171}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.883415}, "macro.dbt_utils.escape_single_quotes": {"unique_id": "macro.dbt_utils.escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.884661}, "macro.dbt_utils.default__escape_single_quotes": {"unique_id": "macro.dbt_utils.default__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.885122}, "macro.dbt_utils.snowflake__escape_single_quotes": {"unique_id": "macro.dbt_utils.snowflake__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "snowflake__escape_single_quotes", "macro_sql": "{% macro snowflake__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.8855731}, "macro.dbt_utils.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_utils.bigquery__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.8860202}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.887847}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.888312}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.8888478}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.889345}, "macro.dbt_utils.listagg": {"unique_id": "macro.dbt_utils.listagg", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt_utils') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.894352}, "macro.dbt_utils.default__listagg": {"unique_id": "macro.dbt_utils.default__listagg", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.89568}, "macro.dbt_utils.bigquery__listagg": {"unique_id": "macro.dbt_utils.bigquery__listagg", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.896537}, "macro.dbt_utils.postgres__listagg": {"unique_id": "macro.dbt_utils.postgres__listagg", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n \n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.897751}, "macro.dbt_utils.redshift__listagg": {"unique_id": "macro.dbt_utils.redshift__listagg", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "redshift__listagg", "macro_sql": "{% macro redshift__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n {% set ns = namespace() %}\n {% set ns.delimiter_text_regex = delimiter_text|trim(\"'\") %}\n {% set special_chars %}\\,^,$,.,|,?,*,+,(,),[,],{,}{% endset %} \n {%- for char in special_chars.split(',') -%}\n {% set escape_char %}\\\\{{ char }}{% endset %}\n {% set ns.delimiter_text_regex = ns.delimiter_text_regex|replace(char,escape_char) %}\n {%- endfor -%}\n\n {% set regex %}'([^{{ ns.delimiter_text_regex }}]+{{ ns.delimiter_text_regex }}){1,{{ limit_num - 1}}}[^{{ ns.delimiter_text_regex }}]+'{% endset %}\n regexp_substr(\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,{{ regex }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.900565}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.9062421}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9067268}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.907171}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9118102}, "macro.dbt_utils.redshift__datediff": {"unique_id": "macro.dbt_utils.redshift__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9123461}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.913471}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.913862}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.914212}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.914558}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.9154649}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.915839}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.916188}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.917089}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.91747}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9178061}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__identifier"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.919255}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.919607}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9199228}, "macro.dbt_utils.any_value": {"unique_id": "macro.dbt_utils.any_value", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.920848}, "macro.dbt_utils.default__any_value": {"unique_id": "macro.dbt_utils.default__any_value", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n \n any_value({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.921131}, "macro.dbt_utils.postgres__any_value": {"unique_id": "macro.dbt_utils.postgres__any_value", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n {#- /*Postgres doesn't support any_value, so we're using min() to get the same result*/ -#}\n min({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.921421}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.9224489}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.922821}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9231842}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.923967}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.924256}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.9259121}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.926222}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.926422}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.92662}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.927042}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.927434}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.92785}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.92816}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.928523}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9313731}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.932618}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.933841}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.934361}, "macro.dbt_utils.bool_or": {"unique_id": "macro.dbt_utils.bool_or", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.9355562}, "macro.dbt_utils.default__bool_or": {"unique_id": "macro.dbt_utils.default__bool_or", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n \n bool_or({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.935858}, "macro.dbt_utils.snowflake__bool_or": {"unique_id": "macro.dbt_utils.snowflake__bool_or", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "snowflake__bool_or", "macro_sql": "{% macro snowflake__bool_or(expression) -%}\n \n boolor_agg({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.936136}, "macro.dbt_utils.bigquery__bool_or": {"unique_id": "macro.dbt_utils.bigquery__bool_or", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n \n logical_or({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.9364128}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.937815}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.938525}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.938921}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.939939}, "macro.dbt_utils.redshift__last_day": {"unique_id": "macro.dbt_utils.redshift__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.940407}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.943448}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9440682}, "macro.dbt_utils._split_part_negative": {"unique_id": "macro.dbt_utils._split_part_negative", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }}) \n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.944675}, "macro.dbt_utils.postgres__split_part": {"unique_id": "macro.dbt_utils.postgres__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt_utils.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt_utils._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__split_part", "macro.dbt_utils._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.945559}, "macro.dbt_utils.redshift__split_part": {"unique_id": "macro.dbt_utils.redshift__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "redshift__split_part", "macro_sql": "{% macro redshift__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt_utils.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt_utils._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__split_part", "macro.dbt_utils._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.946433}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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 {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }}) \n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.947388}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000359.948444}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9488}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9491572}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9516501}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.962674}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.96404}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.964884}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.966232}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.980107}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9812968}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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(\n dbt_utils.replace(field, \"'android-app://'\", \"''\"\n ), \"'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{%- 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": 1653000359.982551}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9839659}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.985704}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.986752}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000359.9876091}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_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": 1653000359.988953}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_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": 1653000359.989556}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_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": 1653000359.99069}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_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": 1653000359.991585}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_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": 1653000359.993227}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_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": 1653000359.994146}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_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": 1653000359.995301}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_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": 1653000359.996186}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_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": 1653000359.997165}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_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": 1653000359.997639}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_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": 1653000359.9992661}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_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": 1653000360.00056}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_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": 1653000360.002135}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_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": 1653000360.003308}, "macro.dbt_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_unique_where.sql", "original_file_path": "macros/generic_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": 1653000360.004558}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_unique_where.sql", "original_file_path": "macros/generic_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": 1653000360.004997}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_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": 1653000360.0060859}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_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": 1653000360.006602}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_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": 1653000360.0083132}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_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": 1653000360.01003}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_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": 1653000360.011494}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_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": 1653000360.012397}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_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": 1653000360.013692}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_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": 1653000360.014478}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_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', 'dbt_utils')(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": 1653000360.015719}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_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 *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.017096}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_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": 1653000360.018738}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\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.slugify", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.020517}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_not_null_where.sql", "original_file_path": "macros/generic_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": 1653000360.021874}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_not_null_where.sql", "original_file_path": "macros/generic_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": 1653000360.022337}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_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": 1653000360.0241868}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_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, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "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": 1653000360.0267131}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_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": 1653000360.03285}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_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 }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}\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": 1653000360.0369558}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.037975}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.038421}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.039346}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.039955}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.04087}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.041348}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.042845}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.044506}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.0460749}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.046697}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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\n{# call 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\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": 1653000360.0476549}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.048766}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.049699}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.051483}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.053924}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.0559402}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.057086}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.0576189}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.0590348}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.0608242}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.063116}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.06446}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.06521}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\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": 1653000360.0668511}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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=[], prefix='', suffix='') -%}\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 {%- for col in dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\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", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.0691688}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.073144}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.0786822}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\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": 1653000360.0838919}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\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 {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\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 {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "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": 1653000360.0916228}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.092641}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.093311}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by=none, relation_alias=none) -%}\n\n {%- set error_message_group_by -%}\nWarning: the `group_by` parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nUse `partition_by` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if kwargs.get('group_by') %}\n {%- do exceptions.warn(error_message_group_by) -%}\n {%- endif -%}\n\n {%- set error_message_order_by -%}\nWarning: `order_by` as an optional parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nSupply a non-null value for `order_by` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if not order_by %}\n {%- do exceptions.warn(error_message_order_by) -%}\n {%- endif -%}\n\n {%- set error_message_alias -%}\nWarning: the `relation_alias` parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nIf you were using `relation_alias` to point to a CTE previously then you can now pass the alias directly to `relation` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if relation_alias %}\n {%- do exceptions.warn(error_message_alias) -%}\n {%- endif -%}\n\n {% set partition_by = partition_by or kwargs.get('group_by') %}\n {% set relation = relation_alias or relation %}\n {% set order_by = order_by or \"'1'\" %}\n\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.098675}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.099262}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.099819}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.100352}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.100817}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.101281}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.102914}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.105411}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.106601}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.107357}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.1083431}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.109243}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.112365}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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 {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.113101}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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 {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.1151779}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.1165671}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\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": 1653000360.11923}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.123332}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.1259599}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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 value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt_utils.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.128329}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.129672}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "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": 1653000360.131684}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.132852}, "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/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.1344378}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.135634}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.13588}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.136108}, "macro.dbt_utils.bigquery__get_table_types_sql": {"unique_id": "macro.dbt_utils.bigquery__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "bigquery__get_table_types_sql", "macro_sql": "{% macro bigquery__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as `table_type`\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.1363342}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.138609}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.139393}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.1409652}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.143313}, "macro.spark_utils.get_tables": {"unique_id": "macro.spark_utils.get_tables", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.153495}, "macro.spark_utils.get_delta_tables": {"unique_id": "macro.spark_utils.get_delta_tables", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.155349}, "macro.spark_utils.get_statistic_columns": {"unique_id": "macro.spark_utils.get_statistic_columns", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.157662}, "macro.spark_utils.spark_optimize_delta_tables": {"unique_id": "macro.spark_utils.spark_optimize_delta_tables", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.15956}, "macro.spark_utils.spark_vacuum_delta_tables": {"unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.1614609}, "macro.spark_utils.spark_analyze_tables": {"unique_id": "macro.spark_utils.spark_analyze_tables", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.1638}, "macro.spark_utils.spark__concat": {"unique_id": "macro.spark_utils.spark__concat", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "name": "spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.164525}, "macro.spark_utils.spark__type_numeric": {"unique_id": "macro.spark_utils.spark__type_numeric", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "name": "spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.1649878}, "macro.spark_utils.spark__dateadd": {"unique_id": "macro.spark_utils.spark__dateadd", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "name": "spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.171515}, "macro.spark_utils.spark__datediff": {"unique_id": "macro.spark_utils.spark__datediff", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "name": "spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.186767}, "macro.spark_utils.spark__current_timestamp": {"unique_id": "macro.spark_utils.spark__current_timestamp", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp", "macro_sql": "{% macro spark__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": 1653000360.187254}, "macro.spark_utils.spark__current_timestamp_in_utc": {"unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.187453}, "macro.spark_utils.spark__split_part": {"unique_id": "macro.spark_utils.spark__split_part", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "name": "spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.188906}, "macro.spark_utils.spark__get_relations_by_pattern": {"unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.192388}, "macro.spark_utils.spark__get_relations_by_prefix": {"unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.193255}, "macro.spark_utils.spark__get_tables_by_pattern": {"unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.193868}, "macro.spark_utils.spark__get_tables_by_prefix": {"unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.1945238}, "macro.spark_utils.assert_not_null": {"unique_id": "macro.spark_utils.assert_not_null", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.1953}, "macro.spark_utils.default__assert_not_null": {"unique_id": "macro.spark_utils.default__assert_not_null", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.195756}, "macro.spark_utils.spark__convert_timezone": {"unique_id": "macro.spark_utils.spark__convert_timezone", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "name": "spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.196325}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.197288}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.198858}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.199224}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.199583}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.199947}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2005188}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.200999}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.202008}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.202959}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.2048378}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.205695}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.206243}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.206771}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.207294}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2078788}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.208533}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.209603}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.209834}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.210059}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.210281}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.211436}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2129998}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.214741}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.21571}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2161121}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.216817}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2174678}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2177868}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.222336}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.222713}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.223072}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.223617}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.227859}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.2294972}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_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": 1653000360.2300642}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.231146}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.232429}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.232873}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "bigquery__try_cast", "macro_sql": "{% macro bigquery__try_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": 1653000360.2331991}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "spark__try_cast", "macro_sql": "{% macro spark__try_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": 1653000360.233483}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.2347572}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt_utils.type_string() }}) as source_relation\n{% endif %}\n\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": 1653000360.235994}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.237061}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.237518}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.238011}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.238684}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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 {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\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": 1653000360.2407649}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.248496}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2492642}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.250619}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.253845}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.255031}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.256442}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.256783}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.257123}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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 case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.2575018}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2578402}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2581718}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.259486}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ 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": 1653000360.2617111}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.2631118}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2636118}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2639658}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.264447}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2647932}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.265172}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2658172}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.266051}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.266281}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2678232}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1653000360.2699552}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n\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_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\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": 1653000360.273972}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.277021}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2776818}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.277911}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.278134}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.2793658}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/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": 1653000360.280313}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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 `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "shopify_source._fivetran_synced": {"unique_id": "shopify_source._fivetran_synced", "package_name": "shopify_source", "root_path": "/Users/renee.li/Documents/dbt/shopify/develop/dbt_packages/shopify_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "_fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"model.develop.my_first_dbt_model": [], "model.develop.my_second_dbt_model": ["model.develop.my_first_dbt_model"], "model.shopify_source.stg_shopify__order_line": ["model.shopify_source.stg_shopify__order_line_tmp", "model.shopify_source.stg_shopify__order_line_tmp"], "model.shopify_source.stg_shopify__refund": ["model.shopify_source.stg_shopify__refund_tmp", "model.shopify_source.stg_shopify__refund_tmp"], "model.shopify_source.stg_shopify__product": ["model.shopify_source.stg_shopify__product_tmp", "model.shopify_source.stg_shopify__product_tmp"], "model.shopify_source.stg_shopify__product_variant": ["model.shopify_source.stg_shopify__product_variant_tmp", "model.shopify_source.stg_shopify__product_variant_tmp"], "model.shopify_source.stg_shopify__order": ["model.shopify_source.stg_shopify__order_tmp", "model.shopify_source.stg_shopify__order_tmp"], "model.shopify_source.stg_shopify__transaction": ["model.shopify_source.stg_shopify__transaction_tmp", "model.shopify_source.stg_shopify__transaction_tmp"], "model.shopify_source.stg_shopify__order_adjustment": ["model.shopify_source.stg_shopify__order_adjustment_tmp", "model.shopify_source.stg_shopify__order_adjustment_tmp"], "model.shopify_source.stg_shopify__customer": ["model.shopify_source.stg_shopify__customer_tmp", "model.shopify_source.stg_shopify__customer_tmp"], "model.shopify_source.stg_shopify__order_line_refund": ["model.shopify_source.stg_shopify__order_line_refund_tmp", "model.shopify_source.stg_shopify__order_line_refund_tmp"], "model.shopify_source.stg_shopify__customer_tmp": ["source.shopify_source.shopify.customer"], "model.shopify_source.stg_shopify__order_line_tmp": ["source.shopify_source.shopify.order_line"], "model.shopify_source.stg_shopify__refund_tmp": ["source.shopify_source.shopify.refund"], "model.shopify_source.stg_shopify__product_tmp": ["source.shopify_source.shopify.product"], "model.shopify_source.stg_shopify__order_adjustment_tmp": ["source.shopify_source.shopify.order_adjustment"], "model.shopify_source.stg_shopify__order_line_refund_tmp": ["source.shopify_source.shopify.order_line_refund"], "model.shopify_source.stg_shopify__transaction_tmp": ["source.shopify_source.shopify.transaction"], "model.shopify_source.stg_shopify__product_variant_tmp": ["source.shopify_source.shopify.product_variant"], "model.shopify_source.stg_shopify__order_tmp": ["source.shopify_source.shopify.order"], "test.develop.unique_my_first_dbt_model_id.16e066b321": ["model.develop.my_first_dbt_model"], "test.develop.not_null_my_first_dbt_model_id.5fb22c2710": ["model.develop.my_first_dbt_model"], "test.develop.unique_my_second_dbt_model_id.57a0f8c493": ["model.develop.my_second_dbt_model"], "test.develop.not_null_my_second_dbt_model_id.151b76d778": ["model.develop.my_second_dbt_model"], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__customer_customer_id__source_relation.1b2185db25": ["model.shopify_source.stg_shopify__customer"], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_line_refund_order_line_refund_id__source_relation.1877420c29": ["model.shopify_source.stg_shopify__order_line_refund"], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_line_order_line_id__source_relation.c2797e7a9c": ["model.shopify_source.stg_shopify__order_line"], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_order_id__source_relation.81d10381c1": ["model.shopify_source.stg_shopify__order"], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_product_id__source_relation.48b32ab6a2": ["model.shopify_source.stg_shopify__product"], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_variant_variant_id__source_relation.7506695ec0": ["model.shopify_source.stg_shopify__product_variant"], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__transaction_transaction_id__source_relation.d55a33652a": ["model.shopify_source.stg_shopify__transaction"], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__refund_refund_id__source_relation.cd4dbc2b35": ["model.shopify_source.stg_shopify__refund"], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_adjustment_order_adjustment_id__source_relation.00b7d10cb0": ["model.shopify_source.stg_shopify__order_adjustment"], "source.shopify_source.shopify.order": [], "source.shopify_source.shopify.customer": [], "source.shopify_source.shopify.order_line": [], "source.shopify_source.shopify.order_line_refund": [], "source.shopify_source.shopify.product": [], "source.shopify_source.shopify.product_variant": [], "source.shopify_source.shopify.transaction": [], "source.shopify_source.shopify.refund": [], "source.shopify_source.shopify.order_adjustment": []}, "child_map": {"model.develop.my_first_dbt_model": ["model.develop.my_second_dbt_model", "test.develop.not_null_my_first_dbt_model_id.5fb22c2710", "test.develop.unique_my_first_dbt_model_id.16e066b321"], "model.develop.my_second_dbt_model": ["test.develop.not_null_my_second_dbt_model_id.151b76d778", "test.develop.unique_my_second_dbt_model_id.57a0f8c493"], "model.shopify_source.stg_shopify__order_line": ["test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_line_order_line_id__source_relation.c2797e7a9c"], "model.shopify_source.stg_shopify__refund": ["test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__refund_refund_id__source_relation.cd4dbc2b35"], "model.shopify_source.stg_shopify__product": ["test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_product_id__source_relation.48b32ab6a2"], "model.shopify_source.stg_shopify__product_variant": ["test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_variant_variant_id__source_relation.7506695ec0"], "model.shopify_source.stg_shopify__order": ["test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_order_id__source_relation.81d10381c1"], "model.shopify_source.stg_shopify__transaction": ["test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__transaction_transaction_id__source_relation.d55a33652a"], "model.shopify_source.stg_shopify__order_adjustment": ["test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_adjustment_order_adjustment_id__source_relation.00b7d10cb0"], "model.shopify_source.stg_shopify__customer": ["test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__customer_customer_id__source_relation.1b2185db25"], "model.shopify_source.stg_shopify__order_line_refund": ["test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_line_refund_order_line_refund_id__source_relation.1877420c29"], "model.shopify_source.stg_shopify__customer_tmp": ["model.shopify_source.stg_shopify__customer", "model.shopify_source.stg_shopify__customer"], "model.shopify_source.stg_shopify__order_line_tmp": ["model.shopify_source.stg_shopify__order_line", "model.shopify_source.stg_shopify__order_line"], "model.shopify_source.stg_shopify__refund_tmp": ["model.shopify_source.stg_shopify__refund", "model.shopify_source.stg_shopify__refund"], "model.shopify_source.stg_shopify__product_tmp": ["model.shopify_source.stg_shopify__product", "model.shopify_source.stg_shopify__product"], "model.shopify_source.stg_shopify__order_adjustment_tmp": ["model.shopify_source.stg_shopify__order_adjustment", "model.shopify_source.stg_shopify__order_adjustment"], "model.shopify_source.stg_shopify__order_line_refund_tmp": ["model.shopify_source.stg_shopify__order_line_refund", "model.shopify_source.stg_shopify__order_line_refund"], "model.shopify_source.stg_shopify__transaction_tmp": ["model.shopify_source.stg_shopify__transaction", "model.shopify_source.stg_shopify__transaction"], "model.shopify_source.stg_shopify__product_variant_tmp": ["model.shopify_source.stg_shopify__product_variant", "model.shopify_source.stg_shopify__product_variant"], "model.shopify_source.stg_shopify__order_tmp": ["model.shopify_source.stg_shopify__order", "model.shopify_source.stg_shopify__order"], "test.develop.unique_my_first_dbt_model_id.16e066b321": [], "test.develop.not_null_my_first_dbt_model_id.5fb22c2710": [], "test.develop.unique_my_second_dbt_model_id.57a0f8c493": [], "test.develop.not_null_my_second_dbt_model_id.151b76d778": [], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__customer_customer_id__source_relation.1b2185db25": [], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_line_refund_order_line_refund_id__source_relation.1877420c29": [], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_line_order_line_id__source_relation.c2797e7a9c": [], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_order_id__source_relation.81d10381c1": [], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_product_id__source_relation.48b32ab6a2": [], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_variant_variant_id__source_relation.7506695ec0": [], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__transaction_transaction_id__source_relation.d55a33652a": [], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__refund_refund_id__source_relation.cd4dbc2b35": [], "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__order_adjustment_order_adjustment_id__source_relation.00b7d10cb0": [], "source.shopify_source.shopify.order": ["model.shopify_source.stg_shopify__order_tmp"], "source.shopify_source.shopify.customer": ["model.shopify_source.stg_shopify__customer_tmp"], "source.shopify_source.shopify.order_line": ["model.shopify_source.stg_shopify__order_line_tmp"], "source.shopify_source.shopify.order_line_refund": ["model.shopify_source.stg_shopify__order_line_refund_tmp"], "source.shopify_source.shopify.product": ["model.shopify_source.stg_shopify__product_tmp"], "source.shopify_source.shopify.product_variant": ["model.shopify_source.stg_shopify__product_variant_tmp"], "source.shopify_source.shopify.transaction": ["model.shopify_source.stg_shopify__transaction_tmp"], "source.shopify_source.shopify.refund": ["model.shopify_source.stg_shopify__refund_tmp"], "source.shopify_source.shopify.order_adjustment": ["model.shopify_source.stg_shopify__order_adjustment_tmp"]}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json deleted file mode 100644 index 033b7ad..0000000 --- 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-05-10T15:49:35.002786Z", "invocation_id": "25205f8f-a888-421f-a470-c817bc340294", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.380429Z", "completed_at": "2021-05-10T15:49:34.387731Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.390046Z", "completed_at": "2021-05-10T15:49:34.390091Z"}], "thread_id": "Thread-1", "execution_time": 0.011667013168334961, "adapter_response": {}, "message": null, "unique_id": "seed.shopify_source_integration_tests.shopify_customer_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.380866Z", "completed_at": "2021-05-10T15:49:34.389733Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.390370Z", "completed_at": "2021-05-10T15:49:34.390378Z"}], "thread_id": "Thread-2", "execution_time": 0.011499166488647461, "adapter_response": {}, "message": null, "unique_id": "seed.shopify_source_integration_tests.shopify_order_adjustment_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.380991Z", "completed_at": "2021-05-10T15:49:34.389887Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.390516Z", "completed_at": "2021-05-10T15:49:34.390524Z"}], "thread_id": "Thread-3", "execution_time": 0.011487007141113281, "adapter_response": {}, "message": null, "unique_id": "seed.shopify_source_integration_tests.shopify_order_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.383673Z", "completed_at": "2021-05-10T15:49:34.390228Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.391000Z", "completed_at": "2021-05-10T15:49:34.391007Z"}], "thread_id": "Thread-4", "execution_time": 0.01168370246887207, "adapter_response": {}, "message": null, "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.394466Z", "completed_at": "2021-05-10T15:49:34.401736Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.402372Z", "completed_at": "2021-05-10T15:49:34.402382Z"}], "thread_id": "Thread-2", "execution_time": 0.00969076156616211, "adapter_response": {}, "message": null, "unique_id": "seed.shopify_source_integration_tests.shopify_product_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.394584Z", "completed_at": "2021-05-10T15:49:34.401875Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.402534Z", "completed_at": "2021-05-10T15:49:34.402543Z"}], "thread_id": "Thread-3", "execution_time": 0.009727001190185547, "adapter_response": {}, "message": null, "unique_id": "seed.shopify_source_integration_tests.shopify_product_variant_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.396051Z", "completed_at": "2021-05-10T15:49:34.402029Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.402711Z", "completed_at": "2021-05-10T15:49:34.402720Z"}], "thread_id": "Thread-4", "execution_time": 0.009703397750854492, "adapter_response": {}, "message": null, "unique_id": "seed.shopify_source_integration_tests.shopify_refund_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.394082Z", "completed_at": "2021-05-10T15:49:34.406955Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.407952Z", "completed_at": "2021-05-10T15:49:34.407961Z"}], "thread_id": "Thread-1", "execution_time": 0.015594005584716797, "adapter_response": {}, "message": null, "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_refund_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.408103Z", "completed_at": "2021-05-10T15:49:34.417865Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.418744Z", "completed_at": "2021-05-10T15:49:34.418754Z"}], "thread_id": "Thread-2", "execution_time": 0.01235198974609375, "adapter_response": {}, "message": null, "unique_id": "seed.shopify_source_integration_tests.shopify_transaction_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.408227Z", "completed_at": "2021-05-10T15:49:34.418899Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.419665Z", "completed_at": "2021-05-10T15:49:34.419675Z"}], "thread_id": "Thread-3", "execution_time": 0.016571998596191406, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__customer_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.408349Z", "completed_at": "2021-05-10T15:49:34.419219Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.423358Z", "completed_at": "2021-05-10T15:49:34.423369Z"}], "thread_id": "Thread-4", "execution_time": 0.016767024993896484, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__order_adjustment_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.419089Z", "completed_at": "2021-05-10T15:49:34.425052Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.426003Z", "completed_at": "2021-05-10T15:49:34.426011Z"}], "thread_id": "Thread-1", "execution_time": 0.011762857437133789, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__order_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.425591Z", "completed_at": "2021-05-10T15:49:34.434464Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.439695Z", "completed_at": "2021-05-10T15:49:34.439707Z"}], "thread_id": "Thread-2", "execution_time": 0.015750885009765625, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__order_line_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.429859Z", "completed_at": "2021-05-10T15:49:34.439918Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.440547Z", "completed_at": "2021-05-10T15:49:34.440556Z"}], "thread_id": "Thread-3", "execution_time": 0.01871490478515625, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__product_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.430351Z", "completed_at": "2021-05-10T15:49:34.440673Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.444759Z", "completed_at": "2021-05-10T15:49:34.444767Z"}], "thread_id": "Thread-4", "execution_time": 0.019688129425048828, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__product_variant_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.440074Z", "completed_at": "2021-05-10T15:49:34.445514Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.446482Z", "completed_at": "2021-05-10T15:49:34.446490Z"}], "thread_id": "Thread-1", "execution_time": 0.011562108993530273, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__refund_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.445993Z", "completed_at": "2021-05-10T15:49:34.455228Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.455992Z", "completed_at": "2021-05-10T15:49:34.456001Z"}], "thread_id": "Thread-2", "execution_time": 0.016683101654052734, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__order_line_refund_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.450577Z", "completed_at": "2021-05-10T15:49:34.461175Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.461843Z", "completed_at": "2021-05-10T15:49:34.461852Z"}], "thread_id": "Thread-3", "execution_time": 0.020643949508666992, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__transaction_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.455428Z", "completed_at": "2021-05-10T15:49:34.645143Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.645302Z", "completed_at": "2021-05-10T15:49:34.645313Z"}], "thread_id": "Thread-4", "execution_time": 0.1945481300354004, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__customer"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.461398Z", "completed_at": "2021-05-10T15:49:34.683160Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.689710Z", "completed_at": "2021-05-10T15:49:34.689726Z"}], "thread_id": "Thread-1", "execution_time": 0.23671293258666992, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__order_adjustment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.469886Z", "completed_at": "2021-05-10T15:49:34.692671Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.693165Z", "completed_at": "2021-05-10T15:49:34.693173Z"}], "thread_id": "Thread-2", "execution_time": 0.22538495063781738, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__order"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.477821Z", "completed_at": "2021-05-10T15:49:34.693578Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.694116Z", "completed_at": "2021-05-10T15:49:34.694124Z"}], "thread_id": "Thread-3", "execution_time": 0.23022103309631348, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__order_line"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.646417Z", "completed_at": "2021-05-10T15:49:34.815388Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.815593Z", "completed_at": "2021-05-10T15:49:34.815605Z"}], "thread_id": "Thread-4", "execution_time": 0.1698927879333496, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__product"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.707865Z", "completed_at": "2021-05-10T15:49:34.850424Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.850782Z", "completed_at": "2021-05-10T15:49:34.850795Z"}], "thread_id": "Thread-3", "execution_time": 0.1489088535308838, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__order_line_refund"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.693988Z", "completed_at": "2021-05-10T15:49:34.860648Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.860966Z", "completed_at": "2021-05-10T15:49:34.860979Z"}], "thread_id": "Thread-1", "execution_time": 0.16816997528076172, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__product_variant"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.701534Z", "completed_at": "2021-05-10T15:49:34.861168Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.861763Z", "completed_at": "2021-05-10T15:49:34.861771Z"}], "thread_id": "Thread-2", "execution_time": 0.16160893440246582, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__refund"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.851922Z", "completed_at": "2021-05-10T15:49:34.861615Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.862057Z", "completed_at": "2021-05-10T15:49:34.862064Z"}], "thread_id": "Thread-3", "execution_time": 0.011784791946411133, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.not_null_stg_shopify__customer_customer_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.863920Z", "completed_at": "2021-05-10T15:49:34.884223Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.886407Z", "completed_at": "2021-05-10T15:49:34.886420Z"}], "thread_id": "Thread-1", "execution_time": 0.024248123168945312, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.unique_stg_shopify__customer_customer_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.875520Z", "completed_at": "2021-05-10T15:49:34.884882Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.886594Z", "completed_at": "2021-05-10T15:49:34.886602Z"}], "thread_id": "Thread-2", "execution_time": 0.022871971130371094, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.not_null_stg_shopify__order_adjustment_order_adjustment_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.875845Z", "completed_at": "2021-05-10T15:49:34.887112Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.887987Z", "completed_at": "2021-05-10T15:49:34.887997Z"}], "thread_id": "Thread-3", "execution_time": 0.013652801513671875, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.unique_stg_shopify__order_adjustment_order_adjustment_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.889252Z", "completed_at": "2021-05-10T15:49:34.902163Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.902604Z", "completed_at": "2021-05-10T15:49:34.902616Z"}], "thread_id": "Thread-1", "execution_time": 0.014742851257324219, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.not_null_stg_shopify__order_order_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.889591Z", "completed_at": "2021-05-10T15:49:34.902439Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.902764Z", "completed_at": "2021-05-10T15:49:34.902771Z"}], "thread_id": "Thread-2", "execution_time": 0.014523029327392578, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.unique_stg_shopify__order_order_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.898018Z", "completed_at": "2021-05-10T15:49:34.903249Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.904037Z", "completed_at": "2021-05-10T15:49:34.904055Z"}], "thread_id": "Thread-3", "execution_time": 0.01123189926147461, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.not_null_stg_shopify__order_line_order_line_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.905442Z", "completed_at": "2021-05-10T15:49:34.921246Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.921520Z", "completed_at": "2021-05-10T15:49:34.921533Z"}], "thread_id": "Thread-1", "execution_time": 0.01751399040222168, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.unique_stg_shopify__order_line_order_line_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.905836Z", "completed_at": "2021-05-10T15:49:34.921666Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.922296Z", "completed_at": "2021-05-10T15:49:34.922306Z"}], "thread_id": "Thread-2", "execution_time": 0.01783299446105957, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.not_null_stg_shopify__product_product_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.916589Z", "completed_at": "2021-05-10T15:49:34.922172Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.922699Z", "completed_at": "2021-05-10T15:49:34.922706Z"}], "thread_id": "Thread-3", "execution_time": 0.01199197769165039, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.unique_stg_shopify__product_product_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.923832Z", "completed_at": "2021-05-10T15:49:34.937317Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.937801Z", "completed_at": "2021-05-10T15:49:34.937814Z"}], "thread_id": "Thread-1", "execution_time": 0.015024900436401367, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.not_null_stg_shopify__order_line_refund_order_line_refund_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.929063Z", "completed_at": "2021-05-10T15:49:34.938540Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.939130Z", "completed_at": "2021-05-10T15:49:34.939139Z"}], "thread_id": "Thread-2", "execution_time": 0.015558004379272461, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.unique_stg_shopify__order_line_refund_order_line_refund_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.929298Z", "completed_at": "2021-05-10T15:49:34.938725Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.939288Z", "completed_at": "2021-05-10T15:49:34.939296Z"}], "thread_id": "Thread-3", "execution_time": 0.011269807815551758, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.not_null_stg_shopify__product_variant_variant_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.939434Z", "completed_at": "2021-05-10T15:49:34.945347Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.949394Z", "completed_at": "2021-05-10T15:49:34.949410Z"}], "thread_id": "Thread-1", "execution_time": 0.016644954681396484, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.unique_stg_shopify__product_variant_variant_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.945253Z", "completed_at": "2021-05-10T15:49:34.955769Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.956117Z", "completed_at": "2021-05-10T15:49:34.956127Z"}], "thread_id": "Thread-2", "execution_time": 0.011765003204345703, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.not_null_stg_shopify__refund_refund_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.945485Z", "completed_at": "2021-05-10T15:49:34.956585Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.956897Z", "completed_at": "2021-05-10T15:49:34.956905Z"}], "thread_id": "Thread-3", "execution_time": 0.012172222137451172, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.unique_stg_shopify__refund_refund_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.816653Z", "completed_at": "2021-05-10T15:49:34.986018Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.986202Z", "completed_at": "2021-05-10T15:49:34.986213Z"}], "thread_id": "Thread-4", "execution_time": 0.17011499404907227, "adapter_response": {}, "message": null, "unique_id": "model.shopify_source.stg_shopify__transaction"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.987821Z", "completed_at": "2021-05-10T15:49:34.997105Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.997397Z", "completed_at": "2021-05-10T15:49:34.997410Z"}], "thread_id": "Thread-1", "execution_time": 0.010585784912109375, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.not_null_stg_shopify__transaction_transaction_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-05-10T15:49:34.992478Z", "completed_at": "2021-05-10T15:49:34.998020Z"}, {"name": "execute", "started_at": "2021-05-10T15:49:34.998416Z", "completed_at": "2021-05-10T15:49:34.998427Z"}], "thread_id": "Thread-2", "execution_time": 0.010866880416870117, "adapter_response": {}, "message": null, "unique_id": "test.shopify_source.unique_stg_shopify__transaction_transaction_id"}], "elapsed_time": 1.8817899227142334, "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 From f8d977e941e3a63efaf867377bc70ef0616e8f8d Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 1 Dec 2022 12:35:06 -0800 Subject: [PATCH 020/137] integration tests --- integration_tests/ci/sample.profiles.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 2c29324..fbf1d5a 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_test + schema: shopify_source_integration_tests_1 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_test + schema: shopify_source_integration_tests_1 threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_test + schema: shopify_source_integration_tests_1 threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_test + schema: shopify_source_integration_tests_1 threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_test + schema: shopify_source_integration_tests_1 threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks From bf978fd2c0adcda1d82ee980ea46865998ec2585 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 1 Dec 2022 13:43:11 -0800 Subject: [PATCH 021/137] Readme updates --- README.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9770c9a..f3fd8ad 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ To use this dbt package, you must have the following: ## Step 2: Install the package Include the following shopify_source package version in your `packages.yml` file. > TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages. -```yaml +```yml packages: - package: fivetran/shopify_source version: [">=0.7.0", "<0.8.0"] @@ -48,7 +48,6 @@ This package was designed with the intention that users have all relevant Shopif ```yml # dbt_project.yml -... vars: shopify__using_order_adjustment: false # true by default shopify__using_order_line_refund: false # true by default @@ -64,7 +63,6 @@ By default this package will build the Shopify staging models within a schema ti ```yml # dbt_project.yml -... models: shopify_source: +schema: my_new_schema_name # leave blank for just the target_schema @@ -74,6 +72,8 @@ If an individual source table has a different name than the package expects, add > IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_shopify_source/blob/main/dbt_project.yml) variable declarations to see the expected names. ```yml +# dbt_project.yml + vars: shopify__identifier: your_table_name ``` @@ -83,9 +83,6 @@ If you have multiple Shopify connectors in Fivetran and would like to use this p ```yml # dbt_project.yml -... -config-version: 2 - vars: shopify_union_schemas: ['shopify_usa','shopify_canada'] # use this if the data is in different schemas/datasets of the same database/project shopify_union_databases: ['shopify_usa','shopify_canada'] # use this if the data is in different databases/projects but uses the same schema name @@ -96,9 +93,6 @@ This package includes all source columns defined in the staging_columns.sql macr ```yml # dbt_project.yml -... -config-version: 2 - vars: shopify_source: customer_pass_through_columns: [] @@ -125,10 +119,10 @@ This dbt package is dependent on the following dbt packages. Please be aware tha ```yml packages: - package: fivetran/fivetran_utils - version: [">=0.3.0", "<0.4.0"] + version: [">=0.4.0", "<0.5.0"] - package: dbt-labs/dbt_utils - version: [">=0.8.0", "<0.9.0"] + version: [">=1.0.0", "<2.0.0"] ``` # 🙌 How is this package maintained and can I contribute? From 930fcf4c5b4b165b2cb535cb5930b26a70e1e648 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 1 Dec 2022 14:21:39 -0800 Subject: [PATCH 022/137] readme --- README.md | 58 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index f3fd8ad..46ed528 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ packages: version: [">=0.7.0", "<0.8.0"] ``` ## Step 3: Define database and schema variables +### Single connector By default, this package runs using your destination and the `shopify` schema. If this is not where your Shopify data is (for example, if your Shopify schema is named `shopify_fivetran` and your `issue` table is named `usa_issue`), add the following configuration to your root `dbt_project.yml` file: ```yml @@ -42,8 +43,19 @@ vars: shopify_schema: your_schema_name ``` -## Step 4: Disabling models -This package was designed with the intention that users have all relevant Shopify tables being synced by Fivetran. However, if you are a Shopify user that does not operate on returns or adjustments then you will not have the related source tables. As such, you may use the below variable configurations to disable the respective downstream models. All variables are `true` by default. To disable those models, add the below configuration in your root `dbt_project.yml` file: +### Union multiple connectors +If you have multiple Shopify connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the `source_relation` column of each model. To use this functionality, you will need to set either the `shopify_union_schemas` OR `shopify_union_databases` variables (cannot do both) in your root `dbt_project.yml` file: + +```yml +# dbt_project.yml + +vars: + shopify_union_schemas: ['shopify_usa','shopify_canada'] # use this if the data is in different schemas/datasets of the same database/project + shopify_union_databases: ['shopify_usa','shopify_canada'] # use this if the data is in different databases/projects but uses the same schema name +``` + +## Step 4: Disable models for non-existent sources +This package was designed with the intention that users have all relevant Shopify tables being synced by Fivetran. However, if you are a Shopify user that does not operate on `returns` or `adjustments` then you will not have the related source tables. As such, you may use the below variable configurations to disable the respective downstream models. All variables are `true` by default. To disable those models, add the below configuration in your root `dbt_project.yml` file: ```yml # dbt_project.yml @@ -57,6 +69,22 @@ vars: ## (Optional) Step 5: Additional configurations
Expand to view configurations +### Add Passthrough Columns +This package includes all source columns defined in the [staging_columns.sql](https://github.com/fivetran/dbt_shopify_source/blob/master/macros/staging_columns.sql) macro. To add additional columns to this package, do so using our pass-through column variables in your root `dbt_project.yml`. This is extremely useful if you'd like to include custom fields to the package. + +```yml +# dbt_project.yml + +vars: + shopify_source: + customer_pass_through_columns: [] + order_line_refund_pass_through_columns: [] + order_line_pass_through_columns: [] + order_pass_through_columns: [] + product_pass_through_columns: [] + product_variant_pass_through_columns: [] +``` + ### Changing the Build Schema By default this package will build the Shopify staging models within a schema titled ( + `_stg_shopify`) in your target database. If this is not where you would like your staging Shopify data to be written to, add the following configuration to your `dbt_project.yml` file: @@ -77,32 +105,6 @@ If an individual source table has a different name than the package expects, add vars: shopify__identifier: your_table_name ``` -### Union Multiple Shopify Connectors -If you have multiple Shopify connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the `source_relation` column of each model. To use this functionality, you will need to set either the `shopify_union_schemas` or `shopify_union_databases` variables: - -```yml -# dbt_project.yml - -vars: - shopify_union_schemas: ['shopify_usa','shopify_canada'] # use this if the data is in different schemas/datasets of the same database/project - shopify_union_databases: ['shopify_usa','shopify_canada'] # use this if the data is in different databases/projects but uses the same schema name -``` -### Add Passthrough Columns -This package includes all source columns defined in the staging_columns.sql macro. To add additional columns to this package, do so using our pass-through column variables. This is extremely useful if you'd like to include custom fields to the package. - -```yml -# dbt_project.yml - -vars: - shopify_source: - customer_pass_through_columns: [] - order_line_refund_pass_through_columns: [] - order_line_pass_through_columns: [] - order_pass_through_columns: [] - product_pass_through_columns: [] - product_variant_pass_through_columns: [] -``` -
From 261f34a20b3e99379c85285052b5cd58b766ccf4 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 2 Dec 2022 16:37:59 -0800 Subject: [PATCH 023/137] adding new staging models and documenting --- dbt_project.yml | 21 ++ macros/get_abandoned_checkout_columns.sql | 101 +++++++++ macros/get_collection_columns.sql | 21 ++ macros/get_collection_product_columns.sql | 11 + macros/get_customer_tag_columns.sql | 12 + macros/get_discount_code_columns.sql | 15 ++ macros/get_fulfillment_columns.sql | 23 ++ macros/get_inventory_item_columns.sql | 19 ++ macros/get_inventory_level_columns.sql | 13 ++ macros/get_location_columns.sql | 28 +++ macros/get_metafield_columns.sql | 19 ++ macros/get_order_note_attribute_columns.sql | 12 + macros/get_order_shipping_line_columns.sql | 22 ++ .../get_order_shipping_tax_line_columns.sql | 15 ++ macros/get_order_tag_columns.sql | 12 + macros/get_order_url_tag_columns.sql | 12 + macros/get_price_rule_columns.sql | 30 +++ macros/get_product_image_columns.sql | 21 ++ macros/get_product_tag_columns.sql | 12 + macros/get_shop_columns.sql | 65 ++++++ macros/get_tender_transaction_columns.sql | 20 ++ models/src_shopify.yml | 206 ++++++++++++++++++ models/stg_shopify__abandoned_checkout.sql | 125 +++++++++++ models/stg_shopify__collection.sql | 45 ++++ models/stg_shopify__collection_product.sql | 35 +++ models/stg_shopify__customer_tag.sql | 33 +++ models/stg_shopify__discount_code.sql | 35 +++ models/stg_shopify__fulfillment.sql | 47 ++++ models/stg_shopify__inventory_item.sql | 39 ++++ models/stg_shopify__inventory_level.sql | 37 ++++ models/stg_shopify__location.sql | 52 +++++ models/stg_shopify__metafield.sql | 39 ++++ models/stg_shopify__order_note_attribute.sql | 36 +++ models/stg_shopify__order_shipping_line.sql | 46 ++++ .../stg_shopify__order_shipping_tax_line.sql | 39 ++++ models/stg_shopify__order_tag.sql | 36 +++ models/stg_shopify__order_url_tag.sql | 36 +++ models/stg_shopify__price_rule.sql | 50 +++++ models/stg_shopify__product_image.sql | 45 ++++ models/stg_shopify__product_tag.sql | 36 +++ models/stg_shopify__shop.sql | 89 ++++++++ models/stg_shopify__tender_transaction.sql | 44 ++++ .../stg_shopify__abandoned_checkout_tmp.sql | 2 + .../stg_shopify__collection_product_tmp.sql | 2 + models/tmp/stg_shopify__collection_tmp.sql | 2 + models/tmp/stg_shopify__customer_tag_tmp.sql | 2 + models/tmp/stg_shopify__discount_code_tmp.sql | 2 + models/tmp/stg_shopify__fulfillment_tmp.sql | 2 + .../tmp/stg_shopify__inventory_item_tmp.sql | 2 + .../tmp/stg_shopify__inventory_level_tmp.sql | 2 + models/tmp/stg_shopify__location_tmp.sql | 2 + models/tmp/stg_shopify__metafield_tmp.sql | 2 + .../stg_shopify__order_note_attribute_tmp.sql | 2 + .../stg_shopify__order_shipping_line_tmp.sql | 2 + ...g_shopify__order_shipping_tax_line_tmp.sql | 2 + models/tmp/stg_shopify__order_tag_tmp.sql | 2 + models/tmp/stg_shopify__order_url_tag_tmp.sql | 2 + models/tmp/stg_shopify__price_rule_tmp.sql | 2 + models/tmp/stg_shopify__product_image_tmp.sql | 2 + models/tmp/stg_shopify__product_tag_tmp.sql | 2 + models/tmp/stg_shopify__shop_tmp.sql | 2 + .../stg_shopify__tender_transaction_tmp.sql | 2 + 62 files changed, 1694 insertions(+) create mode 100644 macros/get_abandoned_checkout_columns.sql create mode 100644 macros/get_collection_columns.sql create mode 100644 macros/get_collection_product_columns.sql create mode 100644 macros/get_customer_tag_columns.sql create mode 100644 macros/get_discount_code_columns.sql create mode 100644 macros/get_fulfillment_columns.sql create mode 100644 macros/get_inventory_item_columns.sql create mode 100644 macros/get_inventory_level_columns.sql create mode 100644 macros/get_location_columns.sql create mode 100644 macros/get_metafield_columns.sql create mode 100644 macros/get_order_note_attribute_columns.sql create mode 100644 macros/get_order_shipping_line_columns.sql create mode 100644 macros/get_order_shipping_tax_line_columns.sql create mode 100644 macros/get_order_tag_columns.sql create mode 100644 macros/get_order_url_tag_columns.sql create mode 100644 macros/get_price_rule_columns.sql create mode 100644 macros/get_product_image_columns.sql create mode 100644 macros/get_product_tag_columns.sql create mode 100644 macros/get_shop_columns.sql create mode 100644 macros/get_tender_transaction_columns.sql create mode 100644 models/stg_shopify__abandoned_checkout.sql create mode 100644 models/stg_shopify__collection.sql create mode 100644 models/stg_shopify__collection_product.sql create mode 100644 models/stg_shopify__customer_tag.sql create mode 100644 models/stg_shopify__discount_code.sql create mode 100644 models/stg_shopify__fulfillment.sql create mode 100644 models/stg_shopify__inventory_item.sql create mode 100644 models/stg_shopify__inventory_level.sql create mode 100644 models/stg_shopify__location.sql create mode 100644 models/stg_shopify__metafield.sql create mode 100644 models/stg_shopify__order_note_attribute.sql create mode 100644 models/stg_shopify__order_shipping_line.sql create mode 100644 models/stg_shopify__order_shipping_tax_line.sql create mode 100644 models/stg_shopify__order_tag.sql create mode 100644 models/stg_shopify__order_url_tag.sql create mode 100644 models/stg_shopify__price_rule.sql create mode 100644 models/stg_shopify__product_image.sql create mode 100644 models/stg_shopify__product_tag.sql create mode 100644 models/stg_shopify__shop.sql create mode 100644 models/stg_shopify__tender_transaction.sql create mode 100644 models/tmp/stg_shopify__abandoned_checkout_tmp.sql create mode 100644 models/tmp/stg_shopify__collection_product_tmp.sql create mode 100644 models/tmp/stg_shopify__collection_tmp.sql create mode 100644 models/tmp/stg_shopify__customer_tag_tmp.sql create mode 100644 models/tmp/stg_shopify__discount_code_tmp.sql create mode 100644 models/tmp/stg_shopify__fulfillment_tmp.sql create mode 100644 models/tmp/stg_shopify__inventory_item_tmp.sql create mode 100644 models/tmp/stg_shopify__inventory_level_tmp.sql create mode 100644 models/tmp/stg_shopify__location_tmp.sql create mode 100644 models/tmp/stg_shopify__metafield_tmp.sql create mode 100644 models/tmp/stg_shopify__order_note_attribute_tmp.sql create mode 100644 models/tmp/stg_shopify__order_shipping_line_tmp.sql create mode 100644 models/tmp/stg_shopify__order_shipping_tax_line_tmp.sql create mode 100644 models/tmp/stg_shopify__order_tag_tmp.sql create mode 100644 models/tmp/stg_shopify__order_url_tag_tmp.sql create mode 100644 models/tmp/stg_shopify__price_rule_tmp.sql create mode 100644 models/tmp/stg_shopify__product_image_tmp.sql create mode 100644 models/tmp/stg_shopify__product_tag_tmp.sql create mode 100644 models/tmp/stg_shopify__shop_tmp.sql create mode 100644 models/tmp/stg_shopify__tender_transaction_tmp.sql diff --git a/dbt_project.yml b/dbt_project.yml index 123f56d..cdcf44c 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -19,6 +19,27 @@ vars: transaction_source: "{{ source('shopify','transaction') }}" refund_source: "{{ source('shopify','refund') }}" order_adjustment_source: "{{ source('shopify','order_adjustment') }}" + abandoned_checkout: "{{ source('shopify','abandoned_checkout') }}" + collection_product: "{{ source('shopify','collection_product') }}" + collection: "{{ source('shopify','collection') }}" + customer_tag: "{{ source('shopify','customer_tag') }}" + discount_code: "{{ source('shopify','discount_code') }}" + fulfillment: "{{ source('shopify','fulfillment') }}" + inventory_item: "{{ source('shopify','inventory_item') }}" + inventory_level: "{{ source('shopify','inventory_level') }}" + location: "{{ source('shopify','location') }}" + metafield: "{{ source('shopify','metafield') }}" + order_note_attribute: "{{ source('shopify','order_note_attribute') }}" + order_shipping_line: "{{ source('shopify','order_shipping_line') }}" + order_shipping_tax_line: "{{ source('shopify','order_shipping_tax_line') }}" + order_tag: "{{ source('shopify','order_tag') }}" + order_url_tag: "{{ source('shopify','order_url_tag') }}" + price_rule: "{{ source('shopify','price_rule') }}" + product_image: "{{ source('shopify','product_image') }}" + product_tag: "{{ source('shopify','product_tag') }}" + shop: "{{ source('shopify','shop') }}" + tender_transaction: "{{ source('shopify','tender_transaction') }}" + customer_pass_through_columns: [] order_line_refund_pass_through_columns: [] order_line_pass_through_columns: [] diff --git a/macros/get_abandoned_checkout_columns.sql b/macros/get_abandoned_checkout_columns.sql new file mode 100644 index 0000000..eaf4309 --- /dev/null +++ b/macros/get_abandoned_checkout_columns.sql @@ -0,0 +1,101 @@ +{% macro get_abandoned_checkout_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "abandoned_checkout_url", "datatype": dbt.type_string()}, + {"name": "applied_discount_amount", "datatype": dbt.type_float()}, + {"name": "applied_discount_applicable", "datatype": "boolean"}, + {"name": "applied_discount_description", "datatype": dbt.type_string()}, + {"name": "applied_discount_non_applicable_reason", "datatype": dbt.type_string()}, + {"name": "applied_discount_title", "datatype": dbt.type_string()}, + {"name": "applied_discount_value", "datatype": dbt.type_float()}, + {"name": "applied_discount_value_type", "datatype": dbt.type_string()}, + {"name": "billing_address_address_1", "datatype": dbt.type_string()}, + {"name": "billing_address_address_2", "datatype": dbt.type_string()}, + {"name": "billing_address_city", "datatype": dbt.type_string()}, + {"name": "billing_address_company", "datatype": dbt.type_string()}, + {"name": "billing_address_country", "datatype": dbt.type_string()}, + {"name": "billing_address_country_code", "datatype": dbt.type_string()}, + {"name": "billing_address_first_name", "datatype": dbt.type_string()}, + {"name": "billing_address_id", "datatype": dbt.type_int()}, + {"name": "billing_address_is_default", "datatype": "boolean"}, + {"name": "billing_address_last_name", "datatype": dbt.type_string()}, + {"name": "billing_address_latitude", "datatype": dbt.type_string()}, + {"name": "billing_address_longitude", "datatype": dbt.type_string()}, + {"name": "billing_address_name", "datatype": dbt.type_string()}, + {"name": "billing_address_phone", "datatype": dbt.type_string()}, + {"name": "billing_address_province", "datatype": dbt.type_string()}, + {"name": "billing_address_province_code", "datatype": dbt.type_string()}, + {"name": "billing_address_zip", "datatype": dbt.type_string()}, + {"name": "buyer_accepts_marketing", "datatype": "boolean"}, + {"name": "cart_token", "datatype": dbt.type_string()}, + {"name": "closed_at", "datatype": dbt.type_timestamp()}, + {"name": "completed_at", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "credit_card_first_name", "datatype": dbt.type_string()}, + {"name": "credit_card_last_name", "datatype": dbt.type_string()}, + {"name": "credit_card_month", "datatype": dbt.type_int()}, + {"name": "credit_card_number", "datatype": dbt.type_int()}, + {"name": "credit_card_verification_value", "datatype": dbt.type_string()}, + {"name": "credit_card_year", "datatype": dbt.type_int()}, + {"name": "currency", "datatype": dbt.type_string()}, + {"name": "customer_id", "datatype": dbt.type_int()}, + {"name": "customer_locale", "datatype": dbt.type_string()}, + {"name": "device_id", "datatype": dbt.type_int()}, + {"name": "email", "datatype": dbt.type_string()}, + {"name": "gateway", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "landing_site_base_url", "datatype": dbt.type_string()}, + {"name": "location_id", "datatype": dbt.type_int()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "note", "datatype": dbt.type_string()}, + {"name": "note_attribute_email_client_id", "datatype": dbt.type_string()}, + {"name": "note_attribute_google_client_id", "datatype": dbt.type_float()}, + {"name": "note_attribute_littledata_updated_at", "datatype": dbt.type_int()}, + {"name": "note_attribute_segment_client_id", "datatype": dbt.type_string()}, + {"name": "note_attributes", "datatype": dbt.type_string()}, + {"name": "phone", "datatype": dbt.type_string()}, + {"name": "presentment_currency", "datatype": dbt.type_string()}, + {"name": "referring_site", "datatype": dbt.type_string()}, + {"name": "shipping_address_address_1", "datatype": dbt.type_string()}, + {"name": "shipping_address_address_2", "datatype": dbt.type_string()}, + {"name": "shipping_address_city", "datatype": dbt.type_string()}, + {"name": "shipping_address_company", "datatype": dbt.type_string()}, + {"name": "shipping_address_country", "datatype": dbt.type_string()}, + {"name": "shipping_address_country_code", "datatype": dbt.type_string()}, + {"name": "shipping_address_first_name", "datatype": dbt.type_string()}, + {"name": "shipping_address_id", "datatype": dbt.type_int()}, + {"name": "shipping_address_is_default", "datatype": "boolean"}, + {"name": "shipping_address_last_name", "datatype": dbt.type_string()}, + {"name": "shipping_address_latitude", "datatype": dbt.type_string()}, + {"name": "shipping_address_longitude", "datatype": dbt.type_string()}, + {"name": "shipping_address_name", "datatype": dbt.type_string()}, + {"name": "shipping_address_phone", "datatype": dbt.type_string()}, + {"name": "shipping_address_province", "datatype": dbt.type_string()}, + {"name": "shipping_address_province_code", "datatype": dbt.type_string()}, + {"name": "shipping_address_zip", "datatype": dbt.type_string()}, + {"name": "shipping_line", "datatype": dbt.type_string()}, + {"name": "shipping_rate_id", "datatype": dbt.type_string()}, + {"name": "shipping_rate_price", "datatype": dbt.type_float()}, + {"name": "shipping_rate_title", "datatype": dbt.type_string()}, + {"name": "source", "datatype": dbt.type_string()}, + {"name": "source_identifier", "datatype": dbt.type_string()}, + {"name": "source_name", "datatype": dbt.type_string()}, + {"name": "source_url", "datatype": dbt.type_string()}, + {"name": "subtotal_price", "datatype": dbt.type_float()}, + {"name": "taxes_included", "datatype": "boolean"}, + {"name": "token", "datatype": dbt.type_string()}, + {"name": "total_discounts", "datatype": dbt.type_float()}, + {"name": "total_duties", "datatype": dbt.type_string()}, + {"name": "total_line_items_price", "datatype": dbt.type_float()}, + {"name": "total_price", "datatype": dbt.type_float()}, + {"name": "total_tax", "datatype": dbt.type_float()}, + {"name": "total_weight", "datatype": dbt.type_int()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, + {"name": "user_id", "datatype": dbt.type_int()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_collection_columns.sql b/macros/get_collection_columns.sql new file mode 100644 index 0000000..3905a9f --- /dev/null +++ b/macros/get_collection_columns.sql @@ -0,0 +1,21 @@ +{% macro get_collection_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "body_html", "datatype": dbt.type_string()}, + {"name": "disjunctive", "datatype": "boolean"}, + {"name": "handle", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "published_at", "datatype": dbt.type_timestamp()}, + {"name": "published_scope", "datatype": dbt.type_string()}, + {"name": "rules", "datatype": dbt.type_string()}, + {"name": "sort_order", "datatype": dbt.type_string()}, + {"name": "template_suffix", "datatype": dbt.type_string()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_collection_product_columns.sql b/macros/get_collection_product_columns.sql new file mode 100644 index 0000000..ce79213 --- /dev/null +++ b/macros/get_collection_product_columns.sql @@ -0,0 +1,11 @@ +{% macro get_collection_product_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "collection_id", "datatype": dbt.type_int()}, + {"name": "product_id", "datatype": dbt.type_int()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_customer_tag_columns.sql b/macros/get_customer_tag_columns.sql new file mode 100644 index 0000000..368d6b9 --- /dev/null +++ b/macros/get_customer_tag_columns.sql @@ -0,0 +1,12 @@ +{% macro get_customer_tag_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "index", "datatype": dbt.type_int()}, + {"name": "customer_id", "datatype": dbt.type_int()}, + {"name": "value", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_discount_code_columns.sql b/macros/get_discount_code_columns.sql new file mode 100644 index 0000000..f96b27f --- /dev/null +++ b/macros/get_discount_code_columns.sql @@ -0,0 +1,15 @@ +{% macro get_discount_code_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "code", "datatype": dbt.type_string()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "price_rule_id", "datatype": dbt.type_int()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, + {"name": "usage_count", "datatype": dbt.type_float()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_fulfillment_columns.sql b/macros/get_fulfillment_columns.sql new file mode 100644 index 0000000..f9cb284 --- /dev/null +++ b/macros/get_fulfillment_columns.sql @@ -0,0 +1,23 @@ +{% macro get_fulfillment_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "location_id", "datatype": dbt.type_int()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "order_id", "datatype": dbt.type_int()}, + {"name": "receipt_authorization", "datatype": dbt.type_string()}, + {"name": "service", "datatype": dbt.type_string()}, + {"name": "shipment_status", "datatype": dbt.type_string()}, + {"name": "status", "datatype": dbt.type_string()}, + {"name": "tracking_company", "datatype": dbt.type_string()}, + {"name": "tracking_number", "datatype": dbt.type_string()}, + {"name": "tracking_numbers", "datatype": dbt.type_string()}, + {"name": "tracking_urls", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_inventory_item_columns.sql b/macros/get_inventory_item_columns.sql new file mode 100644 index 0000000..329bf73 --- /dev/null +++ b/macros/get_inventory_item_columns.sql @@ -0,0 +1,19 @@ +{% macro get_inventory_item_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "cost", "datatype": dbt.type_float()}, + {"name": "country_code_of_origin", "datatype": dbt.type_string()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "province_code_of_origin", "datatype": dbt.type_string()}, + {"name": "requires_shipping", "datatype": "boolean"}, + {"name": "sku", "datatype": dbt.type_string()}, + {"name": "tracked", "datatype": "boolean"}, + {"name": "updated_at", "datatype": dbt.type_timestamp()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_inventory_level_columns.sql b/macros/get_inventory_level_columns.sql new file mode 100644 index 0000000..8b8e6c5 --- /dev/null +++ b/macros/get_inventory_level_columns.sql @@ -0,0 +1,13 @@ +{% macro get_inventory_level_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "available", "datatype": dbt.type_int()}, + {"name": "inventory_item_id", "datatype": dbt.type_int()}, + {"name": "location_id", "datatype": dbt.type_int()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_location_columns.sql b/macros/get_location_columns.sql new file mode 100644 index 0000000..5de5991 --- /dev/null +++ b/macros/get_location_columns.sql @@ -0,0 +1,28 @@ +{% macro get_location_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "active", "datatype": "boolean"}, + {"name": "address_1", "datatype": dbt.type_string()}, + {"name": "address_2", "datatype": dbt.type_string()}, + {"name": "city", "datatype": dbt.type_string()}, + {"name": "country", "datatype": dbt.type_string()}, + {"name": "country_code", "datatype": dbt.type_string()}, + {"name": "country_name", "datatype": dbt.type_string()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "legacy", "datatype": "boolean"}, + {"name": "localized_country_name", "datatype": dbt.type_string()}, + {"name": "localized_province_name", "datatype": dbt.type_string()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "phone", "datatype": dbt.type_string()}, + {"name": "province", "datatype": dbt.type_string()}, + {"name": "province_code", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, + {"name": "zip", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_metafield_columns.sql b/macros/get_metafield_columns.sql new file mode 100644 index 0000000..ccb18e7 --- /dev/null +++ b/macros/get_metafield_columns.sql @@ -0,0 +1,19 @@ +{% macro get_metafield_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "description", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "key", "datatype": dbt.type_string()}, + {"name": "namespace", "datatype": dbt.type_string()}, + {"name": "owner_id", "datatype": dbt.type_int()}, + {"name": "owner_resource", "datatype": dbt.type_string()}, + {"name": "type", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, + {"name": "value", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_order_note_attribute_columns.sql b/macros/get_order_note_attribute_columns.sql new file mode 100644 index 0000000..6084f76 --- /dev/null +++ b/macros/get_order_note_attribute_columns.sql @@ -0,0 +1,12 @@ +{% macro get_order_note_attribute_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "order_id", "datatype": dbt.type_int()}, + {"name": "value", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_order_shipping_line_columns.sql b/macros/get_order_shipping_line_columns.sql new file mode 100644 index 0000000..11452a0 --- /dev/null +++ b/macros/get_order_shipping_line_columns.sql @@ -0,0 +1,22 @@ +{% macro get_order_shipping_line_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "carrier_identifier", "datatype": dbt.type_string()}, + {"name": "code", "datatype": dbt.type_string()}, + {"name": "delivery_category", "datatype": dbt.type_string()}, + {"name": "discounted_price", "datatype": dbt.type_float()}, + {"name": "discounted_price_set", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "order_id", "datatype": dbt.type_int()}, + {"name": "phone", "datatype": dbt.type_string()}, + {"name": "price", "datatype": dbt.type_float()}, + {"name": "price_set", "datatype": dbt.type_string()}, + {"name": "requested_fulfillment_service_id", "datatype": dbt.type_string()}, + {"name": "source", "datatype": dbt.type_string()}, + {"name": "title", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_order_shipping_tax_line_columns.sql b/macros/get_order_shipping_tax_line_columns.sql new file mode 100644 index 0000000..e852365 --- /dev/null +++ b/macros/get_order_shipping_tax_line_columns.sql @@ -0,0 +1,15 @@ +{% macro get_order_shipping_tax_line_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "index", "datatype": dbt.type_int()}, + {"name": "order_shipping_line_id", "datatype": dbt.type_int()}, + {"name": "price", "datatype": dbt.type_float()}, + {"name": "price_set", "datatype": dbt.type_string()}, + {"name": "rate", "datatype": dbt.type_float()}, + {"name": "title", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_order_tag_columns.sql b/macros/get_order_tag_columns.sql new file mode 100644 index 0000000..4fec7f1 --- /dev/null +++ b/macros/get_order_tag_columns.sql @@ -0,0 +1,12 @@ +{% macro get_order_tag_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "index", "datatype": dbt.type_int()}, + {"name": "order_id", "datatype": dbt.type_int()}, + {"name": "value", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_order_url_tag_columns.sql b/macros/get_order_url_tag_columns.sql new file mode 100644 index 0000000..2246e93 --- /dev/null +++ b/macros/get_order_url_tag_columns.sql @@ -0,0 +1,12 @@ +{% macro get_order_url_tag_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "key", "datatype": dbt.type_string()}, + {"name": "order_id", "datatype": dbt.type_int()}, + {"name": "value", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_price_rule_columns.sql b/macros/get_price_rule_columns.sql new file mode 100644 index 0000000..d88361c --- /dev/null +++ b/macros/get_price_rule_columns.sql @@ -0,0 +1,30 @@ +{% macro get_price_rule_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "allocation_limit", "datatype": dbt.type_int()}, + {"name": "allocation_method", "datatype": dbt.type_string()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "customer_selection", "datatype": dbt.type_string()}, + {"name": "ends_at", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "once_per_customer", "datatype": "boolean"}, + {"name": "prerequisite_quantity_range", "datatype": dbt.type_float()}, + {"name": "prerequisite_shipping_price_range", "datatype": dbt.type_float()}, + {"name": "prerequisite_subtotal_range", "datatype": dbt.type_float()}, + {"name": "prerequisite_to_entitlement_purchase_prerequisite_amount", "datatype": dbt.type_float()}, + {"name": "quantity_ratio_entitled_quantity", "datatype": dbt.type_int()}, + {"name": "quantity_ratio_prerequisite_quantity", "datatype": dbt.type_int()}, + {"name": "starts_at", "datatype": dbt.type_timestamp()}, + {"name": "target_selection", "datatype": dbt.type_string()}, + {"name": "target_type", "datatype": dbt.type_string()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, + {"name": "usage_limit", "datatype": dbt.type_int()}, + {"name": "value", "datatype": dbt.type_float()}, + {"name": "value_type", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_product_image_columns.sql b/macros/get_product_image_columns.sql new file mode 100644 index 0000000..35a1b9f --- /dev/null +++ b/macros/get_product_image_columns.sql @@ -0,0 +1,21 @@ +{% macro get_product_image_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "alt", "datatype": dbt.type_string()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "height", "datatype": dbt.type_int()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "is_default", "datatype": "boolean"}, + {"name": "position", "datatype": dbt.type_int()}, + {"name": "product_id", "datatype": dbt.type_int()}, + {"name": "src", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, + {"name": "variant_ids", "datatype": dbt.type_string()}, + {"name": "width", "datatype": dbt.type_int()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_product_tag_columns.sql b/macros/get_product_tag_columns.sql new file mode 100644 index 0000000..24f0887 --- /dev/null +++ b/macros/get_product_tag_columns.sql @@ -0,0 +1,12 @@ +{% macro get_product_tag_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "index", "datatype": dbt.type_int()}, + {"name": "product_id", "datatype": dbt.type_int()}, + {"name": "value", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_shop_columns.sql b/macros/get_shop_columns.sql new file mode 100644 index 0000000..710d54d --- /dev/null +++ b/macros/get_shop_columns.sql @@ -0,0 +1,65 @@ +{% macro get_shop_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "address_1", "datatype": dbt.type_string()}, + {"name": "address_2", "datatype": dbt.type_string()}, + {"name": "auto_configure_tax_inclusivity", "datatype": "boolean"}, + {"name": "checkout_api_supported", "datatype": "boolean"}, + {"name": "city", "datatype": dbt.type_string()}, + {"name": "cookie_consent_level", "datatype": dbt.type_string()}, + {"name": "country", "datatype": dbt.type_string()}, + {"name": "country_code", "datatype": dbt.type_string()}, + {"name": "country_name", "datatype": dbt.type_string()}, + {"name": "county_taxes", "datatype": "boolean"}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "currency", "datatype": dbt.type_string()}, + {"name": "customer_email", "datatype": dbt.type_string()}, + {"name": "domain", "datatype": dbt.type_string()}, + {"name": "eligible_for_card_reader_giveaway", "datatype": "boolean"}, + {"name": "eligible_for_payments", "datatype": "boolean"}, + {"name": "email", "datatype": dbt.type_string()}, + {"name": "enabled_presentment_currencies", "datatype": dbt.type_string()}, + {"name": "force_ssl", "datatype": "boolean"}, + {"name": "google_apps_domain", "datatype": dbt.type_string()}, + {"name": "google_apps_login_enabled", "datatype": "boolean"}, + {"name": "has_discounts", "datatype": "boolean"}, + {"name": "has_gift_cards", "datatype": "boolean"}, + {"name": "has_storefront", "datatype": "boolean"}, + {"name": "iana_timezone", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "latitude", "datatype": dbt.type_float()}, + {"name": "longitude", "datatype": dbt.type_float()}, + {"name": "money_format", "datatype": dbt.type_string()}, + {"name": "money_in_emails_format", "datatype": dbt.type_string()}, + {"name": "money_with_currency_format", "datatype": dbt.type_string()}, + {"name": "money_with_currency_in_emails_format", "datatype": dbt.type_string()}, + {"name": "multi_location_enabled", "datatype": "boolean"}, + {"name": "myshopify_domain", "datatype": dbt.type_string()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "password_enabled", "datatype": "boolean"}, + {"name": "phone", "datatype": dbt.type_string()}, + {"name": "plan_display_name", "datatype": dbt.type_string()}, + {"name": "plan_name", "datatype": dbt.type_string()}, + {"name": "pre_launch_enabled", "datatype": "boolean"}, + {"name": "primary_locale", "datatype": dbt.type_string()}, + {"name": "primary_location_id", "datatype": dbt.type_int()}, + {"name": "province", "datatype": dbt.type_string()}, + {"name": "province_code", "datatype": dbt.type_string()}, + {"name": "requires_extra_payments_agreement", "datatype": "boolean"}, + {"name": "setup_required", "datatype": "boolean"}, + {"name": "shop_owner", "datatype": dbt.type_string()}, + {"name": "source", "datatype": dbt.type_string()}, + {"name": "tax_shipping", "datatype": "boolean"}, + {"name": "taxes_included", "datatype": "boolean"}, + {"name": "timezone", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, + {"name": "visitor_tracking_consent_preference", "datatype": dbt.type_string()}, + {"name": "weight_unit", "datatype": dbt.type_string()}, + {"name": "zip", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_tender_transaction_columns.sql b/macros/get_tender_transaction_columns.sql new file mode 100644 index 0000000..3678e2f --- /dev/null +++ b/macros/get_tender_transaction_columns.sql @@ -0,0 +1,20 @@ +{% macro get_tender_transaction_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "amount", "datatype": dbt.type_float()}, + {"name": "currency", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "order_id", "datatype": dbt.type_int()}, + {"name": "payment_details_credit_card_company", "datatype": dbt.type_string()}, + {"name": "payment_details_credit_card_number", "datatype": dbt.type_string()}, + {"name": "payment_method", "datatype": dbt.type_string()}, + {"name": "processed_at", "datatype": dbt.type_timestamp()}, + {"name": "remote_reference", "datatype": dbt.type_string()}, + {"name": "test", "datatype": "boolean"}, + {"name": "user_id", "datatype": dbt.type_int()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 34dd321..c3faf88 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -435,3 +435,209 @@ sources: description: Tax amount set towards the order adjustment. - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" + + - name: abandoned_checkout + description: + columns: + + - name: collection_product + description: + columns: + + - name: collection + description: + columns: + + - name: customer_tag + description: + columns: + + - name: discount_code + description: > + Table storing discount codes that enable specific discounts to be redeemed. Merchants can distribute discount codes to their customers using a variety of means, such as an email or URL, + and customers can apply these codes at checkout. Each discount code belongs to a price rule, which holds the logic for the discount. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: code + description: The case-insensitive discount code that customers use at checkout. Shopify recommends this map onto the associated `price_rule.title`. + - name: created_at + description: The date and time (ISO 8601 format) when the discount code was created. + - name: id + description: The ID for the discount code. + - name: price_rule_id + description: The ID for the price rule that this discount code belongs to. + - name: updated_at + description: The date and time (ISO 8601 format) when the discount code was updated. + - name: usage_count + description: The number of times that the discount code has been redeemed. + + - name: fulfillment + description: + columns: + + - name: inventory_item + description: > + An inventory item represents a physical good. It holds essential information about the physical good, including its SKU and whether its inventory is tracked. + There is a 1:1 relationship between a product variant and an inventory item. + columns: + - name: _fivetran_deleted + description: Boolean representing if the inventory item was soft-deleted in Shopify. + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: cost + description: The unit cost of the inventory item. The shop's default currency is used. + - name: country_code_of_origin + description: The country code (ISO 3166-1 alpha-2) of where the item came from. + - name: created_at + description: The date and time (ISO 8601 format) when the inventory item was created. + - name: id + description: The ID of the inventory item. + - name: province_code_of_origin + description: The province code (ISO 3166-2 alpha-2) of where the item came from. The province code is only used if the shipping provider for the inventory item is Canada Post. + - name: requires_shipping + description: Boolean representing whether a customer needs to provide a shipping address when placing an order containing the inventory item. + - name: sku + description: The unique SKU (stock keeping unit) of the inventory item. + - name: tracked + description: Boolean representing whether inventory levels are tracked for the item. If true, then the inventory quantity changes are tracked by Shopify. + - name: updated_at + description: The date and time (ISO 8601 format) when the inventory item was last modified. + + - name: inventory_level + description: + columns: + + - name: location + description: + columns: + + - name: metafield + description: > + Metafields are a flexible way to attach additional information to a Shopify resource (e.g. Product, Collection, etc.). Some examples of data stored using metafields include specifications, size charts, + downloadable documents, release dates, images, or part numbers. Metafields are identified by an owner resource, a namespace, and a key and they store a value along with type information for that context. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: created_at + description: The date and time (ISO 8601 format) when the metafield was created. + - name: description + description: A description of the information that the metafield contains. + - name: id + description: The unique ID of the metafield. + - name: key + description: The key of the metafield. Keys can be up to 64 characters long and can contain alphanumeric characters, hyphens, underscores, and periods. + - name: namespace + description: A container for a group of metafields. Grouping metafields within a namespace prevents your metafields from conflicting with other metafields with the same key name. Must have between 3-255 characters. + - name: owner_id + description: The unique ID of the resource that the metafield is attached to. + - name: owner_resource + description: The type of resource (table) that the metafield is attached to. + - name: type + description: The type of data that the metafield stores in the `value` field. Refer to the [list](https://shopify.dev/apps/metafields/types) of supported types. Use this instead of `value_type`. + - name: updated_at + description: The date and time (ISO 8601 format) when the metafield was last updated. + - name: value + description: The data to store in the metafield. The value is always stored as a string, regardless of the metafield's type. + - name: value_type + description: DEPRECATED as of [June 2022](https://fivetran.com/docs/applications/shopify/changelog#june2022). Use `type` instead. + + - name: order_note_attribute + description: + columns: + + - name: order_shipping_line + description: + columns: + + - name: order_shipping_tax_line + description: + columns: + + - name: order_tag + description: + columns: + + - name: order_url_tag + description: + columns: + + - name: price_rule + description: > + Table storing price rules. You can use price rules to create discounts dependent on conditions. Merchants can distribute the discount codes to their customers. + Using price rules, you can create discounts that specify a discount as a percentage, a fixed amount, or free shipping. You use entitlements and prerequisites to dynamically build these discounts. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: allocation_limit + description: > + The number of times the discount can be allocated on the cart - if eligible. For example a Buy 1 hat Get 1 hat for free discount can be applied 3 times on a cart having more than 6 hats, + where maximum of 3 hats get discounted - if the allocation_limit is 3. Empty (null) allocation_limit means unlimited number of allocations. + - name: allocation_method + description: > + The allocation method of the price rule. Valid values include `each` (the discount is applied to each of the entitled items. For example, for a price rule that takes $15 off, each entitled line item in a checkout will be discounted by $15) + and `across` (the calculated discount amount will be applied across the entitled items. For example, for a price rule that takes $15 off, the discount will be applied across all the entitled items). + - name: created_at + description: The date and time (ISO 8601 format) when the price rule was created. + - name: customer_selection + description: > + The customer selection for the price rule. Valid values include `all` (the price rule is valid for all customers) and `prerequisite` + (the customer must either belong to one of the customer segments specified by customer_segment_prerequisite_ids, or be one of the customers specified by prerequisite_customer_ids). + - name: ends_at + description: The date and time (ISO 8601 format) when the price rule ends. Must be after starts_at. + - name: id + description: The ID for the price rule. + - name: once_per_customer + description: Boolean representing whether the generated discount code will be valid only for a single use per customer. This is tracked using customer ID. + - name: prerequisite_quantity_range + description: If `customer_selection` is `prerequisite`, the minimum number of items for the price rule to be applicable. The quantity of an entitled cart item must be greater than or equal to this value. + - name: prerequisite_shipping_price_range + description: If `customer_selection` is `prerequisite`, the maximum shipping price for the price rule to be applicable. The shipping price must be less than or equal to this value + - name: prerequisite_subtotal_range + description: If `customer_selection` is `prerequisite`, the minimum subtotal for the price rule to be applicable. The subtotal of the entitled cart items must be greater than or equal to this value for the discount to apply. + - name: prerequisite_to_entitlement_purchase_prerequisite_amount + description: If `customer_selection` is `prerequisite`, the prerequisite purchase for a Buy X Get Y discount. The minimum purchase amount required to be entitled to the discount. + - name: quantity_ratio_entitled_quantity + description: If `customer_selection` is `prerequisite`, in a Buy/Get ratio for a Buy X Get Y discount, this is the offered 'get' quantity. + - name: quantity_ratio_prerequisite_quantity + description: If `customer_selection` is `prerequisite`, in a Buy/Get ratio for a Buy X Get Y discount, this defines the necessary 'buy' quantity. + - name: starts_at + description: The date and time (ISO 8601 format) when the price rule starts. + - name: target_selection + description: > + The target selection method of the price rule. Valid values include `all` (the price rule applies the discount to all line items in the checkout) and + `entitled` (the price rule applies the discount to selected entitlements only). + - name: target_type + description: The target type that the price rule applies to. Valid values include `line_item` (the price rule applies to the cart's line items) and `shipping_line` (the price rule applies to the cart's shipping lines). + - name: title + description: > + The title of the price rule. This is used by the Shopify admin search to retrieve discounts. It is also displayed on the Discounts page of the Shopify admin for bulk discounts. + Shopify recommends that this map onto the associated `discount_code.code`. + - name: updated_at + description: The date and time (ISO 8601 format) when the price rule was updated. + - name: usage_limit + description: The maximum number of times the price rule can be used, per discount code. + - name: value + description: The value of the price rule. If if the value of `target_type` is `shipping_line`, then only -100 is accepted. The value must be negative. + - name: value_type + description: > + The value type of the price rule. Valid values include `fixed_amount` (applies a discount of value as a unit of the store's currency. For example, if value is -30 and the store's currency is USD, then $30 USD is deducted when the discount is applied) + and `percentage` (applies a percentage discount of value. For example, if value is -30, then 30% will be deducted when the discount is applied). + + If `target_type` is `shipping_line`, then only `percentage` is accepted. + + - name: product_image + description: + columns: + + - name: product_tag + description: + columns: + + - name: shop + description: + columns: + + - name: tender_transaction + description: + columns: diff --git a/models/stg_shopify__abandoned_checkout.sql b/models/stg_shopify__abandoned_checkout.sql new file mode 100644 index 0000000..8160611 --- /dev/null +++ b/models/stg_shopify__abandoned_checkout.sql @@ -0,0 +1,125 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__abandoned_checkout_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__abandoned_checkout_tmp')), + staging_columns=get_abandoned_checkout_columns() + ) + }} + from base +), + +final as ( + + select +22:58:01 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.ad_reporting +- models.netsuite + +22:58:04 _fivetran_deleted, + _fivetran_synced, + abandoned_checkout_url, + applied_discount_amount, + applied_discount_applicable, + applied_discount_description, + applied_discount_non_applicable_reason, + applied_discount_title, + applied_discount_value, + applied_discount_value_type, + billing_address_address_1, + billing_address_address_2, + billing_address_city, + billing_address_company, + billing_address_country, + billing_address_country_code, + billing_address_first_name, + billing_address_id, + billing_address_is_default, + billing_address_last_name, + billing_address_latitude, + billing_address_longitude, + billing_address_name, + billing_address_phone, + billing_address_province, + billing_address_province_code, + billing_address_zip, + buyer_accepts_marketing, + cart_token, + closed_at, + completed_at, + created_at, + credit_card_first_name, + credit_card_last_name, + credit_card_month, + credit_card_number, + credit_card_verification_value, + credit_card_year, + currency, + customer_id, + customer_locale, + device_id, + email, + gateway, + id, + landing_site_base_url, + location_id, + name, + note, + note_attribute_email_client_id, + note_attribute_google_client_id, + note_attribute_littledata_updated_at, + note_attribute_segment_client_id, + note_attributes, + phone, + presentment_currency, + referring_site, + shipping_address_address_1, + shipping_address_address_2, + shipping_address_city, + shipping_address_company, + shipping_address_country, + shipping_address_country_code, + shipping_address_first_name, + shipping_address_id, + shipping_address_is_default, + shipping_address_last_name, + shipping_address_latitude, + shipping_address_longitude, + shipping_address_name, + shipping_address_phone, + shipping_address_province, + shipping_address_province_code, + shipping_address_zip, + shipping_line, + shipping_rate_id, + shipping_rate_price, + shipping_rate_title, + source, + source_identifier, + source_name, + source_url, + subtotal_price, + taxes_included, + token, + total_discounts, + total_duties, + total_line_items_price, + total_price, + total_tax, + total_weight, + updated_at, + user_id + from fields +) + +select * +from final diff --git a/models/stg_shopify__collection.sql b/models/stg_shopify__collection.sql new file mode 100644 index 0000000..8ffe5e1 --- /dev/null +++ b/models/stg_shopify__collection.sql @@ -0,0 +1,45 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__collection_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__collection_tmp')), + staging_columns=get_collection_columns() + ) + }} + from base +), + +final as ( + + select +22:58:06 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:58:09 _fivetran_deleted, + _fivetran_synced, + body_html, + disjunctive, + handle, + id, + published_at, + published_scope, + rules, + sort_order, + template_suffix, + title, + updated_at + from fields +) + +select * +from final diff --git a/models/stg_shopify__collection_product.sql b/models/stg_shopify__collection_product.sql new file mode 100644 index 0000000..ac6f058 --- /dev/null +++ b/models/stg_shopify__collection_product.sql @@ -0,0 +1,35 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__collection_product_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__collection_product_tmp')), + staging_columns=get_collection_product_columns() + ) + }} + from base +), + +final as ( + + select +22:58:11 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:58:14 _fivetran_synced, + collection_id, + product_id + from fields +) + +select * +from final diff --git a/models/stg_shopify__customer_tag.sql b/models/stg_shopify__customer_tag.sql new file mode 100644 index 0000000..ad19a76 --- /dev/null +++ b/models/stg_shopify__customer_tag.sql @@ -0,0 +1,33 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__custiner_tag_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__custiner_tag_tmp')), + staging_columns=get_custiner_tag_columns() + ) + }} + from base +), + +final as ( + + select +22:58:32 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:58:35 + from fields +) + +select *lk43 +from final diff --git a/models/stg_shopify__discount_code.sql b/models/stg_shopify__discount_code.sql new file mode 100644 index 0000000..01db6c9 --- /dev/null +++ b/models/stg_shopify__discount_code.sql @@ -0,0 +1,35 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__discount_code_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__discount_code_tmp')), + staging_columns=get_discount_code_columns() + ) + }} + from base +), + +final as ( + + select + _fivetran_synced, + code, + created_at, + id as discount_code_id, + price_rule_id, + updated_at, + usage_count + + from fields +) + +select * +from final diff --git a/models/stg_shopify__fulfillment.sql b/models/stg_shopify__fulfillment.sql new file mode 100644 index 0000000..3eced52 --- /dev/null +++ b/models/stg_shopify__fulfillment.sql @@ -0,0 +1,47 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__fulfillment_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__fulfillment_tmp')), + staging_columns=get_fulfillment_columns() + ) + }} + from base +), + +final as ( + + select +22:57:09 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:57:12 _fivetran_synced, + created_at, + id, + location_id, + name, + order_id, + receipt_authorization, + service, + shipment_status, + status, + tracking_company, + tracking_number, + tracking_numbers, + tracking_urls, + updated_at + from fields +) + +select * +from final diff --git a/models/stg_shopify__inventory_item.sql b/models/stg_shopify__inventory_item.sql new file mode 100644 index 0000000..fc5b42e --- /dev/null +++ b/models/stg_shopify__inventory_item.sql @@ -0,0 +1,39 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__inventory_item_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__inventory_item_tmp')), + staging_columns=get_inventory_item_columns() + ) + }} + from base +), + +final as ( + + select + _fivetran_deleted as is_deleted, -- won't filter out for now + _fivetran_synced, + cost, + country_code_of_origin, + created_at, + id as inventory_item_id, + province_code_of_origin, + requires_shipping as as does_require_shipping, + sku, + tracked as is_inventory_quantity_tracked, + updated_at + + from fields +) + +select * +from final diff --git a/models/stg_shopify__inventory_level.sql b/models/stg_shopify__inventory_level.sql new file mode 100644 index 0000000..c281ee2 --- /dev/null +++ b/models/stg_shopify__inventory_level.sql @@ -0,0 +1,37 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__inventory_level_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__inventory_level_tmp')), + staging_columns=get_inventory_level_columns() + ) + }} + from base +), + +final as ( + + select +22:58:21 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:58:24 _fivetran_synced, + available, + inventory_item_id, + location_id, + updated_at + from fields +) + +select * +from final diff --git a/models/stg_shopify__location.sql b/models/stg_shopify__location.sql new file mode 100644 index 0000000..8497583 --- /dev/null +++ b/models/stg_shopify__location.sql @@ -0,0 +1,52 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__location_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__location_tmp')), + staging_columns=get_location_columns() + ) + }} + from base +), + +final as ( + + select +22:58:27 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:58:30 _fivetran_deleted, + _fivetran_synced, + active, + address_1, + address_2, + city, + country, + country_code, + country_name, + created_at, + id, + legacy, + localized_country_name, + localized_province_name, + name, + phone, + province, + province_code, + updated_at, + zip + from fields +) + +select * +from final diff --git a/models/stg_shopify__metafield.sql b/models/stg_shopify__metafield.sql new file mode 100644 index 0000000..8405ce0 --- /dev/null +++ b/models/stg_shopify__metafield.sql @@ -0,0 +1,39 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__metafield_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__metafield_tmp')), + staging_columns=get_metafield_columns() + ) + }} + from base +), + +final as ( + + select + fivetran_synced, + created_at, + description, + id as metafield_id, + key, + namespace, + owner_id as owner_resource_id, + owner_resource, + lower(coalesce(type, value_type)) as value_type, + updated_at, + value + + from fields +) + +select * +from final diff --git a/models/stg_shopify__order_note_attribute.sql b/models/stg_shopify__order_note_attribute.sql new file mode 100644 index 0000000..ed7c407 --- /dev/null +++ b/models/stg_shopify__order_note_attribute.sql @@ -0,0 +1,36 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__order_note_attribute_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_note_attribute_tmp')), + staging_columns=get_order_note_attribute_columns() + ) + }} + from base +), + +final as ( + + select +22:57:29 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.ad_reporting +- models.netsuite + +22:57:32 _fivetran_synced, + name, + order_id, + value + from fields +) + +select * +from final diff --git a/models/stg_shopify__order_shipping_line.sql b/models/stg_shopify__order_shipping_line.sql new file mode 100644 index 0000000..40ae4fe --- /dev/null +++ b/models/stg_shopify__order_shipping_line.sql @@ -0,0 +1,46 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__order_shipping_line_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_shipping_line_tmp')), + staging_columns=get_order_shipping_line_columns() + ) + }} + from base +), + +final as ( + + select +22:57:34 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:57:37 _fivetran_synced, + carrier_identifier, + code, + delivery_category, + discounted_price, + discounted_price_set, + id, + order_id, + phone, + price, + price_set, + requested_fulfillment_service_id, + source, + title + from fields +) + +select * +from final diff --git a/models/stg_shopify__order_shipping_tax_line.sql b/models/stg_shopify__order_shipping_tax_line.sql new file mode 100644 index 0000000..c44e891 --- /dev/null +++ b/models/stg_shopify__order_shipping_tax_line.sql @@ -0,0 +1,39 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__order_shipping_tax_line_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_shipping_tax_line_tmp')), + staging_columns=get_order_shipping_tax_line_columns() + ) + }} + from base +), + +final as ( + + select +22:57:40 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:57:43 _fivetran_synced, + index, + order_shipping_line_id, + price, + price_set, + rate, + title + from fields +) + +select * +from final diff --git a/models/stg_shopify__order_tag.sql b/models/stg_shopify__order_tag.sql new file mode 100644 index 0000000..fe857f3 --- /dev/null +++ b/models/stg_shopify__order_tag.sql @@ -0,0 +1,36 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__order_tag_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_tag_tmp')), + staging_columns=get_order_tag_columns() + ) + }} + from base +), + +final as ( + + select +22:58:37 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.ad_reporting +- models.netsuite + +22:58:40 _fivetran_synced, + index, + order_id, + value + from fields +) + +select * +from final diff --git a/models/stg_shopify__order_url_tag.sql b/models/stg_shopify__order_url_tag.sql new file mode 100644 index 0000000..b36d6c8 --- /dev/null +++ b/models/stg_shopify__order_url_tag.sql @@ -0,0 +1,36 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__order_url_tag_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_url_tag_tmp')), + staging_columns=get_order_url_tag_columns() + ) + }} + from base +), + +final as ( + + select +22:58:42 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:58:45 _fivetran_synced, + key, + order_id, + value + from fields +) + +select * +from final diff --git a/models/stg_shopify__price_rule.sql b/models/stg_shopify__price_rule.sql new file mode 100644 index 0000000..38a5d5c --- /dev/null +++ b/models/stg_shopify__price_rule.sql @@ -0,0 +1,50 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__price_rule_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__price_rule_tmp')), + staging_columns=get_price_rule_columns() + ) + }} + from base +), + +final as ( + + select + _fivetran_synced, + allocation_limit, + allocation_method, + created_at, + customer_selection, + ends_at, + id as price_rule_id, + once_per_customer as is_once_per_customer, + prerequisite_quantity_range as prereq_min_quantity, + prerequisite_shipping_price_range as prereq_max_shipping_price, + prerequisite_subtotal_range as prereq_min_subtotal, + prerequisite_to_entitlement_purchase_prerequisite_amount as prereq_min_purchase_quantity_for_entitlement, + quantity_ratio_entitled_quantity as prereq_buy_x_get_this, + quantity_ratio_prerequisite_quantity as prereq_buy_this_get_y, + starts_at, + target_selection, + target_type, + title, + updated_at, + usage_limit, + value, + value_type + + from fields +) + +select * +from final diff --git a/models/stg_shopify__product_image.sql b/models/stg_shopify__product_image.sql new file mode 100644 index 0000000..a6d3d63 --- /dev/null +++ b/models/stg_shopify__product_image.sql @@ -0,0 +1,45 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__product_image_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__product_image_tmp')), + staging_columns=get_product_image_columns() + ) + }} + from base +), + +final as ( + + select +22:57:56 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:57:59 _fivetran_deleted, + _fivetran_synced, + alt, + created_at, + height, + id, + is_default, + position, + product_id, + src, + updated_at, + variant_ids, + width + from fields +) + +select * +from final diff --git a/models/stg_shopify__product_tag.sql b/models/stg_shopify__product_tag.sql new file mode 100644 index 0000000..f5154d2 --- /dev/null +++ b/models/stg_shopify__product_tag.sql @@ -0,0 +1,36 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__product_tag_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__product_tag_tmp')), + staging_columns=get_product_tag_columns() + ) + }} + from base +), + +final as ( + + select +22:58:47 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.ad_reporting +- models.netsuite + +22:58:50 _fivetran_synced, + index, + product_id, + value + from fields +) + +select * +from final diff --git a/models/stg_shopify__shop.sql b/models/stg_shopify__shop.sql new file mode 100644 index 0000000..2291be9 --- /dev/null +++ b/models/stg_shopify__shop.sql @@ -0,0 +1,89 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__shop_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__shop_tmp')), + staging_columns=get_shop_columns() + ) + }} + from base +), + +final as ( + + select +22:57:14 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.ad_reporting +- models.netsuite + +22:57:17 _fivetran_deleted, + _fivetran_synced, + address_1, + address_2, + auto_configure_tax_inclusivity, + checkout_api_supported, + city, + cookie_consent_level, + country, + country_code, + country_name, + county_taxes, + created_at, + currency, + customer_email, + domain, + eligible_for_card_reader_giveaway, + eligible_for_payments, + email, + enabled_presentment_currencies, + force_ssl, + google_apps_domain, + google_apps_login_enabled, + has_discounts, + has_gift_cards, + has_storefront, + iana_timezone, + id, + latitude, + longitude, + money_format, + money_in_emails_format, + money_with_currency_format, + money_with_currency_in_emails_format, + multi_location_enabled, + myshopify_domain, + name, + password_enabled, + phone, + plan_display_name, + plan_name, + pre_launch_enabled, + primary_locale, + primary_location_id, + province, + province_code, + requires_extra_payments_agreement, + setup_required, + shop_owner, + source, + tax_shipping, + taxes_included, + timezone, + updated_at, + visitor_tracking_consent_preference, + weight_unit, + zip + from fields +) + +select * +from final diff --git a/models/stg_shopify__tender_transaction.sql b/models/stg_shopify__tender_transaction.sql new file mode 100644 index 0000000..089cb52 --- /dev/null +++ b/models/stg_shopify__tender_transaction.sql @@ -0,0 +1,44 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__tender_transaction_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__tender_transaction_tmp')), + staging_columns=get_tender_transaction_columns() + ) + }} + from base +), + +final as ( + + select +22:57:19 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +22:57:22 _fivetran_synced, + amount, + currency, + id, + order_id, + payment_details_credit_card_company, + payment_details_credit_card_number, + payment_method, + processed_at, + remote_reference, + test, + user_id + from fields +) + +select * +from final diff --git a/models/tmp/stg_shopify__abandoned_checkout_tmp.sql b/models/tmp/stg_shopify__abandoned_checkout_tmp.sql new file mode 100644 index 0000000..e16cffc --- /dev/null +++ b/models/tmp/stg_shopify__abandoned_checkout_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('abandoned_checkout') }} diff --git a/models/tmp/stg_shopify__collection_product_tmp.sql b/models/tmp/stg_shopify__collection_product_tmp.sql new file mode 100644 index 0000000..7c9485c --- /dev/null +++ b/models/tmp/stg_shopify__collection_product_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('collection_product') }} diff --git a/models/tmp/stg_shopify__collection_tmp.sql b/models/tmp/stg_shopify__collection_tmp.sql new file mode 100644 index 0000000..51ff8ac --- /dev/null +++ b/models/tmp/stg_shopify__collection_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('collection') }} diff --git a/models/tmp/stg_shopify__customer_tag_tmp.sql b/models/tmp/stg_shopify__customer_tag_tmp.sql new file mode 100644 index 0000000..f14ca7b --- /dev/null +++ b/models/tmp/stg_shopify__customer_tag_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('customer_tag') }} diff --git a/models/tmp/stg_shopify__discount_code_tmp.sql b/models/tmp/stg_shopify__discount_code_tmp.sql new file mode 100644 index 0000000..78cffc4 --- /dev/null +++ b/models/tmp/stg_shopify__discount_code_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('discount_code') }} diff --git a/models/tmp/stg_shopify__fulfillment_tmp.sql b/models/tmp/stg_shopify__fulfillment_tmp.sql new file mode 100644 index 0000000..6432463 --- /dev/null +++ b/models/tmp/stg_shopify__fulfillment_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('fulfillment') }} diff --git a/models/tmp/stg_shopify__inventory_item_tmp.sql b/models/tmp/stg_shopify__inventory_item_tmp.sql new file mode 100644 index 0000000..ab0e4eb --- /dev/null +++ b/models/tmp/stg_shopify__inventory_item_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('inventory_item') }} diff --git a/models/tmp/stg_shopify__inventory_level_tmp.sql b/models/tmp/stg_shopify__inventory_level_tmp.sql new file mode 100644 index 0000000..5438e2f --- /dev/null +++ b/models/tmp/stg_shopify__inventory_level_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('inventory_level') }} diff --git a/models/tmp/stg_shopify__location_tmp.sql b/models/tmp/stg_shopify__location_tmp.sql new file mode 100644 index 0000000..7e7da2d --- /dev/null +++ b/models/tmp/stg_shopify__location_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('location') }} diff --git a/models/tmp/stg_shopify__metafield_tmp.sql b/models/tmp/stg_shopify__metafield_tmp.sql new file mode 100644 index 0000000..af5da85 --- /dev/null +++ b/models/tmp/stg_shopify__metafield_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('metafield') }} diff --git a/models/tmp/stg_shopify__order_note_attribute_tmp.sql b/models/tmp/stg_shopify__order_note_attribute_tmp.sql new file mode 100644 index 0000000..0634e8f --- /dev/null +++ b/models/tmp/stg_shopify__order_note_attribute_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('order_note_attribute') }} diff --git a/models/tmp/stg_shopify__order_shipping_line_tmp.sql b/models/tmp/stg_shopify__order_shipping_line_tmp.sql new file mode 100644 index 0000000..ec27a5f --- /dev/null +++ b/models/tmp/stg_shopify__order_shipping_line_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('order_shipping_line') }} diff --git a/models/tmp/stg_shopify__order_shipping_tax_line_tmp.sql b/models/tmp/stg_shopify__order_shipping_tax_line_tmp.sql new file mode 100644 index 0000000..1b0746e --- /dev/null +++ b/models/tmp/stg_shopify__order_shipping_tax_line_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('order_shipping_tax_line') }} diff --git a/models/tmp/stg_shopify__order_tag_tmp.sql b/models/tmp/stg_shopify__order_tag_tmp.sql new file mode 100644 index 0000000..e5a918d --- /dev/null +++ b/models/tmp/stg_shopify__order_tag_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('order_tag') }} diff --git a/models/tmp/stg_shopify__order_url_tag_tmp.sql b/models/tmp/stg_shopify__order_url_tag_tmp.sql new file mode 100644 index 0000000..56fa477 --- /dev/null +++ b/models/tmp/stg_shopify__order_url_tag_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('order_url_tag') }} diff --git a/models/tmp/stg_shopify__price_rule_tmp.sql b/models/tmp/stg_shopify__price_rule_tmp.sql new file mode 100644 index 0000000..d3349bd --- /dev/null +++ b/models/tmp/stg_shopify__price_rule_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('price_rule') }} diff --git a/models/tmp/stg_shopify__product_image_tmp.sql b/models/tmp/stg_shopify__product_image_tmp.sql new file mode 100644 index 0000000..22f969c --- /dev/null +++ b/models/tmp/stg_shopify__product_image_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('product_image') }} diff --git a/models/tmp/stg_shopify__product_tag_tmp.sql b/models/tmp/stg_shopify__product_tag_tmp.sql new file mode 100644 index 0000000..d08bbbb --- /dev/null +++ b/models/tmp/stg_shopify__product_tag_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('product_tag') }} diff --git a/models/tmp/stg_shopify__shop_tmp.sql b/models/tmp/stg_shopify__shop_tmp.sql new file mode 100644 index 0000000..c04677c --- /dev/null +++ b/models/tmp/stg_shopify__shop_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('shop') }} diff --git a/models/tmp/stg_shopify__tender_transaction_tmp.sql b/models/tmp/stg_shopify__tender_transaction_tmp.sql new file mode 100644 index 0000000..f4938a3 --- /dev/null +++ b/models/tmp/stg_shopify__tender_transaction_tmp.sql @@ -0,0 +1,2 @@ +select * +from {{ var('tender_transaction') }} From 4d2d8a530713cb9b2df644a8a3d7da095d887e4d Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 5 Dec 2022 17:09:04 -0800 Subject: [PATCH 024/137] more tables --- macros/get_abandoned_checkout_columns.sql | 30 -- macros/get_collection_columns.sql | 2 - macros/get_fulfillment_columns.sql | 1 - models/docs.md | 6 + models/src_shopify.yml | 306 ++++++++++++++++++++- models/stg_shopify__abandoned_checkout.sql | 46 +--- models/stg_shopify__collection.sql | 17 +- models/stg_shopify__collection_product.sql | 8 +- models/stg_shopify__fulfillment.sql | 11 +- models/stg_shopify__inventory_level.sql | 10 +- models/stg_shopify__location.sql | 17 +- 11 files changed, 330 insertions(+), 124 deletions(-) diff --git a/macros/get_abandoned_checkout_columns.sql b/macros/get_abandoned_checkout_columns.sql index eaf4309..2903e1c 100644 --- a/macros/get_abandoned_checkout_columns.sql +++ b/macros/get_abandoned_checkout_columns.sql @@ -4,13 +4,6 @@ {"name": "_fivetran_deleted", "datatype": "boolean"}, {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, {"name": "abandoned_checkout_url", "datatype": dbt.type_string()}, - {"name": "applied_discount_amount", "datatype": dbt.type_float()}, - {"name": "applied_discount_applicable", "datatype": "boolean"}, - {"name": "applied_discount_description", "datatype": dbt.type_string()}, - {"name": "applied_discount_non_applicable_reason", "datatype": dbt.type_string()}, - {"name": "applied_discount_title", "datatype": dbt.type_string()}, - {"name": "applied_discount_value", "datatype": dbt.type_float()}, - {"name": "applied_discount_value_type", "datatype": dbt.type_string()}, {"name": "billing_address_address_1", "datatype": dbt.type_string()}, {"name": "billing_address_address_2", "datatype": dbt.type_string()}, {"name": "billing_address_city", "datatype": dbt.type_string()}, @@ -18,8 +11,6 @@ {"name": "billing_address_country", "datatype": dbt.type_string()}, {"name": "billing_address_country_code", "datatype": dbt.type_string()}, {"name": "billing_address_first_name", "datatype": dbt.type_string()}, - {"name": "billing_address_id", "datatype": dbt.type_int()}, - {"name": "billing_address_is_default", "datatype": "boolean"}, {"name": "billing_address_last_name", "datatype": dbt.type_string()}, {"name": "billing_address_latitude", "datatype": dbt.type_string()}, {"name": "billing_address_longitude", "datatype": dbt.type_string()}, @@ -31,14 +22,7 @@ {"name": "buyer_accepts_marketing", "datatype": "boolean"}, {"name": "cart_token", "datatype": dbt.type_string()}, {"name": "closed_at", "datatype": dbt.type_timestamp()}, - {"name": "completed_at", "datatype": dbt.type_timestamp()}, {"name": "created_at", "datatype": dbt.type_timestamp()}, - {"name": "credit_card_first_name", "datatype": dbt.type_string()}, - {"name": "credit_card_last_name", "datatype": dbt.type_string()}, - {"name": "credit_card_month", "datatype": dbt.type_int()}, - {"name": "credit_card_number", "datatype": dbt.type_int()}, - {"name": "credit_card_verification_value", "datatype": dbt.type_string()}, - {"name": "credit_card_year", "datatype": dbt.type_int()}, {"name": "currency", "datatype": dbt.type_string()}, {"name": "customer_id", "datatype": dbt.type_int()}, {"name": "customer_locale", "datatype": dbt.type_string()}, @@ -50,11 +34,6 @@ {"name": "location_id", "datatype": dbt.type_int()}, {"name": "name", "datatype": dbt.type_string()}, {"name": "note", "datatype": dbt.type_string()}, - {"name": "note_attribute_email_client_id", "datatype": dbt.type_string()}, - {"name": "note_attribute_google_client_id", "datatype": dbt.type_float()}, - {"name": "note_attribute_littledata_updated_at", "datatype": dbt.type_int()}, - {"name": "note_attribute_segment_client_id", "datatype": dbt.type_string()}, - {"name": "note_attributes", "datatype": dbt.type_string()}, {"name": "phone", "datatype": dbt.type_string()}, {"name": "presentment_currency", "datatype": dbt.type_string()}, {"name": "referring_site", "datatype": dbt.type_string()}, @@ -65,8 +44,6 @@ {"name": "shipping_address_country", "datatype": dbt.type_string()}, {"name": "shipping_address_country_code", "datatype": dbt.type_string()}, {"name": "shipping_address_first_name", "datatype": dbt.type_string()}, - {"name": "shipping_address_id", "datatype": dbt.type_int()}, - {"name": "shipping_address_is_default", "datatype": "boolean"}, {"name": "shipping_address_last_name", "datatype": dbt.type_string()}, {"name": "shipping_address_latitude", "datatype": dbt.type_string()}, {"name": "shipping_address_longitude", "datatype": dbt.type_string()}, @@ -75,14 +52,7 @@ {"name": "shipping_address_province", "datatype": dbt.type_string()}, {"name": "shipping_address_province_code", "datatype": dbt.type_string()}, {"name": "shipping_address_zip", "datatype": dbt.type_string()}, - {"name": "shipping_line", "datatype": dbt.type_string()}, - {"name": "shipping_rate_id", "datatype": dbt.type_string()}, - {"name": "shipping_rate_price", "datatype": dbt.type_float()}, - {"name": "shipping_rate_title", "datatype": dbt.type_string()}, - {"name": "source", "datatype": dbt.type_string()}, - {"name": "source_identifier", "datatype": dbt.type_string()}, {"name": "source_name", "datatype": dbt.type_string()}, - {"name": "source_url", "datatype": dbt.type_string()}, {"name": "subtotal_price", "datatype": dbt.type_float()}, {"name": "taxes_included", "datatype": "boolean"}, {"name": "token", "datatype": dbt.type_string()}, diff --git a/macros/get_collection_columns.sql b/macros/get_collection_columns.sql index 3905a9f..56529f2 100644 --- a/macros/get_collection_columns.sql +++ b/macros/get_collection_columns.sql @@ -3,7 +3,6 @@ {% set columns = [ {"name": "_fivetran_deleted", "datatype": "boolean"}, {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "body_html", "datatype": dbt.type_string()}, {"name": "disjunctive", "datatype": "boolean"}, {"name": "handle", "datatype": dbt.type_string()}, {"name": "id", "datatype": dbt.type_int()}, @@ -11,7 +10,6 @@ {"name": "published_scope", "datatype": dbt.type_string()}, {"name": "rules", "datatype": dbt.type_string()}, {"name": "sort_order", "datatype": dbt.type_string()}, - {"name": "template_suffix", "datatype": dbt.type_string()}, {"name": "title", "datatype": dbt.type_string()}, {"name": "updated_at", "datatype": dbt.type_timestamp()} ] %} diff --git a/macros/get_fulfillment_columns.sql b/macros/get_fulfillment_columns.sql index f9cb284..64d6add 100644 --- a/macros/get_fulfillment_columns.sql +++ b/macros/get_fulfillment_columns.sql @@ -7,7 +7,6 @@ {"name": "location_id", "datatype": dbt.type_int()}, {"name": "name", "datatype": dbt.type_string()}, {"name": "order_id", "datatype": dbt.type_int()}, - {"name": "receipt_authorization", "datatype": dbt.type_string()}, {"name": "service", "datatype": dbt.type_string()}, {"name": "shipment_status", "datatype": dbt.type_string()}, {"name": "status", "datatype": dbt.type_string()}, diff --git a/models/docs.md b/models/docs.md index 69b6ec0..be0366c 100644 --- a/models/docs.md +++ b/models/docs.md @@ -2,4 +2,10 @@ The time when a record was last updated by Fivetran. +{% enddocs %} + +{% docs _fivetran_deleted %} + +Boolean representing whether the record was soft-deleted in Shopify. + {% enddocs %} \ No newline at end of file diff --git a/models/src_shopify.yml b/models/src_shopify.yml index c3faf88..d4ffa0c 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -437,21 +437,201 @@ sources: description: "{{ doc('_fivetran_synced') }}" - name: abandoned_checkout - description: + description: A checkout is considered abandoned after the customer has added contact information, but before the customer has completed their purchase. columns: + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: abandoned_checkout_url + description: The recovery URL that's sent to a customer so they can recover their checkout. + - name: billing_address_address_1 + description: The street address of the billing address. + - name: billing_address_address_2 + description: An optional additional field for the street address of the billing address. + - name: billing_address_city + description: The city of the billing address. + - name: billing_address_company + description: The company of the person associated with the billing address. + - name: billing_address_country + description: The name of the country of the billing address. + - name: billing_address_country_code + description: The two-letter code (ISO 3166-1 alpha-2 format) for the country of the billing address. + - name: billing_address_first_name + description: The first name of the person associated with the payment method. + - name: billing_address_last_name + description: The last name of the person associated with the payment method. + - name: billing_address_latitude + description: The latitude of the billing address. + - name: billing_address_longitude + description: The longitude of the billing address. + - name: billing_address_name + description: The full name of the person associated with the payment method. + - name: billing_address_phone + description: The phone number at the billing address. + - name: billing_address_province + description: The name of the state or province of the billing address. + - name: billing_address_province_code + description: The two-letter abbreviation of the state or province of the billing address. + - name: billing_address_zip + description: The zip or postal code of the billing address. + - name: buyer_accepts_marketing + description: Whether the customer would like to receive email updates from the shop. This is set by the 'I want to receive occasional emails about new products, promotions and other news' checkbox during checkout. + - name: cart_token + description: The ID for the cart that's attached to the checkout. + - name: closed_at + description: The date and time (ISO 8601 format) when the checkout was closed. If the checkout was not closed, then this value is null. + - name: created_at + description: The date and time (ISO 8601 format) when the checkout was created. + - name: currency + description: The three-letter code (ISO 4217 format) of the shop's default currency at the time of checkout. For the currency that the customer used at checkout, see `presentment_currency`. + - name: customer_id + description: ID of the customer with the abandoned checkout. + - name: customer_locale + description: The two or three-letter language code, optionally followed by a region modifier. Example values - en, en-CA. + - name: device_id + description: The ID of the Shopify POS device that created the checkout. + - name: email + description: The customer's email address. + - name: gateway + description: The payment gateway used by the checkout. + - name: id + description: The ID for the checkout. + - name: landing_site_base_url + description: The URL for the page where the customer entered the shop. + - name: location_id + description: The ID of the physical location where the checkout was processed. + - name: name + description: Checkout order number. + - name: note + description: The text of an optional note that a shop owner can attach to the order. + - name: phone + description: The customer's phone number for receiving SMS notifications. + - name: presentment_currency + description: The three-letter code (ISO 4217 format) of the currency that the customer used at checkout. For the shop's default currency, see `currency`. + - name: referring_site + description: The website that referred the customer to the shop. + - name: shipping_address_address_1 + description: The street address of the shipping address. + - name: shipping_address_address_2 + description: An optional additional field for the street address of the shipping address. + - name: shipping_address_city + description: The city of the shipping address. + - name: shipping_address_company + description: The company of the person associated with the shipping address. + - name: shipping_address_country + description: The name of the country of the shipping address. + - name: shipping_address_country_code + description: The two-letter code (ISO 3166-1 alpha-2 format) for the country of the shipping address. + - name: shipping_address_first_name + description: The first name of the person associated with the shipping address. + - name: shipping_address_last_name + description: The last name of the person associated with the shipping address. + - name: shipping_address_latitude + description: The latitude of the shipping address. + - name: shipping_address_longitude + description: The longitude of the shipping address. + - name: shipping_address_name + description: The full name of the person associated with the shipping address. + - name: shipping_address_phone + description: The phone number at the shipping address. + - name: shipping_address_province + description: The name of the state or province of the shipping address. + - name: shipping_address_province_code + description: The two-letter abbreviation of the state or province of the shipping address. + - name: shipping_address_zip + description: The zip or postal code of the shipping address. + - name: source_name + description: Where the checkout originated. Valid values include `web`, `pos`, `iphone`, `android`. + - name: subtotal_price + description: The price of the checkout in presentment currency before shipping and taxes. + - name: taxes_included + description: Boolean representing whether taxes are included in the price. + - name: token + description: A unique ID for a checkout. + - name: total_discounts + description: The total amount of discounts to be applied in presentment currency. + - name: total_duties + description: The total duties of the checkout in presentment currency. + - name: total_line_items_price + description: The sum of the prices of all line items in the checkout in presentment currency. + - name: total_price + description: The sum of line item prices, all discounts, shipping costs, and taxes for the checkout in presentment currency. + - name: total_tax + description: The sum of all the taxes applied to the checkout in presentment currency. + - name: total_weight + description: The sum of all the weights in grams of the line items in the checkout. + - name: updated_at + description: The date and time (ISO 8601 format) when the checkout was last modified. + - name: user_id + description: The ID of the user who created the checkout. - name: collection_product - description: + description: Table relating products to the collections they belong to. Use this instead of the deprecated `COLLECT` table. columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: collection_id + description: ID referencing the `collection` the product belongs to. + - name: product_id + description: ID referencing the `product`. - name: collection - description: + description: > + A collection is a grouping of products that merchants can create to make their stores easier to browse. + Merchants can create collections by selecting products individually or by defining rules that automatically determine whether products are included (aka a "smart collection"). columns: + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: disjunctive + description: Boolean representing whether the `rules` or disjuctive (logical `OR`) or not. True = disjuctive, false = conjunctive (logical `AND`). + - name: handle + description: A unique, human-readable string for the collection automatically generated from its title. This is used in themes by the Liquid templating language to refer to the collection. + - name: id + description: The ID for the collection. + - name: published_at + description: The time and date (ISO 8601 format) when the collection was made visible. Returns null for a hidden collection. + - name: published_scope + description: > + Whether the collection is published to the Point of Sale channel. Valid values `web` (the collection is published to the Online Store channel but not published to the Point of Sale channel) + and `global` (the collection is published to both the Online Store channel and the Point of Sale channel). + - name: rules + description: > + An array of rules that define what products go into the smart collection. Each rule (`column` -- `relation` --> `condition`) has these properties: + - `column`: the property of a product being used to populate the smart collection. Ex: 'tag', 'type', 'vendor', 'variant_price', etc. + - `relation`: The comparitive relationship between the column choice, and the condition ('equals', 'contains', 'greater_than', etc.) + - condition: Select products for a smart collection using a condition. Values are either strings or numbers, depending on the relation value. + See the [Shopify docs](https://shopify.dev/api/admin-rest/2022-10/resources/smartcollection#resource-object) for more. + - name: sort_order + description: > + The order of the products in the collection. Valid values inclide + - `alpha-asc`: The products are sorted alphabetically from A to Z. + - `alpha-des`: The products are sorted alphabetically from Z to A. + - `best-selling`: The products are sorted by number of sales. + - `created`: The products are sorted by the date they were created, from oldest to newest. + - `created-desc`: The products are sorted by the date they were created, from newest to oldest. + - `manual`: The products are manually sorted by the shop owner. + - `price-asc`: The products are sorted by price from lowest to highest. + - `price-desc`: The products are sorted by price from highest to lowest. + - name: title + description: The name of the collection + - name: updated_at + description: The date and time (ISO 8601 format) when the collection was last modified. - name: customer_tag - description: + description: Tags that the shop owner has attached to the customer, formatted as a string of comma-separated values. A customer can have up to 250 tags. columns: - + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (starting from 1) represnting when the tag was placed on the customer. + - name: customer_id + description: ID of the customer being tagged. + - name: value + description: Value of the tag. + - name: discount_code description: > Table storing discount codes that enable specific discounts to be redeemed. Merchants can distribute discount codes to their customers using a variety of means, such as an email or URL, @@ -473,8 +653,59 @@ sources: description: The number of times that the discount code has been redeemed. - name: fulfillment - description: + description: > + A fulfillment order represents a group of one or more items in an order that will be fulfilled from the same location. + A fulfillment represents work that is completed as part of a fulfillment order and can include one or more items. columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: created_at + description: The date and time when the fulfillment was created. The API returns this value in ISO 8601 format. + - name: id + description: The ID for the fulfillment. + - name: location_id + description: The unique identifier of the location that the fulfillment was processed at. + - name: name + description: > + The uniquely identifying fulfillment name, consisting of two parts separated by a .. The first part represents the order name and the second part represents the fulfillment number. + The fulfillment number automatically increments depending on how many fulfillments are in an order (e.g. #1001.1, #1001.2). + - name: order_id + description: The unique numeric identifier for the order. + - name: receipt_authorization + description: The authorization code from the receipt. + - name: service + description: The fulfillment service associated with the fulfillment. + - name: shipment_status + description: > + The current shipment status of the fulfillment. Valid values include: + - label_printed: A label for the shipment was purchased and printed. + - label_purchased: A label for the shipment was purchased, but not printed. + - attempted_delivery: Delivery of the shipment was attempted, but unable to be completed. + - ready_for_pickup: The shipment is ready for pickup at a shipping depot. + - confirmed: The carrier is aware of the shipment, but hasn't received it yet. + - in_transit: The shipment is being transported between shipping facilities on the way to its destination. + - out_for_delivery: The shipment is being delivered to its final destination. + - delivered: The shipment was succesfully delivered. + - failure: Something went wrong when pulling tracking information for the shipment, such as the tracking number was invalid or the shipment was canceled. + - name: status + description: > + The status of the fulfillment. Valid values include: + - pending: Shopify has created the fulfillment and is waiting for the third-party fulfillment service to transition it to 'open' or 'success'. + - open: The fulfillment has been acknowledged by the service and is in processing. + - success: The fulfillment was successful. + - cancelled: The fulfillment was cancelled. + - error: There was an error with the fulfillment request. + - failure: The fulfillment request failed. + - name: tracking_company + description: The name of the tracking company. + - name: tracking_number + description: Primary tracking number for the order. + - name: tracking_numbers + description: A list of tracking numbers, provided by the shipping company. + - name: tracking_urls + description: The URLs of tracking pages for the fulfillment. + - name: updated_at + description: The date and time (ISO 8601 format) when the fulfillment was last modified. - name: inventory_item description: > @@ -482,7 +713,7 @@ sources: There is a 1:1 relationship between a product variant and an inventory item. columns: - name: _fivetran_deleted - description: Boolean representing if the inventory item was soft-deleted in Shopify. + description: "{{ doc('_fivetran_deleted') }}" - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: cost @@ -505,12 +736,69 @@ sources: description: The date and time (ISO 8601 format) when the inventory item was last modified. - name: inventory_level - description: + description: > + An inventory level represents the quantities of an inventory item for a location. + + Each inventory level belongs to one inventory item and has one location. For every location where an inventory item can be stocked, there's an inventory level that represents + the inventory item's quantities relating to that location. columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: available + description: The available quantity of an inventory item at the inventory level's associated location. Returns null if the inventory item is not tracked. + - name: inventory_item_id + description: The ID of the inventory item associated with the inventory level. + - name: location_id + description: The ID of the location that the inventory level belongs to. + - name: updated_at + description: The date and time (ISO 8601 format) when the inventory level was last modified. - name: location - description: + description: A location represents a geographical location where your stores, pop-up stores, headquarters, and warehouses exist. columns: + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: active + description: > + Boolean representing whether the location is active. If true, then the location can be used to sell products, stock inventory, and fulfill orders. + - name: address_1 + description: The location's street address. + - name: address_2 + description: The optional second line of the location's street address. + - name: city + description: The city the location is in. + - name: country + description: The country the location is in (two-letter code). + - name: country_code + description: The two-letter code (ISO 3166-1 alpha-2 format) corresponding to country the location is in. + - name: country_name + description: Full name of the location's country. + - name: created_at + description: The date and time (ISO 8601 format) when the location was created. + - name: id + description: The ID of the location. + - name: legacy + description: > + Boolean representing whether this is a fulfillment service location. If true, then the location is a fulfillment service location. + If false, then the location was created by the merchant and isn't tied to a fulfillment service. + - name: localized_country_name + description: The localized name of the location's country. + - name: localized_province_name + description: The localized name of the location's region. Typically a province, state, or district. + - name: name + description: The name of the location. + - name: phone + description: The phone number of the location. This value can contain special characters, such as - or +. + - name: province + description: The province, state, or district of the location. + - name: province_code + description: The province, state, or district code (ISO 3166-2 alpha-2 format) of the location. + - name: updated_at + description: The date and time (ISO 8601 format) when the location was last updated. + - name: zip + description: The zip or postal code. - name: metafield description: > diff --git a/models/stg_shopify__abandoned_checkout.sql b/models/stg_shopify__abandoned_checkout.sql index 8160611..54d6e49 100644 --- a/models/stg_shopify__abandoned_checkout.sql +++ b/models/stg_shopify__abandoned_checkout.sql @@ -20,21 +20,9 @@ fields as ( final as ( select -22:58:01 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.ad_reporting -- models.netsuite - -22:58:04 _fivetran_deleted, + _fivetran_deleted as is_deleted, _fivetran_synced, abandoned_checkout_url, - applied_discount_amount, - applied_discount_applicable, - applied_discount_description, - applied_discount_non_applicable_reason, - applied_discount_title, - applied_discount_value, - applied_discount_value_type, billing_address_address_1, billing_address_address_2, billing_address_city, @@ -42,8 +30,6 @@ There are 2 unused configuration paths: billing_address_country, billing_address_country_code, billing_address_first_name, - billing_address_id, - billing_address_is_default, billing_address_last_name, billing_address_latitude, billing_address_longitude, @@ -52,33 +38,21 @@ There are 2 unused configuration paths: billing_address_province, billing_address_province_code, billing_address_zip, - buyer_accepts_marketing, + buyer_accepts_marketing as has_buyer_accepted_marketing, cart_token, closed_at, - completed_at, created_at, - credit_card_first_name, - credit_card_last_name, - credit_card_month, - credit_card_number, - credit_card_verification_value, - credit_card_year, - currency, + currency as shop_currency, customer_id, customer_locale, device_id, email, gateway, - id, + id as checkout_id, landing_site_base_url, location_id, name, note, - note_attribute_email_client_id, - note_attribute_google_client_id, - note_attribute_littledata_updated_at, - note_attribute_segment_client_id, - note_attributes, phone, presentment_currency, referring_site, @@ -89,8 +63,6 @@ There are 2 unused configuration paths: shipping_address_country, shipping_address_country_code, shipping_address_first_name, - shipping_address_id, - shipping_address_is_default, shipping_address_last_name, shipping_address_latitude, shipping_address_longitude, @@ -99,16 +71,9 @@ There are 2 unused configuration paths: shipping_address_province, shipping_address_province_code, shipping_address_zip, - shipping_line, - shipping_rate_id, - shipping_rate_price, - shipping_rate_title, - source, - source_identifier, source_name, - source_url, subtotal_price, - taxes_included, + taxes_included as has_taxes_included, token, total_discounts, total_duties, @@ -118,6 +83,7 @@ There are 2 unused configuration paths: total_weight, updated_at, user_id + from fields ) diff --git a/models/stg_shopify__collection.sql b/models/stg_shopify__collection.sql index 8ffe5e1..fb65576 100644 --- a/models/stg_shopify__collection.sql +++ b/models/stg_shopify__collection.sql @@ -20,24 +20,21 @@ fields as ( final as ( select -22:58:06 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting - -22:58:09 _fivetran_deleted, + _fivetran_deleted as is_deleted, _fivetran_synced, - body_html, - disjunctive, + case + when disjunctive is null then null + when disjunctive then 'disjunctive' + else 'conjunctive' end as rule_logic, handle, - id, + id as collection_id, published_at, published_scope, rules, sort_order, - template_suffix, title, updated_at + from fields ) diff --git a/models/stg_shopify__collection_product.sql b/models/stg_shopify__collection_product.sql index ac6f058..83fe551 100644 --- a/models/stg_shopify__collection_product.sql +++ b/models/stg_shopify__collection_product.sql @@ -20,14 +20,10 @@ fields as ( final as ( select -22:58:11 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting - -22:58:14 _fivetran_synced, + _fivetran_synced, collection_id, product_id + from fields ) diff --git a/models/stg_shopify__fulfillment.sql b/models/stg_shopify__fulfillment.sql index 3eced52..d5110b6 100644 --- a/models/stg_shopify__fulfillment.sql +++ b/models/stg_shopify__fulfillment.sql @@ -20,18 +20,12 @@ fields as ( final as ( select -22:57:09 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting - -22:57:12 _fivetran_synced, + _fivetran_synced, created_at, - id, + id as fulfillment_id, location_id, name, order_id, - receipt_authorization, service, shipment_status, status, @@ -40,6 +34,7 @@ There are 2 unused configuration paths: tracking_numbers, tracking_urls, updated_at + from fields ) diff --git a/models/stg_shopify__inventory_level.sql b/models/stg_shopify__inventory_level.sql index c281ee2..b661ee7 100644 --- a/models/stg_shopify__inventory_level.sql +++ b/models/stg_shopify__inventory_level.sql @@ -20,16 +20,12 @@ fields as ( final as ( select -22:58:21 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting - -22:58:24 _fivetran_synced, - available, + _fivetran_synced, + available as available_quantity, inventory_item_id, location_id, updated_at + from fields ) diff --git a/models/stg_shopify__location.sql b/models/stg_shopify__location.sql index 8497583..7f15082 100644 --- a/models/stg_shopify__location.sql +++ b/models/stg_shopify__location.sql @@ -20,23 +20,17 @@ fields as ( final as ( select -22:58:27 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting - -22:58:30 _fivetran_deleted, + _fivetran_deleted as is_deleted, _fivetran_synced, - active, + active as is_active, address_1, address_2, city, - country, - country_code, + coalesce(country_code, country) as country_code, country_name, created_at, - id, - legacy, + id as location_id, + legacy as is_legacy, localized_country_name, localized_province_name, name, @@ -45,6 +39,7 @@ There are 2 unused configuration paths: province_code, updated_at, zip + from fields ) From b96e2b77e424e6723f3653510817b62682248e12 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 6 Dec 2022 16:56:44 -0800 Subject: [PATCH 025/137] staging models are added --- dbt_project.yml | 45 +-- ...andoned_checkout_discount_code_columns.sql | 17 + macros/get_fulfillment_order_line_columns.sql | 30 ++ macros/get_metafield_columns.sql | 1 + macros/get_product_image_columns.sql | 2 - macros/get_shop_columns.sql | 5 - macros/get_tender_transaction_columns.sql | 2 - models/src_shopify.yml | 310 +++++++++++++++++- ...pify__abandoned_checkout_discount_code.sql | 37 +++ models/stg_shopify__customer_tag.sql | 17 +- models/stg_shopify__discount_code.sql | 8 +- models/stg_shopify__fulfillment.sql | 10 +- .../stg_shopify__fulfillment_order_line.sql | 48 +++ models/stg_shopify__inventory_item.sql | 12 +- models/stg_shopify__inventory_level.sql | 6 +- models/stg_shopify__location.sql | 10 +- models/stg_shopify__metafield.sql | 12 +- models/stg_shopify__order_note_attribute.sql | 12 +- models/stg_shopify__order_shipping_line.sql | 16 +- .../stg_shopify__order_shipping_tax_line.sql | 12 +- models/stg_shopify__order_tag.sql | 12 +- models/stg_shopify__order_url_tag.sql | 8 +- models/stg_shopify__price_rule.sql | 18 +- models/stg_shopify__product_image.sql | 22 +- models/stg_shopify__product_tag.sql | 12 +- models/stg_shopify__shop.sql | 77 ++--- models/stg_shopify__tender_transaction.sql | 20 +- ...__abandoned_checkout_discount_code_tmp.sql | 12 + .../stg_shopify__abandoned_checkout_tmp.sql | 14 +- .../stg_shopify__collection_product_tmp.sql | 14 +- models/tmp/stg_shopify__collection_tmp.sql | 14 +- models/tmp/stg_shopify__customer_tag_tmp.sql | 14 +- models/tmp/stg_shopify__discount_code_tmp.sql | 14 +- ...tg_shopify__fulfillment_order_line_tmp.sql | 12 + models/tmp/stg_shopify__fulfillment_tmp.sql | 14 +- .../tmp/stg_shopify__inventory_item_tmp.sql | 14 +- .../tmp/stg_shopify__inventory_level_tmp.sql | 14 +- models/tmp/stg_shopify__location_tmp.sql | 14 +- models/tmp/stg_shopify__metafield_tmp.sql | 14 +- .../stg_shopify__order_note_attribute_tmp.sql | 14 +- .../stg_shopify__order_shipping_line_tmp.sql | 14 +- ...g_shopify__order_shipping_tax_line_tmp.sql | 14 +- models/tmp/stg_shopify__order_tag_tmp.sql | 14 +- models/tmp/stg_shopify__order_url_tag_tmp.sql | 14 +- models/tmp/stg_shopify__price_rule_tmp.sql | 14 +- models/tmp/stg_shopify__product_image_tmp.sql | 14 +- models/tmp/stg_shopify__product_tag_tmp.sql | 14 +- models/tmp/stg_shopify__shop_tmp.sql | 14 +- .../stg_shopify__tender_transaction_tmp.sql | 14 +- 49 files changed, 840 insertions(+), 245 deletions(-) create mode 100644 macros/get_abandoned_checkout_discount_code_columns.sql create mode 100644 macros/get_fulfillment_order_line_columns.sql create mode 100644 models/stg_shopify__abandoned_checkout_discount_code.sql create mode 100644 models/stg_shopify__fulfillment_order_line.sql create mode 100644 models/tmp/stg_shopify__abandoned_checkout_discount_code_tmp.sql create mode 100644 models/tmp/stg_shopify__fulfillment_order_line_tmp.sql diff --git a/dbt_project.yml b/dbt_project.yml index cdcf44c..646ca23 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -19,27 +19,30 @@ vars: transaction_source: "{{ source('shopify','transaction') }}" refund_source: "{{ source('shopify','refund') }}" order_adjustment_source: "{{ source('shopify','order_adjustment') }}" - abandoned_checkout: "{{ source('shopify','abandoned_checkout') }}" - collection_product: "{{ source('shopify','collection_product') }}" - collection: "{{ source('shopify','collection') }}" - customer_tag: "{{ source('shopify','customer_tag') }}" - discount_code: "{{ source('shopify','discount_code') }}" - fulfillment: "{{ source('shopify','fulfillment') }}" - inventory_item: "{{ source('shopify','inventory_item') }}" - inventory_level: "{{ source('shopify','inventory_level') }}" - location: "{{ source('shopify','location') }}" - metafield: "{{ source('shopify','metafield') }}" - order_note_attribute: "{{ source('shopify','order_note_attribute') }}" - order_shipping_line: "{{ source('shopify','order_shipping_line') }}" - order_shipping_tax_line: "{{ source('shopify','order_shipping_tax_line') }}" - order_tag: "{{ source('shopify','order_tag') }}" - order_url_tag: "{{ source('shopify','order_url_tag') }}" - price_rule: "{{ source('shopify','price_rule') }}" - product_image: "{{ source('shopify','product_image') }}" - product_tag: "{{ source('shopify','product_tag') }}" - shop: "{{ source('shopify','shop') }}" - tender_transaction: "{{ source('shopify','tender_transaction') }}" - + + abandoned_checkout_source: "{{ source('shopify','abandoned_checkout') }}" + collection_product_source: "{{ source('shopify','collection_product') }}" + collection_source: "{{ source('shopify','collection') }}" + customer_tag_source: "{{ source('shopify','customer_tag') }}" + discount_code_source: "{{ source('shopify','discount_code') }}" + fulfillment_source: "{{ source('shopify','fulfillment') }}" + inventory_item_source: "{{ source('shopify','inventory_item') }}" + inventory_level_source: "{{ source('shopify','inventory_level') }}" + location_source: "{{ source('shopify','location') }}" + metafield_source: "{{ source('shopify','metafield') }}" + order_note_attribute_source: "{{ source('shopify','order_note_attribute') }}" + order_shipping_line_source: "{{ source('shopify','order_shipping_line') }}" + order_shipping_tax_line_source: "{{ source('shopify','order_shipping_tax_line') }}" + order_tag_source: "{{ source('shopify','order_tag') }}" + order_url_tag_source: "{{ source('shopify','order_url_tag') }}" + price_rule_source: "{{ source('shopify','price_rule') }}" + product_image_source: "{{ source('shopify','product_image') }}" + product_tag_source: "{{ source('shopify','product_tag') }}" + shop_source: "{{ source('shopify','shop') }}" + tender_transaction_source: "{{ source('shopify','tender_transaction') }}" + abandoned_checkout_discount_code_source: "{{ source('shopify','abandoned_checkout_discount_code') }}" + fulfillment_order_line_source: "{{ source('shopify','fulfillment_order_line') }}" + customer_pass_through_columns: [] order_line_refund_pass_through_columns: [] order_line_pass_through_columns: [] diff --git a/macros/get_abandoned_checkout_discount_code_columns.sql b/macros/get_abandoned_checkout_discount_code_columns.sql new file mode 100644 index 0000000..a016c34 --- /dev/null +++ b/macros/get_abandoned_checkout_discount_code_columns.sql @@ -0,0 +1,17 @@ +{% macro get_abandoned_checkout_discount_code_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "amount", "datatype": dbt.type_float()}, + {"name": "checkout_id", "datatype": dbt.type_int()}, + {"name": "code", "datatype": dbt.type_string()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "discount_id", "datatype": dbt.type_int()}, + {"name": "index", "datatype": dbt.type_int()}, + {"name": "type", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_fulfillment_order_line_columns.sql b/macros/get_fulfillment_order_line_columns.sql new file mode 100644 index 0000000..f8ce8ad --- /dev/null +++ b/macros/get_fulfillment_order_line_columns.sql @@ -0,0 +1,30 @@ +{% macro get_fulfillment_order_line_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "fulfillable_quantity", "datatype": dbt.type_int()}, + {"name": "fulfillment_id", "datatype": dbt.type_int()}, + {"name": "fulfillment_service", "datatype": dbt.type_string()}, + {"name": "gift_card", "datatype": "boolean"}, + {"name": "grams", "datatype": dbt.type_int()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "order_id", "datatype": dbt.type_int()}, + {"name": "order_line_id", "datatype": dbt.type_int()}, + {"name": "price", "datatype": dbt.type_float()}, + {"name": "price_set", "datatype": dbt.type_string()}, + {"name": "product_id", "datatype": dbt.type_int()}, + {"name": "properties", "datatype": dbt.type_string()}, + {"name": "property_pre_order_date", "datatype": dbt.type_string()}, + {"name": "quantity", "datatype": dbt.type_int()}, + {"name": "requires_shipping", "datatype": "boolean"}, + {"name": "sku", "datatype": dbt.type_string()}, + {"name": "taxable", "datatype": "boolean"}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "variant_id", "datatype": dbt.type_int()}, + {"name": "variant_title", "datatype": dbt.type_string()}, + {"name": "vendor", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_metafield_columns.sql b/macros/get_metafield_columns.sql index ccb18e7..7bc2ce5 100644 --- a/macros/get_metafield_columns.sql +++ b/macros/get_metafield_columns.sql @@ -10,6 +10,7 @@ {"name": "owner_id", "datatype": dbt.type_int()}, {"name": "owner_resource", "datatype": dbt.type_string()}, {"name": "type", "datatype": dbt.type_string()}, + {"name": "value_type", "datatype": dbt.type_string()}, {"name": "updated_at", "datatype": dbt.type_timestamp()}, {"name": "value", "datatype": dbt.type_string()} ] %} diff --git a/macros/get_product_image_columns.sql b/macros/get_product_image_columns.sql index 35a1b9f..7910741 100644 --- a/macros/get_product_image_columns.sql +++ b/macros/get_product_image_columns.sql @@ -3,11 +3,9 @@ {% set columns = [ {"name": "_fivetran_deleted", "datatype": "boolean"}, {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "alt", "datatype": dbt.type_string()}, {"name": "created_at", "datatype": dbt.type_timestamp()}, {"name": "height", "datatype": dbt.type_int()}, {"name": "id", "datatype": dbt.type_int()}, - {"name": "is_default", "datatype": "boolean"}, {"name": "position", "datatype": dbt.type_int()}, {"name": "product_id", "datatype": dbt.type_int()}, {"name": "src", "datatype": dbt.type_string()}, diff --git a/macros/get_shop_columns.sql b/macros/get_shop_columns.sql index 710d54d..407d9ef 100644 --- a/macros/get_shop_columns.sql +++ b/macros/get_shop_columns.sql @@ -5,7 +5,6 @@ {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, {"name": "address_1", "datatype": dbt.type_string()}, {"name": "address_2", "datatype": dbt.type_string()}, - {"name": "auto_configure_tax_inclusivity", "datatype": "boolean"}, {"name": "checkout_api_supported", "datatype": "boolean"}, {"name": "city", "datatype": dbt.type_string()}, {"name": "cookie_consent_level", "datatype": dbt.type_string()}, @@ -21,7 +20,6 @@ {"name": "eligible_for_payments", "datatype": "boolean"}, {"name": "email", "datatype": dbt.type_string()}, {"name": "enabled_presentment_currencies", "datatype": dbt.type_string()}, - {"name": "force_ssl", "datatype": "boolean"}, {"name": "google_apps_domain", "datatype": dbt.type_string()}, {"name": "google_apps_login_enabled", "datatype": "boolean"}, {"name": "has_discounts", "datatype": "boolean"}, @@ -35,7 +33,6 @@ {"name": "money_in_emails_format", "datatype": dbt.type_string()}, {"name": "money_with_currency_format", "datatype": dbt.type_string()}, {"name": "money_with_currency_in_emails_format", "datatype": dbt.type_string()}, - {"name": "multi_location_enabled", "datatype": "boolean"}, {"name": "myshopify_domain", "datatype": dbt.type_string()}, {"name": "name", "datatype": dbt.type_string()}, {"name": "password_enabled", "datatype": "boolean"}, @@ -44,7 +41,6 @@ {"name": "plan_name", "datatype": dbt.type_string()}, {"name": "pre_launch_enabled", "datatype": "boolean"}, {"name": "primary_locale", "datatype": dbt.type_string()}, - {"name": "primary_location_id", "datatype": dbt.type_int()}, {"name": "province", "datatype": dbt.type_string()}, {"name": "province_code", "datatype": dbt.type_string()}, {"name": "requires_extra_payments_agreement", "datatype": "boolean"}, @@ -55,7 +51,6 @@ {"name": "taxes_included", "datatype": "boolean"}, {"name": "timezone", "datatype": dbt.type_string()}, {"name": "updated_at", "datatype": dbt.type_timestamp()}, - {"name": "visitor_tracking_consent_preference", "datatype": dbt.type_string()}, {"name": "weight_unit", "datatype": dbt.type_string()}, {"name": "zip", "datatype": dbt.type_string()} ] %} diff --git a/macros/get_tender_transaction_columns.sql b/macros/get_tender_transaction_columns.sql index 3678e2f..868db99 100644 --- a/macros/get_tender_transaction_columns.sql +++ b/macros/get_tender_transaction_columns.sql @@ -6,8 +6,6 @@ {"name": "currency", "datatype": dbt.type_string()}, {"name": "id", "datatype": dbt.type_int()}, {"name": "order_id", "datatype": dbt.type_int()}, - {"name": "payment_details_credit_card_company", "datatype": dbt.type_string()}, - {"name": "payment_details_credit_card_number", "datatype": dbt.type_string()}, {"name": "payment_method", "datatype": dbt.type_string()}, {"name": "processed_at", "datatype": dbt.type_timestamp()}, {"name": "remote_reference", "datatype": dbt.type_string()}, diff --git a/models/src_shopify.yml b/models/src_shopify.yml index d4ffa0c..834de38 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -621,7 +621,7 @@ sources: description: The date and time (ISO 8601 format) when the collection was last modified. - name: customer_tag - description: Tags that the shop owner has attached to the customer, formatted as a string of comma-separated values. A customer can have up to 250 tags. + description: Tags that the shop owner has attached to the customer. A customer can have up to 250 tags. columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -831,24 +831,90 @@ sources: description: DEPRECATED as of [June 2022](https://fivetran.com/docs/applications/shopify/changelog#june2022). Use `type` instead. - name: order_note_attribute - description: + description: Table storing custom attributes placed on orders. columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: name + description: Name of the attribute. + - name: order_id + description: ID referencing the order the note attribute belongs to. + - name: value + description: Value of the attribute. - name: order_shipping_line - description: + description: Represents the shipping details that the customer chose for their order. columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: carrier_identifier + description: A reference to the carrier service that provided the rate. Present when the rate was computed by a third-party carrier service. + - name: code + description: A reference to the shipping method. + - name: delivery_category + description: The general classification of the delivery method. + - name: discounted_price + description: The pre-tax shipping price with discounts applied. + - name: discounted_price_set + description: The pre-tax shipping price with discounts applied (JSON). + - name: id + description: A globally-unique identifier. + - name: order_id + description: ID of the associated order. + - name: phone + description: The phone number at the shipping address. + - name: price + description: Returns the price of the shipping line. + - name: price_set + description: Returns the price of the shipping line (JSON). + - name: requested_fulfillment_service_id + description: The fulfillment service requested for the shipping method. Present if the shipping method requires processing by a third party fulfillment service. + - name: source + description: Returns the rate source for the shipping line. + - name: title + description: Returns the title of the shipping line. - name: order_shipping_tax_line - description: + description: Represents taxes associated with order shipping lines. columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (from 1) representing the order of shipping lines per order. + - name: order_shipping_line_id + description: ID of the order shipping line this recod is associated with. + - name: price + description: The amount of tax, in shop currency, after discounts and before returns. + - name: price_set + description: The amount of tax, in shop and presentment currencies, after discounts and before returns (JSON). + - name: rate + description: The proportion of the line item price that the tax represents as a decimal. + - name: title + description: The name of the tax. - name: order_tag - description: + description: Tags that the shop owner has attached to the order. columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (starting from 1) represnting when the tag was placed on the order. + - name: order_id + description: ID of the order being tagged. + - name: value + description: Value of the tag. - name: order_url_tag - description: + description: Key-value tags that the shop owner has attached to the order url. columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: key + description: Key of the tag pair. + - name: order_id + description: ID of the order url being tagged. + - name: value + description: Value of the tag. - name: price_rule description: > @@ -915,17 +981,241 @@ sources: If `target_type` is `shipping_line`, then only `percentage` is accepted. - name: product_image - description: + description: Table storing hosted images of products. columns: + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: created_at + description: The date and time when the product image was created. The API returns this value in ISO 8601 format. + - name: height + description: Height dimension of the image which is determined on upload. + - name: id + description: Unique numeric identifier of the product image. + - name: position + description: The order of the product image in the list. The first product image is at position 1 and is the "main" image for the product. + - name: product_id + description: The id of the product associated with the image. + - name: src + description: Specifies the location of the product image. This parameter supports URL filters that you can use to retrieve modified copies of the image. + - name: updated_at + description: The date and time when the product image was last modified. The API returns this value in ISO 8601 format. + - name: variant_ids + description: An array of variant ids associated with the image. + - name: width + description: Width dimension of the image which is determined on upload. - name: product_tag - description: + description: Tags that the shop owner has attached to the product. columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (starting from 1) represnting when the tag was placed on the product. + - name: product_id + description: ID of the product being tagged. + - name: value + description: Value of the tag. - name: shop - description: + description: The Shop resource is a collection of general business and store management settings and information about the store. columns: + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: address_1 + description: The shop's street address. + - name: address_2 + description: The optional second line of the shop's street address. + - name: checkout_api_supported + description: Boolean representing whether the shop is capable of accepting payments directly through the Checkout API. + - name: city + description: The shop's city. + - name: cookie_consent_level + description: The cookie consent level defined on the shop's online store. + - name: country + description: The shop's country. In most cases, this value matches the country_code. + - name: country_code + description: The two-letter country code corresponding to the shop's country. + - name: country_name + description: The shop's normalized country name. + - name: county_taxes + description: Boolean representing whether the shop is applying taxes on a per-county basis. Only applicable to shops based in the US. Either `true` or `null` (not false, according to Shopify API docs). + - name: created_at + description: The date and time (ISO 8601) when the shop was created. + - name: currency + description: The three-letter code (ISO 4217 format) for the shop's default currency. + - name: customer_email + description: The contact email used for communication between the shop owner and the customer. + - name: domain + description: The shop's domain. + - name: eligible_for_card_reader_giveaway + description: Boolean representing whether the shop is eligible to receive a free credit card reader from Shopify. + - name: eligible_for_payments + description: Boolean representing whether the shop is eligible to use Shopify Payments. + - name: email + description: The contact email used for communication between Shopify and the shop owner. + - name: enabled_presentment_currencies + description: An array of of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable currencies from their Shopify Payments settings in the Shopify Admin. + - name: force_ssl + description: DEPRECATED. + - name: google_apps_domain + description: The GSuite URL for the store, if applicable. + - name: google_apps_login_enabled + description: Boolean representing whether the GSuite login is enabled. Shops with this feature will be able to log in through the GSuite login page. Valid values are `true` and `null`. + - name: has_discounts + description: Boolean representing whether any active discounts exist for the shop. + - name: has_gift_cards + description: Boolean representing whether any active gift cards exist for the shop. + - name: has_storefront + description: Boolean representing whether this shop has an online store. + - name: iana_timezone + description: The name of the timezone assigned by the [IANA](https://www.iana.org/time-zones). + - name: id + description: The ID for the shop. A 64-bit unsigned integer. + - name: latitude + description: The latitude of the shop's location. + - name: longitude + description: The longitude of the shop's location. + - name: money_format + description: A string representing the way currency is formatted when the currency isn't specified. + - name: money_in_emails_format + description: A string representing the way currency is formatted in email notifications when the currency isn't specified. + - name: money_with_currency_format + description: A string representing the way currency is formatted when the currency is specified. + - name: money_with_currency_in_emails_format + description: A string representing the way currency is formatted in email notifications when the currency is specified. + - name: multi_location_enabled + description: DEPRECATED and hard-coded to `true`. + - name: myshopify_domain + description: The shop's .myshopify.com domain. + - name: name + description: The name of the shop. + - name: password_enabled + description: Boolean representing whether the password protection page is enabled on the shop's online store. + - name: phone + description: The contact phone number for the shop. + - name: plan_display_name + description: The display name of the Shopify plan the shop is on. + - name: plan_name + description: The name of the Shopify plan the shop is on. + - name: pre_launch_enabled + description: Boolen representing whether the pre-launch page is enabled on the shop's online store. + - name: primary_locale + description: The shop's primary locale, as configured in the language settings of the shop's theme. + - name: primary_location_id + description: DEPRECATED. Formerly used for the ID of the shipping origin location. + - name: province + description: The shop's normalized province or state name. + - name: province_code + description: The two- or three-letter code for the shop's province or state. + - name: requires_extra_payments_agreement + description: Boolean representing whether the shop requires an extra Shopify Payments agreement. + - name: setup_required + description: Boolean representing whether the shop has any outstanding setup steps. + - name: shop_owner + description: The username of the shop owner. + - name: source + description: The handle of the partner account that referred the merchant to Shopify, if applicable. + - name: tax_shipping + description: Boolean representing whether taxes are charged for shipping. Valid values are true or false. + - name: taxes_included + description: Boolean representing whether applicable taxes are included in product prices. Valid values are true or null. + - name: timezone + description: The name of the timezone the shop is in. + - name: updated_at + description: The date and time (ISO 8601) when the shop was last updated. + - name: weight_unit + description: The default unit of weight measurement for the shop. + - name: zip + description: The shop's zip or postal code. - name: tender_transaction - description: + description: > + Each tender transaction represents money passing between the merchant and a customer. A tender transaction with a positive amount + represents a transaction where the customer paid money to the merchant. A negative amount represents a transaction where the + merchant refunded money back to the customer. Tender transactions represent transactions that modify the shop's balance. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: amount + description: The amount of the tender transaction in the shop's currency. + - name: currency + description: The three-letter code (ISO 4217 format) for the currency used for the tender transaction. + - name: id + description: The ID of the transaction. + - name: order_id + description: The ID of the order that the tender transaction belongs to. + - name: payment_method + description: > + Information about the payment method used for this transaction. Valid values include: + - credit_card + - cash + - android_pay + - apple_pay + - google_pay + - samsung_pay + - shopify_pay + - amazon + - klarna + - paypal + - unknown + - other + - name: processed_at + description: The date and time (ISO 8601 format) when the tender transaction was processed. + - name: remote_reference + description: The remote (gateway) reference associated with the tender. + - name: test + description: Whether the tender transaction is a test transaction. + - name: user_id + description: The ID of the user logged into the Shopify POS device that processed the tender transaction, if applicable. + + - name: fulfillment_order_line + description: May remove this table TODO. columns: + - name: _fivetran_synced + - name: fulfillable_quantity + - name: fulfillment_id + - name: fulfillment_service + - name: gift_card + - name: grams + - name: name + - name: order_id + - name: order_line_id + - name: price + - name: price_set + - name: product_id + - name: properties + - name: property_pre_order_date + - name: quantity + - name: requires_shipping + - name: sku + - name: taxable + - name: title + - name: variant_id + - name: variant_title + - name: vendor + + - name: abandoned_checkout_discount_code + description: Abandoned checkouts that applied a discount code. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: amount + description: The amount of the discount in presentment currency. + - name: checkout_id + description: ID of the checkout. + - name: code + description: The discount code. + - name: created_at + description: When the checkout discount application was created. + - name: discount_id + description: ID of the discount. + - name: index + description: Index (from 1) representing the application of the discount to the checkout. Use the latest (highest index) + - name: type + description: The type of discount. Valid values - percentage, shipping, fixed_amount. (default - fixed_amount) + - name: updated_at + description: When the checkout's discount was last updated \ No newline at end of file diff --git a/models/stg_shopify__abandoned_checkout_discount_code.sql b/models/stg_shopify__abandoned_checkout_discount_code.sql new file mode 100644 index 0000000..48dcc01 --- /dev/null +++ b/models/stg_shopify__abandoned_checkout_discount_code.sql @@ -0,0 +1,37 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__abandoned_checkout_discount_code_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__abandoned_checkout_discount_code_tmp')), + staging_columns=get_abandoned_checkout_discount_code_columns() + ) + }} + from base +), + +final as ( + + select + checkout_id, + code, + discount_id, + index, + amount, + type, + created_at, + updated_at, + _fivetran_synced + + from fields +) + +select * +from final diff --git a/models/stg_shopify__customer_tag.sql b/models/stg_shopify__customer_tag.sql index ad19a76..be34e7f 100644 --- a/models/stg_shopify__customer_tag.sql +++ b/models/stg_shopify__customer_tag.sql @@ -2,7 +2,7 @@ with base as ( select * - from {{ ref('stg_shopify__custiner_tag_tmp') }} + from {{ ref('stg_shopify__customer_tag_tmp') }} ), fields as ( @@ -10,8 +10,8 @@ fields as ( select {{ fivetran_utils.fill_staging_columns( - source_columns=adapter.get_columns_in_relation(ref('stg_shopify__custiner_tag_tmp')), - staging_columns=get_custiner_tag_columns() + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__customer_tag_tmp')), + staging_columns=get_customer_tag_columns() ) }} from base @@ -20,14 +20,13 @@ fields as ( final as ( select -22:58:32 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting + customer_id, + index, + value, + _fivetran_synced -22:58:35 from fields ) -select *lk43 +select * from final diff --git a/models/stg_shopify__discount_code.sql b/models/stg_shopify__discount_code.sql index 01db6c9..550fe2d 100644 --- a/models/stg_shopify__discount_code.sql +++ b/models/stg_shopify__discount_code.sql @@ -20,13 +20,13 @@ fields as ( final as ( select - _fivetran_synced, - code, - created_at, id as discount_code_id, + code, price_rule_id, + usage_count, + created_at, updated_at, - usage_count + _fivetran_synced from fields ) diff --git a/models/stg_shopify__fulfillment.sql b/models/stg_shopify__fulfillment.sql index d5110b6..da31014 100644 --- a/models/stg_shopify__fulfillment.sql +++ b/models/stg_shopify__fulfillment.sql @@ -20,12 +20,10 @@ fields as ( final as ( select - _fivetran_synced, - created_at, id as fulfillment_id, location_id, - name, order_id, + name, service, shipment_status, status, @@ -33,8 +31,10 @@ final as ( tracking_number, tracking_numbers, tracking_urls, - updated_at - + created_at, + updated_at, + _fivetran_synced + from fields ) diff --git a/models/stg_shopify__fulfillment_order_line.sql b/models/stg_shopify__fulfillment_order_line.sql new file mode 100644 index 0000000..f9f5272 --- /dev/null +++ b/models/stg_shopify__fulfillment_order_line.sql @@ -0,0 +1,48 @@ +with base as ( + + select * + from {{ ref('stg_shopify__fulfillment_order_line_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__fulfillment_order_line_tmp')), + staging_columns=get_fulfillment_order_line_columns() + ) + }} + from base +), + +final as ( + + select -- may remove this model + _fivetran_synced, + fulfillable_quantity, + fulfillment_id, + fulfillment_service, + gift_card, + grams, + name, + order_id, + order_line_id, + price, + price_set, + product_id, + properties, + property_pre_order_date, + quantity, + requires_shipping, + sku, + taxable, + title, + variant_id, + variant_title, + vendor + from fields +) + +select * +from final diff --git a/models/stg_shopify__inventory_item.sql b/models/stg_shopify__inventory_item.sql index fc5b42e..eb76573 100644 --- a/models/stg_shopify__inventory_item.sql +++ b/models/stg_shopify__inventory_item.sql @@ -20,17 +20,17 @@ fields as ( final as ( select + id as inventory_item_id, + sku, _fivetran_deleted as is_deleted, -- won't filter out for now - _fivetran_synced, cost, country_code_of_origin, - created_at, - id as inventory_item_id, province_code_of_origin, - requires_shipping as as does_require_shipping, - sku, + requires_shipping as does_require_shipping, tracked as is_inventory_quantity_tracked, - updated_at + created_at, + updated_at, + _fivetran_synced from fields ) diff --git a/models/stg_shopify__inventory_level.sql b/models/stg_shopify__inventory_level.sql index b661ee7..3c7a2b0 100644 --- a/models/stg_shopify__inventory_level.sql +++ b/models/stg_shopify__inventory_level.sql @@ -20,11 +20,11 @@ fields as ( final as ( select - _fivetran_synced, - available as available_quantity, inventory_item_id, location_id, - updated_at + available as available_quantity, + updated_at, + _fivetran_synced from fields ) diff --git a/models/stg_shopify__location.sql b/models/stg_shopify__location.sql index 7f15082..68e1770 100644 --- a/models/stg_shopify__location.sql +++ b/models/stg_shopify__location.sql @@ -20,25 +20,25 @@ fields as ( final as ( select + id as location_id, + name, _fivetran_deleted as is_deleted, - _fivetran_synced, active as is_active, address_1, address_2, city, coalesce(country_code, country) as country_code, country_name, - created_at, - id as location_id, legacy as is_legacy, localized_country_name, localized_province_name, - name, phone, province, province_code, + zip, + created_at, updated_at, - zip + _fivetran_synced from fields ) diff --git a/models/stg_shopify__metafield.sql b/models/stg_shopify__metafield.sql index 8405ce0..951ed7f 100644 --- a/models/stg_shopify__metafield.sql +++ b/models/stg_shopify__metafield.sql @@ -20,17 +20,17 @@ fields as ( final as ( select - fivetran_synced, - created_at, - description, id as metafield_id, - key, + description, namespace, + key, + value, + lower(coalesce(type, value_type)) as value_type, owner_id as owner_resource_id, owner_resource, - lower(coalesce(type, value_type)) as value_type, + created_at, updated_at, - value + _fivetran_synced from fields ) diff --git a/models/stg_shopify__order_note_attribute.sql b/models/stg_shopify__order_note_attribute.sql index ed7c407..52fbe14 100644 --- a/models/stg_shopify__order_note_attribute.sql +++ b/models/stg_shopify__order_note_attribute.sql @@ -20,15 +20,11 @@ fields as ( final as ( select -22:57:29 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.ad_reporting -- models.netsuite - -22:57:32 _fivetran_synced, - name, order_id, - value + name, + value, + _fivetran_synced + from fields ) diff --git a/models/stg_shopify__order_shipping_line.sql b/models/stg_shopify__order_shipping_line.sql index 40ae4fe..57a573b 100644 --- a/models/stg_shopify__order_shipping_line.sql +++ b/models/stg_shopify__order_shipping_line.sql @@ -20,25 +20,21 @@ fields as ( final as ( select -22:57:34 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting - -22:57:37 _fivetran_synced, + id as order_shipping_line_id, + order_id, carrier_identifier, code, delivery_category, discounted_price, discounted_price_set, - id, - order_id, phone, price, price_set, - requested_fulfillment_service_id, + requested_fulfillment_service_id is not null as is_third_party_required, source, - title + title, + _fivetran_synced + from fields ) diff --git a/models/stg_shopify__order_shipping_tax_line.sql b/models/stg_shopify__order_shipping_tax_line.sql index c44e891..17ad21c 100644 --- a/models/stg_shopify__order_shipping_tax_line.sql +++ b/models/stg_shopify__order_shipping_tax_line.sql @@ -20,18 +20,14 @@ fields as ( final as ( select -22:57:40 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting - -22:57:43 _fivetran_synced, - index, order_shipping_line_id, + index, price, price_set, rate, - title + title, + _fivetran_synced + from fields ) diff --git a/models/stg_shopify__order_tag.sql b/models/stg_shopify__order_tag.sql index fe857f3..d579485 100644 --- a/models/stg_shopify__order_tag.sql +++ b/models/stg_shopify__order_tag.sql @@ -20,15 +20,11 @@ fields as ( final as ( select -22:58:37 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.ad_reporting -- models.netsuite - -22:58:40 _fivetran_synced, - index, order_id, - value + index, + value, + _fivetran_synced, + from fields ) diff --git a/models/stg_shopify__order_url_tag.sql b/models/stg_shopify__order_url_tag.sql index b36d6c8..1b2dc33 100644 --- a/models/stg_shopify__order_url_tag.sql +++ b/models/stg_shopify__order_url_tag.sql @@ -20,15 +20,11 @@ fields as ( final as ( select -22:58:42 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting - -22:58:45 _fivetran_synced, + _fivetran_synced, key, order_id, value + from fields ) diff --git a/models/stg_shopify__price_rule.sql b/models/stg_shopify__price_rule.sql index 38a5d5c..135fa6b 100644 --- a/models/stg_shopify__price_rule.sql +++ b/models/stg_shopify__price_rule.sql @@ -19,14 +19,11 @@ fields as ( final as ( - select - _fivetran_synced, + select + id as price_rule_id, allocation_limit, allocation_method, - created_at, customer_selection, - ends_at, - id as price_rule_id, once_per_customer as is_once_per_customer, prerequisite_quantity_range as prereq_min_quantity, prerequisite_shipping_price_range as prereq_max_shipping_price, @@ -34,15 +31,18 @@ final as ( prerequisite_to_entitlement_purchase_prerequisite_amount as prereq_min_purchase_quantity_for_entitlement, quantity_ratio_entitled_quantity as prereq_buy_x_get_this, quantity_ratio_prerequisite_quantity as prereq_buy_this_get_y, - starts_at, target_selection, target_type, title, - updated_at, usage_limit, value, - value_type - + value_type, + starts_at, + ends_at, + created_at, + updated_at, + _fivetran_synced + from fields ) diff --git a/models/stg_shopify__product_image.sql b/models/stg_shopify__product_image.sql index a6d3d63..4df21fe 100644 --- a/models/stg_shopify__product_image.sql +++ b/models/stg_shopify__product_image.sql @@ -20,25 +20,19 @@ fields as ( final as ( select -22:57:56 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting - -22:57:59 _fivetran_deleted, - _fivetran_synced, - alt, - created_at, + id as product_image_id, + product_id, height, - id, - is_default, position, - product_id, src, - updated_at, variant_ids, - width + width, + created_at, + updated_at, + _fivetran_synced + from fields + where not coalesce(_fivetran_deleted, false) ) select * diff --git a/models/stg_shopify__product_tag.sql b/models/stg_shopify__product_tag.sql index f5154d2..6438189 100644 --- a/models/stg_shopify__product_tag.sql +++ b/models/stg_shopify__product_tag.sql @@ -20,15 +20,11 @@ fields as ( final as ( select -22:58:47 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.ad_reporting -- models.netsuite - -22:58:50 _fivetran_synced, - index, product_id, - value + index, + value, + _fivetran_synced + from fields ) diff --git a/models/stg_shopify__shop.sql b/models/stg_shopify__shop.sql index 2291be9..2385407 100644 --- a/models/stg_shopify__shop.sql +++ b/models/stg_shopify__shop.sql @@ -20,68 +20,59 @@ fields as ( final as ( select -22:57:14 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.ad_reporting -- models.netsuite - -22:57:17 _fivetran_deleted, - _fivetran_synced, + id as shop_id, + name, + _fivetran_deleted as is_deleted, address_1, address_2, - auto_configure_tax_inclusivity, - checkout_api_supported, city, - cookie_consent_level, + province, + province_code, country, country_code, country_name, - county_taxes, - created_at, + zip, + latitude, + longitude, + ifnull(county_taxes, false) as has_county_taxes, currency, + enabled_presentment_currencies, customer_email, - domain, - eligible_for_card_reader_giveaway, - eligible_for_payments, email, - enabled_presentment_currencies, - force_ssl, - google_apps_domain, - google_apps_login_enabled, + domain, + phone, + timezone, + iana_timezone, + primary_locale, + weight_unit, + myshopify_domain, + cookie_consent_level, + shop_owner as shop_owner, + source, + tax_shipping as has_shipping_taxes, + ifnull(taxes_included, false) as has_taxes_included_in_price, has_discounts, has_gift_cards, has_storefront, - iana_timezone, - id, - latitude, - longitude, + checkout_api_supported as has_checkout_api_supported, + eligible_for_card_reader_giveaway as is_eligible_for_card_reader_giveaway, + eligible_for_payments as is_eligible_for_payments, + google_apps_domain, + ifnull(google_apps_login_enabled, false) as is_google_apps_login_enabled, money_format, money_in_emails_format, money_with_currency_format, money_with_currency_in_emails_format, - multi_location_enabled, - myshopify_domain, - name, - password_enabled, - phone, plan_display_name, plan_name, - pre_launch_enabled, - primary_locale, - primary_location_id, - province, - province_code, - requires_extra_payments_agreement, - setup_required, - shop_owner, - source, - tax_shipping, - taxes_included, - timezone, + password_enabled as is_password_enabled, + pre_launch_enabled as is_pre_launch_enabled, + requires_extra_payments_agreement as does_require_extra_payments_agreement, + setup_required as is_setup_required, + created_at, updated_at, - visitor_tracking_consent_preference, - weight_unit, - zip + _fivetran_synced + from fields ) diff --git a/models/stg_shopify__tender_transaction.sql b/models/stg_shopify__tender_transaction.sql index 089cb52..04f6738 100644 --- a/models/stg_shopify__tender_transaction.sql +++ b/models/stg_shopify__tender_transaction.sql @@ -20,24 +20,18 @@ fields as ( final as ( select -22:57:19 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. -There are 2 unused configuration paths: -- models.netsuite -- models.ad_reporting - -22:57:22 _fivetran_synced, + id as transaction_id, + order_id, amount, currency, - id, - order_id, - payment_details_credit_card_company, - payment_details_credit_card_number, payment_method, - processed_at, remote_reference, - test, - user_id + user_id, + processed_at, + _fivetran_synced, + from fields + where not coalesce(test, false) ) select * diff --git a/models/tmp/stg_shopify__abandoned_checkout_discount_code_tmp.sql b/models/tmp/stg_shopify__abandoned_checkout_discount_code_tmp.sql new file mode 100644 index 0000000..a3a7027 --- /dev/null +++ b/models/tmp/stg_shopify__abandoned_checkout_discount_code_tmp.sql @@ -0,0 +1,12 @@ +{{ + fivetran_utils.union_data( + table_identifier='abandoned_checkout_discount_code', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='abandoned_checkout_discount_code_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__abandoned_checkout_tmp.sql b/models/tmp/stg_shopify__abandoned_checkout_tmp.sql index e16cffc..611a7be 100644 --- a/models/tmp/stg_shopify__abandoned_checkout_tmp.sql +++ b/models/tmp/stg_shopify__abandoned_checkout_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('abandoned_checkout') }} +{{ + fivetran_utils.union_data( + table_identifier='abandoned_checkout', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='abandoned_checkout_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__collection_product_tmp.sql b/models/tmp/stg_shopify__collection_product_tmp.sql index 7c9485c..e44e4d5 100644 --- a/models/tmp/stg_shopify__collection_product_tmp.sql +++ b/models/tmp/stg_shopify__collection_product_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('collection_product') }} +{{ + fivetran_utils.union_data( + table_identifier='collection_product', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='collection_product_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__collection_tmp.sql b/models/tmp/stg_shopify__collection_tmp.sql index 51ff8ac..f383fa3 100644 --- a/models/tmp/stg_shopify__collection_tmp.sql +++ b/models/tmp/stg_shopify__collection_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('collection') }} +{{ + fivetran_utils.union_data( + table_identifier='collection', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='collection_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__customer_tag_tmp.sql b/models/tmp/stg_shopify__customer_tag_tmp.sql index f14ca7b..cbb8568 100644 --- a/models/tmp/stg_shopify__customer_tag_tmp.sql +++ b/models/tmp/stg_shopify__customer_tag_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('customer_tag') }} +{{ + fivetran_utils.union_data( + table_identifier='customer_tag', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='customer_tag_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__discount_code_tmp.sql b/models/tmp/stg_shopify__discount_code_tmp.sql index 78cffc4..d59b6af 100644 --- a/models/tmp/stg_shopify__discount_code_tmp.sql +++ b/models/tmp/stg_shopify__discount_code_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('discount_code') }} +{{ + fivetran_utils.union_data( + table_identifier='discount_code', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='discount_code_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__fulfillment_order_line_tmp.sql b/models/tmp/stg_shopify__fulfillment_order_line_tmp.sql new file mode 100644 index 0000000..3b0c0f5 --- /dev/null +++ b/models/tmp/stg_shopify__fulfillment_order_line_tmp.sql @@ -0,0 +1,12 @@ +{{ + fivetran_utils.union_data( + table_identifier='fulfillment_order_line', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='fulfillment_order_line_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__fulfillment_tmp.sql b/models/tmp/stg_shopify__fulfillment_tmp.sql index 6432463..ed0ad78 100644 --- a/models/tmp/stg_shopify__fulfillment_tmp.sql +++ b/models/tmp/stg_shopify__fulfillment_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('fulfillment') }} +{{ + fivetran_utils.union_data( + table_identifier='fulfillment', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='fulfillment_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__inventory_item_tmp.sql b/models/tmp/stg_shopify__inventory_item_tmp.sql index ab0e4eb..10e7519 100644 --- a/models/tmp/stg_shopify__inventory_item_tmp.sql +++ b/models/tmp/stg_shopify__inventory_item_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('inventory_item') }} +{{ + fivetran_utils.union_data( + table_identifier='inventory_item', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='inventory_item_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__inventory_level_tmp.sql b/models/tmp/stg_shopify__inventory_level_tmp.sql index 5438e2f..55679d1 100644 --- a/models/tmp/stg_shopify__inventory_level_tmp.sql +++ b/models/tmp/stg_shopify__inventory_level_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('inventory_level') }} +{{ + fivetran_utils.union_data( + table_identifier='inventory_level', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='inventory_level_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__location_tmp.sql b/models/tmp/stg_shopify__location_tmp.sql index 7e7da2d..96da314 100644 --- a/models/tmp/stg_shopify__location_tmp.sql +++ b/models/tmp/stg_shopify__location_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('location') }} +{{ + fivetran_utils.union_data( + table_identifier='location', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='location_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__metafield_tmp.sql b/models/tmp/stg_shopify__metafield_tmp.sql index af5da85..d1f0beb 100644 --- a/models/tmp/stg_shopify__metafield_tmp.sql +++ b/models/tmp/stg_shopify__metafield_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('metafield') }} +{{ + fivetran_utils.union_data( + table_identifier='metafield', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='metafield_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__order_note_attribute_tmp.sql b/models/tmp/stg_shopify__order_note_attribute_tmp.sql index 0634e8f..4f96e75 100644 --- a/models/tmp/stg_shopify__order_note_attribute_tmp.sql +++ b/models/tmp/stg_shopify__order_note_attribute_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('order_note_attribute') }} +{{ + fivetran_utils.union_data( + table_identifier='order_note_attribute', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='order_note_attribute_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__order_shipping_line_tmp.sql b/models/tmp/stg_shopify__order_shipping_line_tmp.sql index ec27a5f..7c5be03 100644 --- a/models/tmp/stg_shopify__order_shipping_line_tmp.sql +++ b/models/tmp/stg_shopify__order_shipping_line_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('order_shipping_line') }} +{{ + fivetran_utils.union_data( + table_identifier='order_shipping_line', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='order_shipping_line_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__order_shipping_tax_line_tmp.sql b/models/tmp/stg_shopify__order_shipping_tax_line_tmp.sql index 1b0746e..95ebf74 100644 --- a/models/tmp/stg_shopify__order_shipping_tax_line_tmp.sql +++ b/models/tmp/stg_shopify__order_shipping_tax_line_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('order_shipping_tax_line') }} +{{ + fivetran_utils.union_data( + table_identifier='order_shipping_tax_line', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='order_shipping_tax_line_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__order_tag_tmp.sql b/models/tmp/stg_shopify__order_tag_tmp.sql index e5a918d..8e1d3b9 100644 --- a/models/tmp/stg_shopify__order_tag_tmp.sql +++ b/models/tmp/stg_shopify__order_tag_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('order_tag') }} +{{ + fivetran_utils.union_data( + table_identifier='order_tag', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='order_tag_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__order_url_tag_tmp.sql b/models/tmp/stg_shopify__order_url_tag_tmp.sql index 56fa477..ae41b1e 100644 --- a/models/tmp/stg_shopify__order_url_tag_tmp.sql +++ b/models/tmp/stg_shopify__order_url_tag_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('order_url_tag') }} +{{ + fivetran_utils.union_data( + table_identifier='order_url_tag', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='order_url_tag_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__price_rule_tmp.sql b/models/tmp/stg_shopify__price_rule_tmp.sql index d3349bd..79c113f 100644 --- a/models/tmp/stg_shopify__price_rule_tmp.sql +++ b/models/tmp/stg_shopify__price_rule_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('price_rule') }} +{{ + fivetran_utils.union_data( + table_identifier='price_rule', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='price_rule_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__product_image_tmp.sql b/models/tmp/stg_shopify__product_image_tmp.sql index 22f969c..10bcdc8 100644 --- a/models/tmp/stg_shopify__product_image_tmp.sql +++ b/models/tmp/stg_shopify__product_image_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('product_image') }} +{{ + fivetran_utils.union_data( + table_identifier='product_image', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='product_image_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__product_tag_tmp.sql b/models/tmp/stg_shopify__product_tag_tmp.sql index d08bbbb..eb8e720 100644 --- a/models/tmp/stg_shopify__product_tag_tmp.sql +++ b/models/tmp/stg_shopify__product_tag_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('product_tag') }} +{{ + fivetran_utils.union_data( + table_identifier='product_tag', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='product_tag_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__shop_tmp.sql b/models/tmp/stg_shopify__shop_tmp.sql index c04677c..8237a34 100644 --- a/models/tmp/stg_shopify__shop_tmp.sql +++ b/models/tmp/stg_shopify__shop_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('shop') }} +{{ + fivetran_utils.union_data( + table_identifier='shop', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='shop_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file diff --git a/models/tmp/stg_shopify__tender_transaction_tmp.sql b/models/tmp/stg_shopify__tender_transaction_tmp.sql index f4938a3..6652097 100644 --- a/models/tmp/stg_shopify__tender_transaction_tmp.sql +++ b/models/tmp/stg_shopify__tender_transaction_tmp.sql @@ -1,2 +1,12 @@ -select * -from {{ var('tender_transaction') }} +{{ + fivetran_utils.union_data( + table_identifier='tender_transaction', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='tender_transaction_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file From fdf98224be2f89d36d682f6ae5fd0482921901f2 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 7 Dec 2022 15:50:13 -0800 Subject: [PATCH 026/137] docs --- dbt_project.yml | 4 +- integration_tests/dbt_project.yml | 24 +- .../shopify_ order_note_attribute_data.csv | 6 + .../seeds/shopify_abandoned_checkout_data.csv | 4 + ..._abandoned_checkout_discount_code_data.csv | 4 + .../seeds/shopify_collection_data.csv | 4 + .../seeds/shopify_collection_product_data.csv | 4 + .../seeds/shopify_customer_tag_data.csv | 4 + .../seeds/shopify_discount_code_data.csv | 4 + .../seeds/shopify_fulfillment_data.csv | 4 + .../seeds/shopify_inventory_item_data.csv | 4 + .../seeds/shopify_inventory_level_data.csv | 4 + .../seeds/shopify_location_data.csv | 3 + .../seeds/shopify_metafield_data.csv | 6 + .../shopify_order_discount_code_data.csv | 4 + .../shopify_order_shipping_line_data.csv | 4 + .../shopify_order_shipping_tax_line_data.csv | 4 + .../seeds/shopify_order_tag_data.csv | 4 + .../seeds/shopify_order_url_tag_data.csv | 4 + .../seeds/shopify_price_rule_data.csv | 4 + .../seeds/shopify_product_image_data.csv | 4 + .../seeds/shopify_product_tag_data.csv | 6 + integration_tests/seeds/shopify_shop_data.csv | 2 + .../seeds/shopify_tender_transaction_data.csv | 6 + macros/get_fulfillment_order_line_columns.sql | 30 - macros/get_order_discount_code_columns.sql | 14 + models/src_shopify.yml | 42 +- models/stg_shopify.yml | 769 ++++++++++++++++++ models/stg_shopify__collection.sql | 6 +- models/stg_shopify__collection_product.sql | 4 +- .../stg_shopify__fulfillment_order_line.sql | 48 -- models/stg_shopify__inventory_item.sql | 2 +- models/stg_shopify__location.sql | 3 +- models/stg_shopify__order_discount_code.sql | 34 + ... stg_shopify__order_discount_code_tmp.sql} | 4 +- 35 files changed, 960 insertions(+), 117 deletions(-) create mode 100644 integration_tests/seeds/shopify_ order_note_attribute_data.csv create mode 100644 integration_tests/seeds/shopify_abandoned_checkout_data.csv create mode 100644 integration_tests/seeds/shopify_abandoned_checkout_discount_code_data.csv create mode 100644 integration_tests/seeds/shopify_collection_data.csv create mode 100644 integration_tests/seeds/shopify_collection_product_data.csv create mode 100644 integration_tests/seeds/shopify_customer_tag_data.csv create mode 100644 integration_tests/seeds/shopify_discount_code_data.csv create mode 100644 integration_tests/seeds/shopify_fulfillment_data.csv create mode 100644 integration_tests/seeds/shopify_inventory_item_data.csv create mode 100644 integration_tests/seeds/shopify_inventory_level_data.csv create mode 100644 integration_tests/seeds/shopify_location_data.csv create mode 100644 integration_tests/seeds/shopify_metafield_data.csv create mode 100644 integration_tests/seeds/shopify_order_discount_code_data.csv create mode 100644 integration_tests/seeds/shopify_order_shipping_line_data.csv create mode 100644 integration_tests/seeds/shopify_order_shipping_tax_line_data.csv create mode 100644 integration_tests/seeds/shopify_order_tag_data.csv create mode 100644 integration_tests/seeds/shopify_order_url_tag_data.csv create mode 100644 integration_tests/seeds/shopify_price_rule_data.csv create mode 100644 integration_tests/seeds/shopify_product_image_data.csv create mode 100644 integration_tests/seeds/shopify_product_tag_data.csv create mode 100644 integration_tests/seeds/shopify_shop_data.csv create mode 100644 integration_tests/seeds/shopify_tender_transaction_data.csv delete mode 100644 macros/get_fulfillment_order_line_columns.sql create mode 100644 macros/get_order_discount_code_columns.sql delete mode 100644 models/stg_shopify__fulfillment_order_line.sql create mode 100644 models/stg_shopify__order_discount_code.sql rename models/tmp/{stg_shopify__fulfillment_order_line_tmp.sql => stg_shopify__order_discount_code_tmp.sql} (74%) diff --git a/dbt_project.yml b/dbt_project.yml index 646ca23..b3876f6 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -41,8 +41,8 @@ vars: shop_source: "{{ source('shopify','shop') }}" tender_transaction_source: "{{ source('shopify','tender_transaction') }}" abandoned_checkout_discount_code_source: "{{ source('shopify','abandoned_checkout_discount_code') }}" - fulfillment_order_line_source: "{{ source('shopify','fulfillment_order_line') }}" - + order_discount_code_source: "{{ source('shopify','order_discount_code') }}" + customer_pass_through_columns: [] order_line_refund_pass_through_columns: [] order_line_pass_through_columns: [] diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index ccf73d1..0c47500 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -81,4 +81,26 @@ seeds: id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}" order_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}" user_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}" - + shopify_abandoned_checkout_discount_code_data: + +column_types: + amount: float + shopify_abandoned_checkout_data: + +column_types: + total_line_items_price: float + shopify_discount_code_data: + +column_types: + usage_count: float + shopify_order_discount_code_data: + +column_types: + amount: float + shopify_order_shipping_tax_line_data: + +column_types: + price: float + shopify_order_shipping_line_data: + +column_types: + discounted_price: float + price: float + shopify_price_rule_data: + +column_types: + prerequisite_subtotal_range: float + value: float \ No newline at end of file diff --git a/integration_tests/seeds/shopify_ order_note_attribute_data.csv b/integration_tests/seeds/shopify_ order_note_attribute_data.csv new file mode 100644 index 0000000..edd6851 --- /dev/null +++ b/integration_tests/seeds/shopify_ order_note_attribute_data.csv @@ -0,0 +1,6 @@ +name,order_id,_fivetran_synced,value +last_name,41234171115,2022-11-19 07:30:28.480000,"""1418143823.1643992155""" +first_name,41234171115,2022-11-19 07:30:28.480000,"""fb.1.1643992155109.1110590605""" +updated_at,41234171115,2022-11-19 07:30:28.480000,"""1643992163253""" +clientID,41234171115,2022-11-19 07:30:28.480000,"""a03d3118-4048-4159-b5bb-1b90d8abb69b""" +name,41234171115,2022-11-19 07:30:28.480000,"""22707603636395""" \ No newline at end of file diff --git a/integration_tests/seeds/shopify_abandoned_checkout_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_data.csv new file mode 100644 index 0000000..af790e4 --- /dev/null +++ b/integration_tests/seeds/shopify_abandoned_checkout_data.csv @@ -0,0 +1,4 @@ +id,_fivetran_synced,abandoned_checkout_url,applied_discount_amount,applied_discount_applicable,applied_discount_description,applied_discount_non_applicable_reason,applied_discount_title,applied_discount_value,applied_discount_value_type,billing_address_address_1,billing_address_address_0,billing_address_city,billing_address_company,billing_address_country,billing_address_country_code,billing_address_first_name,billing_address_last_name,billing_address_latitude,billing_address_longitude,billing_address_name,billing_address_phone,billing_address_province,billing_address_province_code,billing_address_zip,buyer_accepts_marketing,cart_token,closed_at,completed_at,created_at,credit_card_first_name,credit_card_last_name,credit_card_month,credit_card_number,credit_card_verification_value,credit_card_year,currency,customer_id,customer_locale,device_id,email,gateway,landing_site_base_url,location_id,name,note,phone,referring_site,shipping_address_address_1,shipping_address_address_0,shipping_address_city,shipping_address_company,shipping_address_country,shipping_address_country_code,shipping_address_first_name,shipping_address_last_name,shipping_address_latitude,shipping_address_longitude,shipping_address_name,shipping_address_phone,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_line,shipping_rate_id,shipping_rate_price,shipping_rate_title,source,source_identifier,source_name,source_url,subtotal_price,taxes_included,token,total_discounts,total_line_items_price,total_price,total_tax,total_weight,updated_at,user_id,note_attribute_littledata_updated_at,note_attribute_segment_client_id,billing_address_id,billing_address_is_default,presentment_currency,shipping_address_id,shipping_address_is_default,total_duties,note_attribute_email_client_id,note_attributes,note_attribute_google_client_id,_fivetran_deleted +10160311112111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,110f5eb2fd1d11211311311622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,1101311111121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311112111,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.1115111,-26.1126062,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda125a10cca513162f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, +13051511101311,2020-01-11 06:01:35.021111,https://kitties.com/1111311610/checkouts/6661ff02165dfd11b12db112f0111226/recover?key=51611efdff11e0caccc0fd30b0e1e202,,,,,,,,village,Apt 0,daytona Beach,,Florida,US,ohio,Calles,1.126113511111111,-21.502661,hi,+50266111110,Healdsburg,PA-11,,false,611faa630ce5e6bcc0bacc2a105c0126,,,2020-05-11 01:01:30.111111,,,,,,,USD,3021350266525,en,,hyrehher@gmail.com,,/collections/sale,,#13051511101311,,,https://www.google.com/,123 main st,Pty 3,ghreiuhtg,,United States,US,ohio,Calle pty115,,,ohio Calle pty115,+12161115152,Florida,FL,33120,,,,,,,web,,10.35,false,6661ff02165dfd11b12db112f0111226,16.65,111.0,10.35,1.0,1,2020-05-11 01:06:35.111111,,,,,,,,,,,,, +11151102066531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,1110c010361e1d11a0d613f3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,1620110310363,en,,hernebbe@hr.com,,/collections/new,,#11151102066531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,1abddd111c0211f1e616ec0d0c32021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,1613121625150,610a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_abandoned_checkout_discount_code_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_discount_code_data.csv new file mode 100644 index 0000000..ccc5f56 --- /dev/null +++ b/integration_tests/seeds/shopify_abandoned_checkout_discount_code_data.csv @@ -0,0 +1,4 @@ +checkout_id,index,_fivetran_synced,amount,discount_id,code,created_at,type,updated_at,usage_count +12451602901163,0,2022-12-07 06:49:37.929000,0.0,,CYBER12,,percentage,, +24353554334827,0,2022-12-07 06:49:37.926000,0.0,,CYBER12,,percentage,, +24391234566403,0,2022-12-07 06:49:33.182000,0.0,,BONUS,,percentage,, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_collection_data.csv b/integration_tests/seeds/shopify_collection_data.csv new file mode 100644 index 0000000..85cd722 --- /dev/null +++ b/integration_tests/seeds/shopify_collection_data.csv @@ -0,0 +1,4 @@ +id,_fivetran_deleted,_fivetran_synced,handle,published_at,published_scope,title,updated_at,disjunctive,rules,sort_order,template_suffix,body_html +23999997355,true,2021-09-01 05:53:25.838000,,,,,1970-01-01 00:00:00.000000,,,,, +23599930779,true,2021-09-01 05:53:26.673000,,,,,1970-01-01 00:00:00.000000,,,,, +23454599967,true,2022-04-08 06:52:19.524000,,,,,1970-01-01 00:00:00.000000,,,,, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_collection_product_data.csv b/integration_tests/seeds/shopify_collection_product_data.csv new file mode 100644 index 0000000..c35cd72 --- /dev/null +++ b/integration_tests/seeds/shopify_collection_product_data.csv @@ -0,0 +1,4 @@ +collection_id,product_id,_fivetran_synced +129999037124,7000164489131,2022-11-18 21:32:43.188000 +129999037124,72384654353899,2022-11-18 21:32:43.188000 +129999037124,7244664618891,2022-11-18 21:32:43.188000 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_customer_tag_data.csv b/integration_tests/seeds/shopify_customer_tag_data.csv new file mode 100644 index 0000000..55c9a2f --- /dev/null +++ b/integration_tests/seeds/shopify_customer_tag_data.csv @@ -0,0 +1,4 @@ +customer_id,index,_fivetran_synced,value +18999779919268,1,2022-12-03 06:49:03.314000,GGPP +18037777794404,1,2022-12-03 06:48:53.295000,GGPP +18055555509188,1,2022-12-03 06:48:55.067000,GGPP \ No newline at end of file diff --git a/integration_tests/seeds/shopify_discount_code_data.csv b/integration_tests/seeds/shopify_discount_code_data.csv new file mode 100644 index 0000000..17924da --- /dev/null +++ b/integration_tests/seeds/shopify_discount_code_data.csv @@ -0,0 +1,4 @@ +id,_fivetran_synced,code,created_at,price_rule_id,updated_at,usage_count +45656764773499,2021-12-10 07:04:44.670000,CHECKVB34DDBQ3VH,2021-12-10 06:48:35.000000,126331232543,2021-12-10 06:48:35.000000,0.0 +12345630436267,2021-12-10 07:04:44.670000,CHECKVBLJG22DDD,2021-12-10 06:48:35.000000,126331232543,2021-12-10 06:48:35.000000,0.0 +12345667469035,2021-12-10 07:04:44.670000,CHECKV44CCCBCWB7,2021-12-10 06:48:35.000000,126331232543,2021-12-10 06:48:35.000000,0.0 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_fulfillment_data.csv b/integration_tests/seeds/shopify_fulfillment_data.csv new file mode 100644 index 0000000..ac536b1 --- /dev/null +++ b/integration_tests/seeds/shopify_fulfillment_data.csv @@ -0,0 +1,4 @@ +id,_fivetran_synced,created_at,location_id,order_id,status,tracking_company,tracking_number,updated_at,tracking_numbers,tracking_urls,shipment_status,service,name,receipt_authorization +1172342423844,2022-11-22 08:06:32.902000,2019-07-13 01:17:22.000000,12334444548,12744443728100,success,,,2019-07-13 01:17:22.000000,[],[],,manual,#151212.1, +1174444448308,2022-11-22 08:06:33.863000,2019-07-13 01:17:21.000000,12334444548,12744443662564,success,,,2019-07-13 01:17:22.000000,[],[],,manual,#152317.1, +11755555548932,2022-11-22 08:06:56.262000,2019-07-13 01:17:21.000000,12334444548,1274944444884,success,,,2019-07-13 01:17:21.000000,[],[],,manual,#1555923.1, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_inventory_item_data.csv b/integration_tests/seeds/shopify_inventory_item_data.csv new file mode 100644 index 0000000..5c9e242 --- /dev/null +++ b/integration_tests/seeds/shopify_inventory_item_data.csv @@ -0,0 +1,4 @@ +id,_fivetran_synced,cost,created_at,requires_shipping,sku,tracked,updated_at,country_code_of_origin,province_code_of_origin,_fivetran_deleted +4292304555,2021-12-18 06:56:22.877000,,,,,,,,,true +436501419,2022-02-25 06:52:29.767000,,,,,,,,,true +43650851179,2022-02-24 06:52:33.361000,,,,,,,,,true \ No newline at end of file diff --git a/integration_tests/seeds/shopify_inventory_level_data.csv b/integration_tests/seeds/shopify_inventory_level_data.csv new file mode 100644 index 0000000..a7b984c --- /dev/null +++ b/integration_tests/seeds/shopify_inventory_level_data.csv @@ -0,0 +1,4 @@ +inventory_item_id,location_id,_fivetran_synced,available,updated_at +4301780939,28664987748,2021-11-13 08:02:21.760000,, +43017806027,28664987748,2021-11-13 08:02:21.760000,, +432407515,28664987748,2021-11-06 08:04:16.213000,, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_location_data.csv b/integration_tests/seeds/shopify_location_data.csv new file mode 100644 index 0000000..a413cfb --- /dev/null +++ b/integration_tests/seeds/shopify_location_data.csv @@ -0,0 +1,3 @@ +id,_fivetran_synced,active,address_1,address_2,city,country,created_at,legacy,name,phone,province,updated_at,zip,country_code,country_name,localized_country_name,localized_province_name,province_code,_fivetran_deleted +28698777748,2022-12-07 06:43:31.005000,true,,,,US,2019-06-11 15:58:20.000000,true,Plum,,,2019-06-11 15:58:20.000000,,US,United States,United States,,,false +12932577748,2022-12-07 06:43:31.005000,true,111 Tree Road,,Tree,US,2018-12-10 16:24:07.000000,false,Plum Express,,NY,2019-05-16 13:37:39.000000,07394,US,United States,United States,New Yorl,NY,false \ No newline at end of file diff --git a/integration_tests/seeds/shopify_metafield_data.csv b/integration_tests/seeds/shopify_metafield_data.csv new file mode 100644 index 0000000..8aebd35 --- /dev/null +++ b/integration_tests/seeds/shopify_metafield_data.csv @@ -0,0 +1,6 @@ +id,_fivetran_synced,created_at,description,key,namespace,owner_id,owner_resource,updated_at,value,value_type,type +112253905445055,2022-11-19 10:06:09.531000,2019-10-28 20:06:39.000000,,returnAuthorizations,blade_runner,1795760390244,order,2019-10-28 20:06:39.000000,"[{""id"":""ce95-49e4-9daf-41f29bbbb799"",""totalValue"":44444,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":4444,""validReturnItems"":[{""UPC"":""19073825552"",""Quantity"":""1"",""Reason"":""changed-mind"",""LineItem"":""40055558892132""}]},""createdAt"":""2019-10-28T20:06:39.569Z"",""modifiedAt"":""2019-10-28T20:06:39.569Z""}]",,json_string +121264446337647,2022-11-21 01:57:33.851000,2020-06-17 11:35:28.000000,,returnAuthorizations,blade_runner,2259785154671,order,2020-06-17 11:35:28.000000,"[{""id"":""557ece73-658b-cf694dcd3f7e"",""totalValue"":4444,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":444.77,""validReturnItems"":[{""UPC"":""19055550468"",""Quantity"":""1"",""Reason"":""fit-issues"",""LineItem"":""4935555579471""}]},""createdAt"":""2020-06-17T11:35:28.469Z"",""modifiedAt"":""2020-06-17T11:35:28.470Z""}]",,json_string +12133380576111,2022-11-21 03:19:59.064000,2020-06-10 18:35:44.000000,,returnAuthorizations,blade_runner,2254001340527,order,2020-06-10 18:35:44.000000,"[{""id"":""e461c20a-9dc7-d38de1c9012a"",""totalValue"":4444,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":444,""validReturnItems"":[{""UPC"":""190735551121"",""Quantity"":""1"",""Reason"":""too-big"",""LineItem"":""4925555231""}]},""createdAt"":""2020-06-10T18:35:44.043Z"",""modifiedAt"":""2020-06-10T18:35:44.043Z""}]",,json_string +12239555241839,2022-11-21 01:29:09.347000,2020-07-15 21:24:16.000000,,returnAuthorizations,blade_runner,2332496625775,order,2020-07-15 21:24:16.000000,"[{""id"":""0c79163e-f55b56f50aff"",""totalValue"":44478.000000000004,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":4444.78000000000003,""validReturnItems"":[{""UPC"":""190555325"",""Quantity"":""1"",""Reason"":""fit-issues"",""LineItem"":""5555599407""}]},""createdAt"":""2020-07-15T21:24:16.210Z"",""modifiedAt"":""2020-07-15T21:24:16.210Z""}]",,json_string +12344252214575,2022-11-21 03:07:20.669000,2020-06-24 17:23:12.000000,,returnAuthorizations,blade_runner,2279364460655,order,2020-06-24 17:23:12.000000,"[{""id"":""3679-4811-94fd-555bf9846753"",""totalValue"":44581,""status"":""BACKEND_GENERATED"",""payload"":{""totalReturnValue"":4444.81,""validReturnItems"":[{""UPC"":""190735558"",""Quantity"":1,""Reason"":""Changed My Mind"",""LineItem"":""455555711""}]},""createdAt"":""2020-06-24T17:23:12.272Z"",""modifiedAt"":""2020-06-24T17:23:12.272Z""}]",,json_string \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_discount_code_data.csv b/integration_tests/seeds/shopify_order_discount_code_data.csv new file mode 100644 index 0000000..8b8417e --- /dev/null +++ b/integration_tests/seeds/shopify_order_discount_code_data.csv @@ -0,0 +1,4 @@ +index,order_id,_fivetran_synced,amount,code,type +1,3685556594347,2022-11-20 08:14:52.957000,11.0,GIFTCARD,percentage +1,420555553483,2022-11-19 11:59:50.040000,0.0,SHIPPING2022,shipping +1,368755535403,2022-11-20 10:22:23.877000,2.0,GIFTCARD,percentage \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_shipping_line_data.csv b/integration_tests/seeds/shopify_order_shipping_line_data.csv new file mode 100644 index 0000000..ebe0fa6 --- /dev/null +++ b/integration_tests/seeds/shopify_order_shipping_line_data.csv @@ -0,0 +1,4 @@ +id,order_id,_fivetran_synced,carrier_identifier,code,delivery_category,discounted_price,phone,price,requested_fulfillment_service_id,source,title,discounted_price_set,price_set +351255554475,415855525355,2022-11-19 14:09:18.923000,,Standard,,0.0,,0.0,,shopify,Standard,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}","{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +355555308651,421550545579,2022-11-19 11:28:21.391000,,Standard,,0.0,,0.0,,shopify,Standard,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}","{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +3465557188139,4555681899,2022-11-19 16:03:15.430000,,Standard,,0.0,,0.0,,shopify,Standard,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}","{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_shipping_tax_line_data.csv b/integration_tests/seeds/shopify_order_shipping_tax_line_data.csv new file mode 100644 index 0000000..0fff36e --- /dev/null +++ b/integration_tests/seeds/shopify_order_shipping_tax_line_data.csv @@ -0,0 +1,4 @@ +index,order_shipping_line_id,_fivetran_synced,price,rate,title,price_set +4,34557773221291,2022-11-19 15:05:15.847000,0.0,0.0,GEIWIHG,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +3,35555106125995,2022-11-19 11:24:24.596000,0.0,0.007,BANANAN,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +3,34777778409131,2022-11-19 16:52:35.685000,0.0,0.01,TOMATO,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_tag_data.csv b/integration_tests/seeds/shopify_order_tag_data.csv new file mode 100644 index 0000000..3090e49 --- /dev/null +++ b/integration_tests/seeds/shopify_order_tag_data.csv @@ -0,0 +1,4 @@ +index,order_id,_fivetran_synced,value +1,46644446411,2022-12-07 06:49:30.307000,#33333 +1,4705555559195,2022-12-07 06:49:26.771000,#22222 +1,4625564155553,2022-12-07 06:49:38.197000,#771222 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_url_tag_data.csv b/integration_tests/seeds/shopify_order_url_tag_data.csv new file mode 100644 index 0000000..00c0977 --- /dev/null +++ b/integration_tests/seeds/shopify_order_url_tag_data.csv @@ -0,0 +1,4 @@ +key,order_id,_fivetran_synced,value +image,47777090347,2022-11-19 10:29:18.624000,Image +utm_medium,4207771090347,2022-11-19 10:29:18.624000,email +prop_channel,4277771090347,2022-11-19 10:29:18.624000,flows \ No newline at end of file diff --git a/integration_tests/seeds/shopify_price_rule_data.csv b/integration_tests/seeds/shopify_price_rule_data.csv new file mode 100644 index 0000000..2583570 --- /dev/null +++ b/integration_tests/seeds/shopify_price_rule_data.csv @@ -0,0 +1,4 @@ +id,_fivetran_synced,allocation_limit,allocation_method,created_at,customer_selection,ends_at,once_per_customer,prerequisite_quantity_range,prerequisite_shipping_price_range,prerequisite_subtotal_range,quantity_ratio_entitled_quantity,quantity_ratio_prerequisite_quantity,starts_at,target_selection,target_type,title,updated_at,usage_limit,value,value_type,prerequisite_to_entitlement_purchase_prerequisite_amount +1111111443,2021-03-22 05:43:56.784000,,across,2021-03-09 18:57:54.000000,all,2021-03-22 07:00:59.000000,false,,,500.0,,,2021-03-17 04:00:57.000000,all,line_item,GIFTCARD,2021-03-22 04:20:03.000000,,0.0,percentage, +66665564075,2021-11-11 07:43:53.706000,,across,2021-11-10 22:26:31.000000,all,2021-11-30 14:00:59.000000,false,,,,,,2021-11-10 22:25:32.000000,entitled,line_item,THANKS,2021-11-10 22:26:31.000000,,0.0,percentage, +6665719339,2021-12-03 06:47:21.433000,,across,2021-11-11 22:38:18.000000,all,2021-12-02 19:00:59.000000,false,,,,,,2021-11-23 21:30:38.000000,all,line_item,THANKS,2021-12-02 19:21:47.000000,,0.0,percentage, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_product_image_data.csv b/integration_tests/seeds/shopify_product_image_data.csv new file mode 100644 index 0000000..2c0d054 --- /dev/null +++ b/integration_tests/seeds/shopify_product_image_data.csv @@ -0,0 +1,4 @@ +id,product_id,_fivetran_deleted,_fivetran_synced,alt,created_at,height,position,src,updated_at,width,is_default,variant_ids +66662814180,34066638804,false,2022-12-01 06:51:36.660000,,2019-06-13 04:06:07.000000,1200,4,https://cdn.shopify.com/s/files/glassess-1784103173.jpg?v=1560398767,2019-06-13 04:06:07.000000,956,false,[] +666652748644,340966648666804,false,2022-12-01 06:51:36.660000,,2019-06-13 04:06:07.000000,1200,2,https://cdn.shopify.com/s/files/1/smile.jpg?v=1560398767,2019-06-13 04:06:07.000000,956,false,[] +666679716,346668486604,false,2022-12-01 06:51:36.660000,,2019-06-13 04:06:07.000000,1200,6,https://cdn.shopify.com/s/files/1/kitten.jpg?v=1560398767,2019-06-13 04:06:07.000000,956,false,"[2755330292,27559733,275597338,275597536,2755931364,2755973,2734989668]" \ No newline at end of file diff --git a/integration_tests/seeds/shopify_product_tag_data.csv b/integration_tests/seeds/shopify_product_tag_data.csv new file mode 100644 index 0000000..b11e5d7 --- /dev/null +++ b/integration_tests/seeds/shopify_product_tag_data.csv @@ -0,0 +1,6 @@ +index,product_id,_fivetran_synced,value +9,1234072132,2022-12-01 06:51:36.480000 UTC,Type: Clothing +5,1234072132,2022-12-01 06:51:36.480000 UTC,Final Sale +7,1234072132,2022-12-01 06:51:36.480000 UTC,Sale +8,1234072132,2022-12-01 06:51:36.480000 UTC,StyleID:nice +3,1234072132,2022-12-01 06:51:36.480000 UTC,Collection: Bottoms \ No newline at end of file diff --git a/integration_tests/seeds/shopify_shop_data.csv b/integration_tests/seeds/shopify_shop_data.csv new file mode 100644 index 0000000..e3bbdb2 --- /dev/null +++ b/integration_tests/seeds/shopify_shop_data.csv @@ -0,0 +1,2 @@ +id,_fivetran_deleted,_fivetran_synced,address_1,address_2,auto_configure_tax_inclusivity,checkout_api_supported,city,cookie_consent_level,country,country_code,country_name,county_taxes,created_at,currency,customer_email,domain,eligible_for_card_reader_giveaway,eligible_for_payments,email,enabled_presentment_currencies,force_ssl,google_apps_domain,google_apps_login_enabled,has_discounts,has_gift_cards,has_storefront,iana_timezone,latitude,longitude,money_format,money_in_emails_format,money_with_currency_format,money_with_currency_in_emails_format,multi_location_enabled,myshopify_domain,name,password_enabled,phone,plan_display_name,plan_name,pre_launch_enabled,primary_locale,primary_location_id,province,province_code,requires_extra_payments_agreement,setup_required,shop_owner,source,tax_shipping,taxes_included,timezone,updated_at,visitor_tracking_consent_preference,weight_unit,zip +1244320689,false,2022-12-07 06:49:41.652000,1 Main Street,200th Floor,,true,New York,implicit,US,US,United States,true,2018-12-10 16:24:00.000000,USD,noreply@kitties.com,kitties.com,true,true,abc@kitties.com,"[""USD""]",true,,,true,true,true,America/New_York,80.1234,-123.12345,${{amount}},${{amount}},${{amount}} USD,${{amount}} USD,true,kitties.myshopify.com,Garrett & Alfredo,false,1233373,Shopify Plus,shopify_plus,false,en,1234646345,New York,NY,false,false,Garrett & Alfredo,,,false,(GMT-05:00) America/New_York,2022-12-07 00:26:36.000000,allow_all,lb,10014 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_tender_transaction_data.csv b/integration_tests/seeds/shopify_tender_transaction_data.csv new file mode 100644 index 0000000..bdaaaed --- /dev/null +++ b/integration_tests/seeds/shopify_tender_transaction_data.csv @@ -0,0 +1,6 @@ +id,_fivetran_synced,amount,currency,order_id,payment_details_credit_card_company,payment_details_credit_card_number,payment_method,processed_at,remote_reference,test,user_id +111179034283,2022-12-01 06:51:34.004000,2895.74,USD,45555950942379,,,other,2022-11-30 18:14:37.000000,,false, +11111905707,2022-12-01 06:51:42.309000,5900.75,USD,455513667243,,,other,2022-12-01 02:00:39.000000,,false, +55553002411,2022-12-01 06:51:29.718000,-164.72,USD,45599755467,,,other,2022-11-30 14:29:13.000000,,false, +4203555179,2022-12-01 06:51:41.198000,5180.19,USD,475559835,,,other,2022-11-30 23:55:45.000000,,false, +111116923,2022-12-01 06:51:42.358000,3004.3,USD,45559563955,,,other,2022-12-01 02:09:47.000000,,false, \ No newline at end of file diff --git a/macros/get_fulfillment_order_line_columns.sql b/macros/get_fulfillment_order_line_columns.sql deleted file mode 100644 index f8ce8ad..0000000 --- a/macros/get_fulfillment_order_line_columns.sql +++ /dev/null @@ -1,30 +0,0 @@ -{% macro get_fulfillment_order_line_columns() %} - -{% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "fulfillable_quantity", "datatype": dbt.type_int()}, - {"name": "fulfillment_id", "datatype": dbt.type_int()}, - {"name": "fulfillment_service", "datatype": dbt.type_string()}, - {"name": "gift_card", "datatype": "boolean"}, - {"name": "grams", "datatype": dbt.type_int()}, - {"name": "name", "datatype": dbt.type_string()}, - {"name": "order_id", "datatype": dbt.type_int()}, - {"name": "order_line_id", "datatype": dbt.type_int()}, - {"name": "price", "datatype": dbt.type_float()}, - {"name": "price_set", "datatype": dbt.type_string()}, - {"name": "product_id", "datatype": dbt.type_int()}, - {"name": "properties", "datatype": dbt.type_string()}, - {"name": "property_pre_order_date", "datatype": dbt.type_string()}, - {"name": "quantity", "datatype": dbt.type_int()}, - {"name": "requires_shipping", "datatype": "boolean"}, - {"name": "sku", "datatype": dbt.type_string()}, - {"name": "taxable", "datatype": "boolean"}, - {"name": "title", "datatype": dbt.type_string()}, - {"name": "variant_id", "datatype": dbt.type_int()}, - {"name": "variant_title", "datatype": dbt.type_string()}, - {"name": "vendor", "datatype": dbt.type_string()} -] %} - -{{ return(columns) }} - -{% endmacro %} diff --git a/macros/get_order_discount_code_columns.sql b/macros/get_order_discount_code_columns.sql new file mode 100644 index 0000000..a64db99 --- /dev/null +++ b/macros/get_order_discount_code_columns.sql @@ -0,0 +1,14 @@ +{% macro get_order_discount_code_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "amount", "datatype": dbt.type_float()}, + {"name": "code", "datatype": dbt.type_string()}, + {"name": "index", "datatype": dbt.type_int()}, + {"name": "order_id", "datatype": dbt.type_int()}, + {"name": "type", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 834de38..2d9123c 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -1171,32 +1171,6 @@ sources: description: Whether the tender transaction is a test transaction. - name: user_id description: The ID of the user logged into the Shopify POS device that processed the tender transaction, if applicable. - - - name: fulfillment_order_line - description: May remove this table TODO. - columns: - - name: _fivetran_synced - - name: fulfillable_quantity - - name: fulfillment_id - - name: fulfillment_service - - name: gift_card - - name: grams - - name: name - - name: order_id - - name: order_line_id - - name: price - - name: price_set - - name: product_id - - name: properties - - name: property_pre_order_date - - name: quantity - - name: requires_shipping - - name: sku - - name: taxable - - name: title - - name: variant_id - - name: variant_title - - name: vendor - name: abandoned_checkout_discount_code description: Abandoned checkouts that applied a discount code. @@ -1218,4 +1192,18 @@ sources: - name: type description: The type of discount. Valid values - percentage, shipping, fixed_amount. (default - fixed_amount) - name: updated_at - description: When the checkout's discount was last updated \ No newline at end of file + description: When the checkout's discount was last updated + + - name: order_discount_code + description: Discount codes placed on orders. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: amount + description: The amount that's deducted from the order total. + - name: code + description: This property returns the discount code that was entered at checkout. Otherwise this property returns the title of the discount that was applied. + - name: order_id + description: Associated order ID. + - name: type + description: The type of discount - `fixed_amount`, `percentage`, or `shipping`. \ No newline at end of file diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index e8c066e..a6890ff 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -482,3 +482,772 @@ models: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" + - name: stg_shopify__abandoned_checkout + description: A checkout is considered abandoned after the customer has added contact information, but before the customer has completed their purchase. + columns: + - name: is_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: abandoned_checkout_url + description: The recovery URL that's sent to a customer so they can recover their checkout. + - name: billing_address_address_1 + description: The street address of the billing address. + - name: billing_address_address_2 + description: An optional additional field for the street address of the billing address. + - name: billing_address_city + description: The city of the billing address. + - name: billing_address_company + description: The company of the person associated with the billing address. + - name: billing_address_country + description: The name of the country of the billing address. + - name: billing_address_country_code + description: The two-letter code (ISO 3166-1 alpha-2 format) for the country of the billing address. + - name: billing_address_first_name + description: The first name of the person associated with the payment method. + - name: billing_address_last_name + description: The last name of the person associated with the payment method. + - name: billing_address_latitude + description: The latitude of the billing address. + - name: billing_address_longitude + description: The longitude of the billing address. + - name: billing_address_name + description: The full name of the person associated with the payment method. + - name: billing_address_phone + description: The phone number at the billing address. + - name: billing_address_province + description: The name of the state or province of the billing address. + - name: billing_address_province_code + description: The two-letter abbreviation of the state or province of the billing address. + - name: billing_address_zip + description: The zip or postal code of the billing address. + - name: has_buyer_accepted_marketing + description: Whether the customer would like to receive email updates from the shop. This is set by the 'I want to receive occasional emails about new products, promotions and other news' checkbox during checkout. + - name: cart_token + description: The ID for the cart that's attached to the checkout. + - name: closed_at + description: The date and time (ISO 8601 format) when the checkout was closed. If the checkout was not closed, then this value is null. + - name: created_at + description: The date and time (ISO 8601 format) when the checkout was created. + - name: shop_currency + description: The three-letter code (ISO 4217 format) of the shop's default currency at the time of checkout. For the currency that the customer used at checkout, see `presentment_currency`. + - name: customer_id + description: ID of the customer with the abandoned checkout. + - name: customer_locale + description: The two or three-letter language code, optionally followed by a region modifier. Example values - en, en-CA. + - name: device_id + description: The ID of the Shopify POS device that created the checkout. + - name: email + description: The customer's email address. + - name: gateway + description: The payment gateway used by the checkout. + - name: checkout_id + description: The ID for the checkout. + - name: landing_site_base_url + description: The URL for the page where the customer entered the shop. + - name: location_id + description: The ID of the physical location where the checkout was processed. + - name: name + description: Checkout order number. + - name: note + description: The text of an optional note that a shop owner can attach to the order. + - name: phone + description: The customer's phone number for receiving SMS notifications. + - name: presentment_currency + description: The three-letter code (ISO 4217 format) of the currency that the customer used at checkout. For the shop's default currency, see `currency`. + - name: referring_site + description: The website that referred the customer to the shop. + - name: shipping_address_address_1 + description: The street address of the shipping address. + - name: shipping_address_address_2 + description: An optional additional field for the street address of the shipping address. + - name: shipping_address_city + description: The city of the shipping address. + - name: shipping_address_company + description: The company of the person associated with the shipping address. + - name: shipping_address_country + description: The name of the country of the shipping address. + - name: shipping_address_country_code + description: The two-letter code (ISO 3166-1 alpha-2 format) for the country of the shipping address. + - name: shipping_address_first_name + description: The first name of the person associated with the shipping address. + - name: shipping_address_last_name + description: The last name of the person associated with the shipping address. + - name: shipping_address_latitude + description: The latitude of the shipping address. + - name: shipping_address_longitude + description: The longitude of the shipping address. + - name: shipping_address_name + description: The full name of the person associated with the shipping address. + - name: shipping_address_phone + description: The phone number at the shipping address. + - name: shipping_address_province + description: The name of the state or province of the shipping address. + - name: shipping_address_province_code + description: The two-letter abbreviation of the state or province of the shipping address. + - name: shipping_address_zip + description: The zip or postal code of the shipping address. + - name: source_name + description: Where the checkout originated. Valid values include `web`, `pos`, `iphone`, `android`. + - name: subtotal_price + description: The price of the checkout in presentment currency before shipping and taxes. + - name: has_taxes_included + description: Boolean representing whether taxes are included in the price. + - name: token + description: A unique ID for a checkout. + - name: total_discounts + description: The total amount of discounts to be applied in presentment currency. + - name: total_duties + description: The total duties of the checkout in presentment currency. + - name: total_line_items_price + description: The sum of the prices of all line items in the checkout in presentment currency. + - name: total_price + description: The sum of line item prices, all discounts, shipping costs, and taxes for the checkout in presentment currency. + - name: total_tax + description: The sum of all the taxes applied to the checkout in presentment currency. + - name: total_weight + description: The sum of all the weights in grams of the line items in the checkout. + - name: updated_at + description: The date and time (ISO 8601 format) when the checkout was last modified. + - name: user_id + description: The ID of the user who created the checkout. + + - name: stg_shopify__collection_product + description: Table relating products to the collections they belong to. Use this instead of the deprecated `COLLECT` table. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: collection_id + description: ID referencing the `collection` the product belongs to. + - name: product_id + description: ID referencing the `product`. + + - name: stg_shopify__collection + description: > + A collection is a grouping of products that merchants can create to make their stores easier to browse. + Merchants can create collections by selecting products individually or by defining rules that automatically determine whether products are included (aka a "smart collection"). + columns: + - name: is_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: rule_logic + description: Whether the `rules` are disjuctive (logical `OR`) or conjunctive (logical `AND`) + - name: handle + description: A unique, human-readable string for the collection automatically generated from its title. This is used in themes by the Liquid templating language to refer to the collection. + - name: collection_id + description: The ID for the collection. + - name: published_at + description: The time and date (ISO 8601 format) when the collection was made visible. Returns null for a hidden collection. + - name: published_scope + description: > + Whether the collection is published to the Point of Sale channel. Valid values `web` (the collection is published to the Online Store channel but not published to the Point of Sale channel) + and `global` (the collection is published to both the Online Store channel and the Point of Sale channel). + - name: rules + description: > + An array of rules that define what products go into the smart collection. Each rule (`column` -- `relation` --> `condition`) has these properties: + - `column`: the property of a product being used to populate the smart collection. Ex: 'tag', 'type', 'vendor', 'variant_price', etc. + - `relation`: The comparitive relationship between the column choice, and the condition ('equals', 'contains', 'greater_than', etc.) + - condition: Select products for a smart collection using a condition. Values are either strings or numbers, depending on the relation value. + See the [Shopify docs](https://shopify.dev/api/admin-rest/2022-10/resources/smartcollection#resource-object) for more. + - name: sort_order + description: > + The order of the products in the collection. Valid values inclide + - `alpha-asc`: The products are sorted alphabetically from A to Z. + - `alpha-des`: The products are sorted alphabetically from Z to A. + - `best-selling`: The products are sorted by number of sales. + - `created`: The products are sorted by the date they were created, from oldest to newest. + - `created-desc`: The products are sorted by the date they were created, from newest to oldest. + - `manual`: The products are manually sorted by the shop owner. + - `price-asc`: The products are sorted by price from lowest to highest. + - `price-desc`: The products are sorted by price from highest to lowest. + - name: title + description: The name of the collection + - name: updated_at + description: The date and time (ISO 8601 format) when the collection was last modified. + + - name: stg_shopify__customer_tag + description: Tags that the shop owner has attached to the customer. A customer can have up to 250 tags. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (starting from 1) represnting when the tag was placed on the customer. + - name: customer_id + description: ID of the customer being tagged. + - name: value + description: Value of the tag. + + - name: stg_shopify__discount_code + description: > + Table storing discount codes that enable specific discounts to be redeemed. Merchants can distribute discount codes to their customers using a variety of means, such as an email or URL, + and customers can apply these codes at checkout. Each discount code belongs to a price rule, which holds the logic for the discount. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: code + description: The case-insensitive discount code that customers use at checkout. Shopify recommends this map onto the associated `price_rule.title`. + - name: created_at + description: The date and time (ISO 8601 format) when the discount code was created. + - name: discount_code_id + description: The ID for the discount code. + - name: price_rule_id + description: The ID for the price rule that this discount code belongs to. + - name: updated_at + description: The date and time (ISO 8601 format) when the discount code was updated. + - name: usage_count + description: The number of times that the discount code has been redeemed. + + - name: stg_shopify__fulfillment + description: > + A fulfillment order represents a group of one or more items in an order that will be fulfilled from the same location. + A fulfillment represents work that is completed as part of a fulfillment order and can include one or more items. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: created_at + description: The date and time when the fulfillment was created. The API returns this value in ISO 8601 format. + - name: fulfillment_id + description: The ID for the fulfillment. + - name: location_id + description: The unique identifier of the location that the fulfillment was processed at. + - name: name + description: > + The uniquely identifying fulfillment name, consisting of two parts separated by a .. The first part represents the order name and the second part represents the fulfillment number. + The fulfillment number automatically increments depending on how many fulfillments are in an order (e.g. #1001.1, #1001.2). + - name: order_id + description: The unique numeric identifier for the order. + - name: receipt_authorization + description: The authorization code from the receipt. + - name: service + description: The fulfillment service associated with the fulfillment. + - name: shipment_status + description: > + The current shipment status of the fulfillment. Valid values include: + - label_printed: A label for the shipment was purchased and printed. + - label_purchased: A label for the shipment was purchased, but not printed. + - attempted_delivery: Delivery of the shipment was attempted, but unable to be completed. + - ready_for_pickup: The shipment is ready for pickup at a shipping depot. + - confirmed: The carrier is aware of the shipment, but hasn't received it yet. + - in_transit: The shipment is being transported between shipping facilities on the way to its destination. + - out_for_delivery: The shipment is being delivered to its final destination. + - delivered: The shipment was succesfully delivered. + - failure: Something went wrong when pulling tracking information for the shipment, such as the tracking number was invalid or the shipment was canceled. + - name: status + description: > + The status of the fulfillment. Valid values include: + - pending: Shopify has created the fulfillment and is waiting for the third-party fulfillment service to transition it to 'open' or 'success'. + - open: The fulfillment has been acknowledged by the service and is in processing. + - success: The fulfillment was successful. + - cancelled: The fulfillment was cancelled. + - error: There was an error with the fulfillment request. + - failure: The fulfillment request failed. + - name: tracking_company + description: The name of the tracking company. + - name: tracking_number + description: Primary tracking number for the order. + - name: tracking_numbers + description: A list of tracking numbers, provided by the shipping company. + - name: tracking_urls + description: The URLs of tracking pages for the fulfillment. + - name: updated_at + description: The date and time (ISO 8601 format) when the fulfillment was last modified. + + - name: stg_shopify__inventory_item + description: > + An inventory item represents a physical good. It holds essential information about the physical good, including its SKU and whether its inventory is tracked. + There is a 1:1 relationship between a product variant and an inventory item. + columns: + - name: is_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: cost + description: The unit cost of the inventory item. The shop's default currency is used. + - name: country_code_of_origin + description: The country code (ISO 3166-1 alpha-2) of where the item came from. + - name: created_at + description: The date and time (ISO 8601 format) when the inventory item was created. + - name: inventory_item_id + description: The ID of the inventory item. + - name: province_code_of_origin + description: The province code (ISO 3166-2 alpha-2) of where the item came from. The province code is only used if the shipping provider for the inventory item is Canada Post. + - name: requires_shipping + description: Boolean representing whether a customer needs to provide a shipping address when placing an order containing the inventory item. + - name: sku + description: The unique SKU (stock keeping unit) of the inventory item. + - name: is_inventory_quantity_tracked + description: Boolean representing whether inventory levels are tracked for the item. If true, then the inventory quantity changes are tracked by Shopify. + - name: updated_at + description: The date and time (ISO 8601 format) when the inventory item was last modified. + + - name: stg_shopify__inventory_level + description: > + An inventory level represents the quantities of an inventory item for a location. + + Each inventory level belongs to one inventory item and has one location. For every location where an inventory item can be stocked, there's an inventory level that represents + the inventory item's quantities relating to that location. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: available_quantity + description: The available quantity of an inventory item at the inventory level's associated location. Returns null if the inventory item is not tracked. + - name: inventory_item_id + description: The ID of the inventory item associated with the inventory level. + - name: location_id + description: The ID of the location that the inventory level belongs to. + - name: updated_at + description: The date and time (ISO 8601 format) when the inventory level was last modified. + + - name: stg_shopify__location + description: A location represents a geographical location where your stores, pop-up stores, headquarters, and warehouses exist. + columns: + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: is_active + description: > + Boolean representing whether the location is active. If true, then the location can be used to sell products, stock inventory, and fulfill orders. + - name: address_1 + description: The location's street address. + - name: address_2 + description: The optional second line of the location's street address. + - name: city + description: The city the location is in. + - name: country + description: The country the location is in (two-letter code). + - name: country_code + description: The two-letter code (ISO 3166-1 alpha-2 format) corresponding to country the location is in. + - name: country_name + description: Full name of the location's country. + - name: created_at + description: The date and time (ISO 8601 format) when the location was created. + - name: location_id + description: The ID of the location. + - name: is_legacy + description: > + Boolean representing whether this is a fulfillment service location. If true, then the location is a fulfillment service location. + If false, then the location was created by the merchant and isn't tied to a fulfillment service. + - name: localized_country_name + description: The localized name of the location's country. + - name: localized_province_name + description: The localized name of the location's region. Typically a province, state, or district. + - name: name + description: The name of the location. + - name: phone + description: The phone number of the location. This value can contain special characters, such as - or +. + - name: province + description: The province, state, or district of the location. + - name: province_code + description: The province, state, or district code (ISO 3166-2 alpha-2 format) of the location. + - name: updated_at + description: The date and time (ISO 8601 format) when the location was last updated. + - name: zip + description: The zip or postal code. + + - name: stg_shopify__metafield + description: > + Metafields are a flexible way to attach additional information to a Shopify resource (e.g. Product, Collection, etc.). Some examples of data stored using metafields include specifications, size charts, + downloadable documents, release dates, images, or part numbers. Metafields are identified by an owner resource, a namespace, and a key and they store a value along with type information for that context. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: created_at + description: The date and time (ISO 8601 format) when the metafield was created. + - name: description + description: A description of the information that the metafield contains. + - name: metafield_id + description: The unique ID of the metafield. + - name: key + description: The key of the metafield. Keys can be up to 64 characters long and can contain alphanumeric characters, hyphens, underscores, and periods. + - name: namespace + description: A container for a group of metafields. Grouping metafields within a namespace prevents your metafields from conflicting with other metafields with the same key name. Must have between 3-255 characters. + - name: owner_resource_id + description: The unique ID of the resource that the metafield is attached to. + - name: owner_resource + description: The type of resource (table) that the metafield is attached to. + - name: value_type + description: The type of data that the metafield stores in the `value` field. Refer to the [list](https://shopify.dev/apps/metafields/types) of supported types. Coalescing of type and value_type + - name: updated_at + description: The date and time (ISO 8601 format) when the metafield was last updated. + - name: value + description: The data to store in the metafield. The value is always stored as a string, regardless of the metafield's type. + + - name: stg_shopify__order_note_attribute + description: Table storing custom attributes placed on orders. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: name + description: Name of the attribute. + - name: order_id + description: ID referencing the order the note attribute belongs to. + - name: value + description: Value of the attribute. + + - name: order_shipping_line + description: Represents the shipping details that the customer chose for their order. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: carrier_identifier + description: A reference to the carrier service that provided the rate. Present when the rate was computed by a third-party carrier service. + - name: code + description: A reference to the shipping method. + - name: delivery_category + description: The general classification of the delivery method. + - name: discounted_price + description: The pre-tax shipping price with discounts applied. + - name: discounted_price_set + description: The pre-tax shipping price with discounts applied (JSON). + - name: id + description: A globally-unique identifier. + - name: order_id + description: ID of the associated order. + - name: phone + description: The phone number at the shipping address. + - name: price + description: Returns the price of the shipping line. + - name: price_set + description: Returns the price of the shipping line (JSON). + - name: requested_fulfillment_service_id + description: The fulfillment service requested for the shipping method. Present if the shipping method requires processing by a third party fulfillment service. + - name: source + description: Returns the rate source for the shipping line. + - name: title + description: Returns the title of the shipping line. + + - name: order_shipping_tax_line + description: Represents taxes associated with order shipping lines. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (from 1) representing the order of shipping lines per order. + - name: order_shipping_line_id + description: ID of the order shipping line this recod is associated with. + - name: price + description: The amount of tax, in shop currency, after discounts and before returns. + - name: price_set + description: The amount of tax, in shop and presentment currencies, after discounts and before returns (JSON). + - name: rate + description: The proportion of the line item price that the tax represents as a decimal. + - name: title + description: The name of the tax. + + - name: order_tag + description: Tags that the shop owner has attached to the order. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (starting from 1) represnting when the tag was placed on the order. + - name: order_id + description: ID of the order being tagged. + - name: value + description: Value of the tag. + + - name: order_url_tag + description: Key-value tags that the shop owner has attached to the order url. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: key + description: Key of the tag pair. + - name: order_id + description: ID of the order url being tagged. + - name: value + description: Value of the tag. + + - name: price_rule + description: > + Table storing price rules. You can use price rules to create discounts dependent on conditions. Merchants can distribute the discount codes to their customers. + Using price rules, you can create discounts that specify a discount as a percentage, a fixed amount, or free shipping. You use entitlements and prerequisites to dynamically build these discounts. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: allocation_limit + description: > + The number of times the discount can be allocated on the cart - if eligible. For example a Buy 1 hat Get 1 hat for free discount can be applied 3 times on a cart having more than 6 hats, + where maximum of 3 hats get discounted - if the allocation_limit is 3. Empty (null) allocation_limit means unlimited number of allocations. + - name: allocation_method + description: > + The allocation method of the price rule. Valid values include `each` (the discount is applied to each of the entitled items. For example, for a price rule that takes $15 off, each entitled line item in a checkout will be discounted by $15) + and `across` (the calculated discount amount will be applied across the entitled items. For example, for a price rule that takes $15 off, the discount will be applied across all the entitled items). + - name: created_at + description: The date and time (ISO 8601 format) when the price rule was created. + - name: customer_selection + description: > + The customer selection for the price rule. Valid values include `all` (the price rule is valid for all customers) and `prerequisite` + (the customer must either belong to one of the customer segments specified by customer_segment_prerequisite_ids, or be one of the customers specified by prerequisite_customer_ids). + - name: ends_at + description: The date and time (ISO 8601 format) when the price rule ends. Must be after starts_at. + - name: id + description: The ID for the price rule. + - name: once_per_customer + description: Boolean representing whether the generated discount code will be valid only for a single use per customer. This is tracked using customer ID. + - name: prerequisite_quantity_range + description: If `customer_selection` is `prerequisite`, the minimum number of items for the price rule to be applicable. The quantity of an entitled cart item must be greater than or equal to this value. + - name: prerequisite_shipping_price_range + description: If `customer_selection` is `prerequisite`, the maximum shipping price for the price rule to be applicable. The shipping price must be less than or equal to this value + - name: prerequisite_subtotal_range + description: If `customer_selection` is `prerequisite`, the minimum subtotal for the price rule to be applicable. The subtotal of the entitled cart items must be greater than or equal to this value for the discount to apply. + - name: prerequisite_to_entitlement_purchase_prerequisite_amount + description: If `customer_selection` is `prerequisite`, the prerequisite purchase for a Buy X Get Y discount. The minimum purchase amount required to be entitled to the discount. + - name: quantity_ratio_entitled_quantity + description: If `customer_selection` is `prerequisite`, in a Buy/Get ratio for a Buy X Get Y discount, this is the offered 'get' quantity. + - name: quantity_ratio_prerequisite_quantity + description: If `customer_selection` is `prerequisite`, in a Buy/Get ratio for a Buy X Get Y discount, this defines the necessary 'buy' quantity. + - name: starts_at + description: The date and time (ISO 8601 format) when the price rule starts. + - name: target_selection + description: > + The target selection method of the price rule. Valid values include `all` (the price rule applies the discount to all line items in the checkout) and + `entitled` (the price rule applies the discount to selected entitlements only). + - name: target_type + description: The target type that the price rule applies to. Valid values include `line_item` (the price rule applies to the cart's line items) and `shipping_line` (the price rule applies to the cart's shipping lines). + - name: title + description: > + The title of the price rule. This is used by the Shopify admin search to retrieve discounts. It is also displayed on the Discounts page of the Shopify admin for bulk discounts. + Shopify recommends that this map onto the associated `discount_code.code`. + - name: updated_at + description: The date and time (ISO 8601 format) when the price rule was updated. + - name: usage_limit + description: The maximum number of times the price rule can be used, per discount code. + - name: value + description: The value of the price rule. If if the value of `target_type` is `shipping_line`, then only -100 is accepted. The value must be negative. + - name: value_type + description: > + The value type of the price rule. Valid values include `fixed_amount` (applies a discount of value as a unit of the store's currency. For example, if value is -30 and the store's currency is USD, then $30 USD is deducted when the discount is applied) + and `percentage` (applies a percentage discount of value. For example, if value is -30, then 30% will be deducted when the discount is applied). + + If `target_type` is `shipping_line`, then only `percentage` is accepted. + + - name: product_image + description: Table storing hosted images of products. + columns: + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: created_at + description: The date and time when the product image was created. The API returns this value in ISO 8601 format. + - name: height + description: Height dimension of the image which is determined on upload. + - name: id + description: Unique numeric identifier of the product image. + - name: position + description: The order of the product image in the list. The first product image is at position 1 and is the "main" image for the product. + - name: product_id + description: The id of the product associated with the image. + - name: src + description: Specifies the location of the product image. This parameter supports URL filters that you can use to retrieve modified copies of the image. + - name: updated_at + description: The date and time when the product image was last modified. The API returns this value in ISO 8601 format. + - name: variant_ids + description: An array of variant ids associated with the image. + - name: width + description: Width dimension of the image which is determined on upload. + + - name: product_tag + description: Tags that the shop owner has attached to the product. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (starting from 1) represnting when the tag was placed on the product. + - name: product_id + description: ID of the product being tagged. + - name: value + description: Value of the tag. + + - name: shop + description: The Shop resource is a collection of general business and store management settings and information about the store. + columns: + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: address_1 + description: The shop's street address. + - name: address_2 + description: The optional second line of the shop's street address. + - name: checkout_api_supported + description: Boolean representing whether the shop is capable of accepting payments directly through the Checkout API. + - name: city + description: The shop's city. + - name: cookie_consent_level + description: The cookie consent level defined on the shop's online store. + - name: country + description: The shop's country. In most cases, this value matches the country_code. + - name: country_code + description: The two-letter country code corresponding to the shop's country. + - name: country_name + description: The shop's normalized country name. + - name: county_taxes + description: Boolean representing whether the shop is applying taxes on a per-county basis. Only applicable to shops based in the US. Either `true` or `null` (not false, according to Shopify API docs). + - name: created_at + description: The date and time (ISO 8601) when the shop was created. + - name: currency + description: The three-letter code (ISO 4217 format) for the shop's default currency. + - name: customer_email + description: The contact email used for communication between the shop owner and the customer. + - name: domain + description: The shop's domain. + - name: eligible_for_card_reader_giveaway + description: Boolean representing whether the shop is eligible to receive a free credit card reader from Shopify. + - name: eligible_for_payments + description: Boolean representing whether the shop is eligible to use Shopify Payments. + - name: email + description: The contact email used for communication between Shopify and the shop owner. + - name: enabled_presentment_currencies + description: An array of of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable currencies from their Shopify Payments settings in the Shopify Admin. + - name: force_ssl + description: DEPRECATED. + - name: google_apps_domain + description: The GSuite URL for the store, if applicable. + - name: google_apps_login_enabled + description: Boolean representing whether the GSuite login is enabled. Shops with this feature will be able to log in through the GSuite login page. Valid values are `true` and `null`. + - name: has_discounts + description: Boolean representing whether any active discounts exist for the shop. + - name: has_gift_cards + description: Boolean representing whether any active gift cards exist for the shop. + - name: has_storefront + description: Boolean representing whether this shop has an online store. + - name: iana_timezone + description: The name of the timezone assigned by the [IANA](https://www.iana.org/time-zones). + - name: id + description: The ID for the shop. A 64-bit unsigned integer. + - name: latitude + description: The latitude of the shop's location. + - name: longitude + description: The longitude of the shop's location. + - name: money_format + description: A string representing the way currency is formatted when the currency isn't specified. + - name: money_in_emails_format + description: A string representing the way currency is formatted in email notifications when the currency isn't specified. + - name: money_with_currency_format + description: A string representing the way currency is formatted when the currency is specified. + - name: money_with_currency_in_emails_format + description: A string representing the way currency is formatted in email notifications when the currency is specified. + - name: multi_location_enabled + description: DEPRECATED and hard-coded to `true`. + - name: myshopify_domain + description: The shop's .myshopify.com domain. + - name: name + description: The name of the shop. + - name: password_enabled + description: Boolean representing whether the password protection page is enabled on the shop's online store. + - name: phone + description: The contact phone number for the shop. + - name: plan_display_name + description: The display name of the Shopify plan the shop is on. + - name: plan_name + description: The name of the Shopify plan the shop is on. + - name: pre_launch_enabled + description: Boolen representing whether the pre-launch page is enabled on the shop's online store. + - name: primary_locale + description: The shop's primary locale, as configured in the language settings of the shop's theme. + - name: primary_location_id + description: DEPRECATED. Formerly used for the ID of the shipping origin location. + - name: province + description: The shop's normalized province or state name. + - name: province_code + description: The two- or three-letter code for the shop's province or state. + - name: requires_extra_payments_agreement + description: Boolean representing whether the shop requires an extra Shopify Payments agreement. + - name: setup_required + description: Boolean representing whether the shop has any outstanding setup steps. + - name: shop_owner + description: The username of the shop owner. + - name: source + description: The handle of the partner account that referred the merchant to Shopify, if applicable. + - name: tax_shipping + description: Boolean representing whether taxes are charged for shipping. Valid values are true or false. + - name: taxes_included + description: Boolean representing whether applicable taxes are included in product prices. Valid values are true or null. + - name: timezone + description: The name of the timezone the shop is in. + - name: updated_at + description: The date and time (ISO 8601) when the shop was last updated. + - name: weight_unit + description: The default unit of weight measurement for the shop. + - name: zip + description: The shop's zip or postal code. + + - name: tender_transaction + description: > + Each tender transaction represents money passing between the merchant and a customer. A tender transaction with a positive amount + represents a transaction where the customer paid money to the merchant. A negative amount represents a transaction where the + merchant refunded money back to the customer. Tender transactions represent transactions that modify the shop's balance. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: amount + description: The amount of the tender transaction in the shop's currency. + - name: currency + description: The three-letter code (ISO 4217 format) for the currency used for the tender transaction. + - name: id + description: The ID of the transaction. + - name: order_id + description: The ID of the order that the tender transaction belongs to. + - name: payment_method + description: > + Information about the payment method used for this transaction. Valid values include: + - credit_card + - cash + - android_pay + - apple_pay + - google_pay + - samsung_pay + - shopify_pay + - amazon + - klarna + - paypal + - unknown + - other + - name: processed_at + description: The date and time (ISO 8601 format) when the tender transaction was processed. + - name: remote_reference + description: The remote (gateway) reference associated with the tender. + - name: test + description: Whether the tender transaction is a test transaction. + - name: user_id + description: The ID of the user logged into the Shopify POS device that processed the tender transaction, if applicable. + + - name: abandoned_checkout_discount_code + description: Abandoned checkouts that applied a discount code. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: amount + description: The amount of the discount in presentment currency. + - name: checkout_id + description: ID of the checkout. + - name: code + description: The discount code. + - name: created_at + description: When the checkout discount application was created. + - name: discount_id + description: ID of the discount. + - name: index + description: Index (from 1) representing the application of the discount to the checkout. Use the latest (highest index) + - name: type + description: The type of discount. Valid values - percentage, shipping, fixed_amount. (default - fixed_amount) + - name: updated_at + description: When the checkout's discount was last updated + + - name: order_discount_code + description: Discount codes placed on orders. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: amount + description: The amount that's deducted from the order total. + - name: code + description: This property returns the discount code that was entered at checkout. Otherwise this property returns the title of the discount that was applied. + - name: order_id + description: Associated order ID. + - name: type + description: The type of discount - `fixed_amount`, `percentage`, or `shipping`. \ No newline at end of file diff --git a/models/stg_shopify__collection.sql b/models/stg_shopify__collection.sql index fb65576..3f30629 100644 --- a/models/stg_shopify__collection.sql +++ b/models/stg_shopify__collection.sql @@ -20,20 +20,20 @@ fields as ( final as ( select + id as collection_id, _fivetran_deleted as is_deleted, - _fivetran_synced, case when disjunctive is null then null when disjunctive then 'disjunctive' else 'conjunctive' end as rule_logic, handle, - id as collection_id, published_at, published_scope, rules, sort_order, title, - updated_at + updated_at, + _fivetran_synced from fields ) diff --git a/models/stg_shopify__collection_product.sql b/models/stg_shopify__collection_product.sql index 83fe551..f2d7cc2 100644 --- a/models/stg_shopify__collection_product.sql +++ b/models/stg_shopify__collection_product.sql @@ -20,9 +20,9 @@ fields as ( final as ( select - _fivetran_synced, collection_id, - product_id + product_id, + _fivetran_synced, from fields ) diff --git a/models/stg_shopify__fulfillment_order_line.sql b/models/stg_shopify__fulfillment_order_line.sql deleted file mode 100644 index f9f5272..0000000 --- a/models/stg_shopify__fulfillment_order_line.sql +++ /dev/null @@ -1,48 +0,0 @@ -with base as ( - - select * - from {{ ref('stg_shopify__fulfillment_order_line_tmp') }} -), - -fields as ( - - select - {{ - fivetran_utils.fill_staging_columns( - source_columns=adapter.get_columns_in_relation(ref('stg_shopify__fulfillment_order_line_tmp')), - staging_columns=get_fulfillment_order_line_columns() - ) - }} - from base -), - -final as ( - - select -- may remove this model - _fivetran_synced, - fulfillable_quantity, - fulfillment_id, - fulfillment_service, - gift_card, - grams, - name, - order_id, - order_line_id, - price, - price_set, - product_id, - properties, - property_pre_order_date, - quantity, - requires_shipping, - sku, - taxable, - title, - variant_id, - variant_title, - vendor - from fields -) - -select * -from final diff --git a/models/stg_shopify__inventory_item.sql b/models/stg_shopify__inventory_item.sql index eb76573..100dd0d 100644 --- a/models/stg_shopify__inventory_item.sql +++ b/models/stg_shopify__inventory_item.sql @@ -26,7 +26,7 @@ final as ( cost, country_code_of_origin, province_code_of_origin, - requires_shipping as does_require_shipping, + requires_shipping, tracked as is_inventory_quantity_tracked, created_at, updated_at, diff --git a/models/stg_shopify__location.sql b/models/stg_shopify__location.sql index 68e1770..746c5d3 100644 --- a/models/stg_shopify__location.sql +++ b/models/stg_shopify__location.sql @@ -27,7 +27,8 @@ final as ( address_1, address_2, city, - coalesce(country_code, country) as country_code, + country, + country_code, country_name, legacy as is_legacy, localized_country_name, diff --git a/models/stg_shopify__order_discount_code.sql b/models/stg_shopify__order_discount_code.sql new file mode 100644 index 0000000..29ac6f7 --- /dev/null +++ b/models/stg_shopify__order_discount_code.sql @@ -0,0 +1,34 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__order_discount_code_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__order_discount_code_tmp')), + staging_columns=get_order_discount_code_columns() + ) + }} + from base +), + +final as ( + + select + order_id, + code, + type, + amount, + _fivetran_synced + + from fields + where index = 1 -- Sanity check. index should not > 1 but open an issue if that's not the case in your data +) + +select * +from final diff --git a/models/tmp/stg_shopify__fulfillment_order_line_tmp.sql b/models/tmp/stg_shopify__order_discount_code_tmp.sql similarity index 74% rename from models/tmp/stg_shopify__fulfillment_order_line_tmp.sql rename to models/tmp/stg_shopify__order_discount_code_tmp.sql index 3b0c0f5..d219fa5 100644 --- a/models/tmp/stg_shopify__fulfillment_order_line_tmp.sql +++ b/models/tmp/stg_shopify__order_discount_code_tmp.sql @@ -1,11 +1,11 @@ {{ fivetran_utils.union_data( - table_identifier='fulfillment_order_line', + table_identifier='order_discount_code', database_variable='shopify_database', schema_variable='shopify_schema', default_database=target.database, default_schema='shopify', - default_variable='fulfillment_order_line_source', + default_variable='order_discount_code_source', union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases' ) From c5ebc4bc5eed3f6968f1a0aae5fc938ea6332481 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 12:13:45 -0800 Subject: [PATCH 027/137] all new tables are documentted and tested --- models/stg_shopify.yml | 211 ++++++++++++++---- ...pify__abandoned_checkout_discount_code.sql | 2 + models/stg_shopify__inventory_item.sql | 2 +- models/stg_shopify__shop.sql | 2 +- 4 files changed, 166 insertions(+), 51 deletions(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index a6890ff..b89587b 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -543,6 +543,9 @@ models: description: The payment gateway used by the checkout. - name: checkout_id description: The ID for the checkout. + tests: + - unique + - not_null - name: landing_site_base_url description: The URL for the page where the customer entered the shop. - name: location_id @@ -614,13 +617,22 @@ models: - name: stg_shopify__collection_product description: Table relating products to the collections they belong to. Use this instead of the deprecated `COLLECT` table. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - collection_id + - product_id columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: collection_id description: ID referencing the `collection` the product belongs to. + tests: + - not_null - name: product_id description: ID referencing the `product`. + tests: + - not_null - name: stg_shopify__collection description: > @@ -637,6 +649,9 @@ models: description: A unique, human-readable string for the collection automatically generated from its title. This is used in themes by the Liquid templating language to refer to the collection. - name: collection_id description: The ID for the collection. + tests: + - not_null + - unique - name: published_at description: The time and date (ISO 8601 format) when the collection was made visible. Returns null for a hidden collection. - name: published_scope @@ -668,13 +683,22 @@ models: - name: stg_shopify__customer_tag description: Tags that the shop owner has attached to the customer. A customer can have up to 250 tags. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - customer_id + - index columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: index description: Index (starting from 1) represnting when the tag was placed on the customer. + tests: + - not_null - name: customer_id description: ID of the customer being tagged. + tests: + - not_null - name: value description: Value of the tag. @@ -691,6 +715,9 @@ models: description: The date and time (ISO 8601 format) when the discount code was created. - name: discount_code_id description: The ID for the discount code. + tests: + - unique + - not_null - name: price_rule_id description: The ID for the price rule that this discount code belongs to. - name: updated_at @@ -709,6 +736,9 @@ models: description: The date and time when the fulfillment was created. The API returns this value in ISO 8601 format. - name: fulfillment_id description: The ID for the fulfillment. + tests: + - not_null + - unique - name: location_id description: The unique identifier of the location that the fulfillment was processed at. - name: name @@ -770,9 +800,12 @@ models: description: The date and time (ISO 8601 format) when the inventory item was created. - name: inventory_item_id description: The ID of the inventory item. + tests: + - not_null + - unique - name: province_code_of_origin description: The province code (ISO 3166-2 alpha-2) of where the item came from. The province code is only used if the shipping provider for the inventory item is Canada Post. - - name: requires_shipping + - name: is_shipping_required description: Boolean representing whether a customer needs to provide a shipping address when placing an order containing the inventory item. - name: sku description: The unique SKU (stock keeping unit) of the inventory item. @@ -787,6 +820,11 @@ models: Each inventory level belongs to one inventory item and has one location. For every location where an inventory item can be stocked, there's an inventory level that represents the inventory item's quantities relating to that location. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - inventory_item_id + - location_id columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -794,8 +832,12 @@ models: description: The available quantity of an inventory item at the inventory level's associated location. Returns null if the inventory item is not tracked. - name: inventory_item_id description: The ID of the inventory item associated with the inventory level. + tests: + - not_null - name: location_id description: The ID of the location that the inventory level belongs to. + tests: + - not_null - name: updated_at description: The date and time (ISO 8601 format) when the inventory level was last modified. @@ -825,6 +867,9 @@ models: description: The date and time (ISO 8601 format) when the location was created. - name: location_id description: The ID of the location. + tests: + - unique + - not_null - name: is_legacy description: > Boolean representing whether this is a fulfillment service location. If true, then the location is a fulfillment service location. @@ -859,6 +904,9 @@ models: description: A description of the information that the metafield contains. - name: metafield_id description: The unique ID of the metafield. + tests: + - unique + - not_null - name: key description: The key of the metafield. Keys can be up to 64 characters long and can contain alphanumeric characters, hyphens, underscores, and periods. - name: namespace @@ -876,17 +924,26 @@ models: - name: stg_shopify__order_note_attribute description: Table storing custom attributes placed on orders. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - order_id + - name columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: name description: Name of the attribute. + tests: + - not_null - name: order_id description: ID referencing the order the note attribute belongs to. + tests: + - not_null - name: value description: Value of the attribute. - - name: order_shipping_line + - name: stg_shopify__order_shipping_line description: Represents the shipping details that the customer chose for their order. columns: - name: _fivetran_synced @@ -901,8 +958,11 @@ models: description: The pre-tax shipping price with discounts applied. - name: discounted_price_set description: The pre-tax shipping price with discounts applied (JSON). - - name: id + - name: order_shipping_line_id description: A globally-unique identifier. + tests: + - unique + - not_null - name: order_id description: ID of the associated order. - name: phone @@ -911,22 +971,31 @@ models: description: Returns the price of the shipping line. - name: price_set description: Returns the price of the shipping line (JSON). - - name: requested_fulfillment_service_id + - name: is_third_party_required description: The fulfillment service requested for the shipping method. Present if the shipping method requires processing by a third party fulfillment service. - name: source description: Returns the rate source for the shipping line. - name: title description: Returns the title of the shipping line. - - name: order_shipping_tax_line + - name: stg_shopify__order_shipping_tax_line description: Represents taxes associated with order shipping lines. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - order_shipping_line_id + - index columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: index description: Index (from 1) representing the order of shipping lines per order. + tests: + - not_null - name: order_shipping_line_id description: ID of the order shipping line this recod is associated with. + tests: + - not_null - name: price description: The amount of tax, in shop currency, after discounts and before returns. - name: price_set @@ -936,31 +1005,49 @@ models: - name: title description: The name of the tax. - - name: order_tag + - name: stg_shopify__order_tag description: Tags that the shop owner has attached to the order. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - order_id + - index columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: index description: Index (starting from 1) represnting when the tag was placed on the order. + tests: + - not_null - name: order_id description: ID of the order being tagged. + tests: + - not_null - name: value description: Value of the tag. - - name: order_url_tag + - name: stg_shopify__order_url_tag description: Key-value tags that the shop owner has attached to the order url. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - order_id + - key columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: key description: Key of the tag pair. + tests: + - not_null - name: order_id description: ID of the order url being tagged. + tests: + - not_null - name: value description: Value of the tag. - - name: price_rule + - name: stg_shopify__price_rule description: > Table storing price rules. You can use price rules to create discounts dependent on conditions. Merchants can distribute the discount codes to their customers. Using price rules, you can create discounts that specify a discount as a percentage, a fixed amount, or free shipping. You use entitlements and prerequisites to dynamically build these discounts. @@ -983,21 +1070,24 @@ models: (the customer must either belong to one of the customer segments specified by customer_segment_prerequisite_ids, or be one of the customers specified by prerequisite_customer_ids). - name: ends_at description: The date and time (ISO 8601 format) when the price rule ends. Must be after starts_at. - - name: id + - name: price_rule_id description: The ID for the price rule. - - name: once_per_customer + tests: + - unique + - not_null + - name: is_once_per_customer description: Boolean representing whether the generated discount code will be valid only for a single use per customer. This is tracked using customer ID. - - name: prerequisite_quantity_range + - name: prereq_min_quantity description: If `customer_selection` is `prerequisite`, the minimum number of items for the price rule to be applicable. The quantity of an entitled cart item must be greater than or equal to this value. - - name: prerequisite_shipping_price_range + - name: prereq_max_shipping_price description: If `customer_selection` is `prerequisite`, the maximum shipping price for the price rule to be applicable. The shipping price must be less than or equal to this value - - name: prerequisite_subtotal_range + - name: prereq_min_subtotal description: If `customer_selection` is `prerequisite`, the minimum subtotal for the price rule to be applicable. The subtotal of the entitled cart items must be greater than or equal to this value for the discount to apply. - - name: prerequisite_to_entitlement_purchase_prerequisite_amount + - name: prereq_min_purchase_quantity_for_entitlement description: If `customer_selection` is `prerequisite`, the prerequisite purchase for a Buy X Get Y discount. The minimum purchase amount required to be entitled to the discount. - - name: quantity_ratio_entitled_quantity + - name: prereq_buy_x_get_this description: If `customer_selection` is `prerequisite`, in a Buy/Get ratio for a Buy X Get Y discount, this is the offered 'get' quantity. - - name: quantity_ratio_prerequisite_quantity + - name: prereq_buy_this_get_y description: If `customer_selection` is `prerequisite`, in a Buy/Get ratio for a Buy X Get Y discount, this defines the necessary 'buy' quantity. - name: starts_at description: The date and time (ISO 8601 format) when the price rule starts. @@ -1024,19 +1114,20 @@ models: If `target_type` is `shipping_line`, then only `percentage` is accepted. - - name: product_image + - name: stg_shopify__product_image description: Table storing hosted images of products. columns: - - name: _fivetran_deleted - description: "{{ doc('_fivetran_deleted') }}" - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: created_at description: The date and time when the product image was created. The API returns this value in ISO 8601 format. - name: height description: Height dimension of the image which is determined on upload. - - name: id + - name: product_image_id description: Unique numeric identifier of the product image. + tests: + - unique + - not_null - name: position description: The order of the product image in the list. The first product image is at position 1 and is the "main" image for the product. - name: product_id @@ -1050,22 +1141,31 @@ models: - name: width description: Width dimension of the image which is determined on upload. - - name: product_tag + - name: stg_shopify__product_tag description: Tags that the shop owner has attached to the product. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - product_id + - index columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: index description: Index (starting from 1) represnting when the tag was placed on the product. + tests: + - not_null - name: product_id description: ID of the product being tagged. + tests: + - not_null - name: value description: Value of the tag. - - name: shop + - name: stg_shopify__shop description: The Shop resource is a collection of general business and store management settings and information about the store. columns: - - name: _fivetran_deleted + - name: is_deleted description: "{{ doc('_fivetran_deleted') }}" - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1073,7 +1173,7 @@ models: description: The shop's street address. - name: address_2 description: The optional second line of the shop's street address. - - name: checkout_api_supported + - name: has_checkout_api_supported description: Boolean representing whether the shop is capable of accepting payments directly through the Checkout API. - name: city description: The shop's city. @@ -1085,7 +1185,7 @@ models: description: The two-letter country code corresponding to the shop's country. - name: country_name description: The shop's normalized country name. - - name: county_taxes + - name: has_county_taxes description: Boolean representing whether the shop is applying taxes on a per-county basis. Only applicable to shops based in the US. Either `true` or `null` (not false, according to Shopify API docs). - name: created_at description: The date and time (ISO 8601) when the shop was created. @@ -1095,19 +1195,17 @@ models: description: The contact email used for communication between the shop owner and the customer. - name: domain description: The shop's domain. - - name: eligible_for_card_reader_giveaway + - name: is_eligible_for_card_reader_giveaway description: Boolean representing whether the shop is eligible to receive a free credit card reader from Shopify. - - name: eligible_for_payments + - name: is_eligible_for_payments description: Boolean representing whether the shop is eligible to use Shopify Payments. - name: email description: The contact email used for communication between Shopify and the shop owner. - name: enabled_presentment_currencies description: An array of of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable currencies from their Shopify Payments settings in the Shopify Admin. - - name: force_ssl - description: DEPRECATED. - name: google_apps_domain description: The GSuite URL for the store, if applicable. - - name: google_apps_login_enabled + - name: is_google_apps_login_enabled description: Boolean representing whether the GSuite login is enabled. Shops with this feature will be able to log in through the GSuite login page. Valid values are `true` and `null`. - name: has_discounts description: Boolean representing whether any active discounts exist for the shop. @@ -1117,8 +1215,11 @@ models: description: Boolean representing whether this shop has an online store. - name: iana_timezone description: The name of the timezone assigned by the [IANA](https://www.iana.org/time-zones). - - name: id + - name: shop_id description: The ID for the shop. A 64-bit unsigned integer. + tests: + - not_null + - unique - name: latitude description: The latitude of the shop's location. - name: longitude @@ -1131,13 +1232,11 @@ models: description: A string representing the way currency is formatted when the currency is specified. - name: money_with_currency_in_emails_format description: A string representing the way currency is formatted in email notifications when the currency is specified. - - name: multi_location_enabled - description: DEPRECATED and hard-coded to `true`. - name: myshopify_domain description: The shop's .myshopify.com domain. - name: name description: The name of the shop. - - name: password_enabled + - name: is_password_enabled description: Boolean representing whether the password protection page is enabled on the shop's online store. - name: phone description: The contact phone number for the shop. @@ -1145,27 +1244,25 @@ models: description: The display name of the Shopify plan the shop is on. - name: plan_name description: The name of the Shopify plan the shop is on. - - name: pre_launch_enabled + - name: is_pre_launch_enabled description: Boolen representing whether the pre-launch page is enabled on the shop's online store. - name: primary_locale description: The shop's primary locale, as configured in the language settings of the shop's theme. - - name: primary_location_id - description: DEPRECATED. Formerly used for the ID of the shipping origin location. - name: province description: The shop's normalized province or state name. - name: province_code description: The two- or three-letter code for the shop's province or state. - - name: requires_extra_payments_agreement + - name: is_extra_payments_agreement_required description: Boolean representing whether the shop requires an extra Shopify Payments agreement. - - name: setup_required + - name: is_setup_required description: Boolean representing whether the shop has any outstanding setup steps. - name: shop_owner description: The username of the shop owner. - name: source description: The handle of the partner account that referred the merchant to Shopify, if applicable. - - name: tax_shipping + - name: has_shipping_taxes description: Boolean representing whether taxes are charged for shipping. Valid values are true or false. - - name: taxes_included + - name: has_taxes_included_in_price description: Boolean representing whether applicable taxes are included in product prices. Valid values are true or null. - name: timezone description: The name of the timezone the shop is in. @@ -1176,7 +1273,7 @@ models: - name: zip description: The shop's zip or postal code. - - name: tender_transaction + - name: stg_shopify__tender_transaction description: > Each tender transaction represents money passing between the merchant and a customer. A tender transaction with a positive amount represents a transaction where the customer paid money to the merchant. A negative amount represents a transaction where the @@ -1188,8 +1285,11 @@ models: description: The amount of the tender transaction in the shop's currency. - name: currency description: The three-letter code (ISO 4217 format) for the currency used for the tender transaction. - - name: id + - name: transaction_id description: The ID of the transaction. + tests: + - unique + - not_null - name: order_id description: The ID of the order that the tender transaction belongs to. - name: payment_method @@ -1211,13 +1311,17 @@ models: description: The date and time (ISO 8601 format) when the tender transaction was processed. - name: remote_reference description: The remote (gateway) reference associated with the tender. - - name: test - description: Whether the tender transaction is a test transaction. - name: user_id description: The ID of the user logged into the Shopify POS device that processed the tender transaction, if applicable. - - name: abandoned_checkout_discount_code + - name: stg_shopify__abandoned_checkout_discount_code description: Abandoned checkouts that applied a discount code. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - checkout_id + - code + - discount_id columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1225,21 +1329,26 @@ models: description: The amount of the discount in presentment currency. - name: checkout_id description: ID of the checkout. + tests: + - not_null - name: code description: The discount code. - name: created_at description: When the checkout discount application was created. - name: discount_id description: ID of the discount. - - name: index - description: Index (from 1) representing the application of the discount to the checkout. Use the latest (highest index) - name: type description: The type of discount. Valid values - percentage, shipping, fixed_amount. (default - fixed_amount) - name: updated_at description: When the checkout's discount was last updated - - name: order_discount_code + - name: stg_shopify__order_discount_code description: Discount codes placed on orders. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - order_id + - code columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1247,7 +1356,11 @@ models: description: The amount that's deducted from the order total. - name: code description: This property returns the discount code that was entered at checkout. Otherwise this property returns the title of the discount that was applied. + tests: + - not_null - name: order_id description: Associated order ID. + tests: + - not_null - name: type description: The type of discount - `fixed_amount`, `percentage`, or `shipping`. \ No newline at end of file diff --git a/models/stg_shopify__abandoned_checkout_discount_code.sql b/models/stg_shopify__abandoned_checkout_discount_code.sql index 48dcc01..32f8265 100644 --- a/models/stg_shopify__abandoned_checkout_discount_code.sql +++ b/models/stg_shopify__abandoned_checkout_discount_code.sql @@ -14,6 +14,7 @@ fields as ( staging_columns=get_abandoned_checkout_discount_code_columns() ) }} + , row_number() over(partition by checkout_id, discount_id order by index desc) as n from base ), @@ -31,6 +32,7 @@ final as ( _fivetran_synced from fields + where n = 1 ) select * diff --git a/models/stg_shopify__inventory_item.sql b/models/stg_shopify__inventory_item.sql index 100dd0d..7afb730 100644 --- a/models/stg_shopify__inventory_item.sql +++ b/models/stg_shopify__inventory_item.sql @@ -26,7 +26,7 @@ final as ( cost, country_code_of_origin, province_code_of_origin, - requires_shipping, + requires_shipping as is_shipping_required, tracked as is_inventory_quantity_tracked, created_at, updated_at, diff --git a/models/stg_shopify__shop.sql b/models/stg_shopify__shop.sql index 2385407..399dcb7 100644 --- a/models/stg_shopify__shop.sql +++ b/models/stg_shopify__shop.sql @@ -47,7 +47,7 @@ final as ( weight_unit, myshopify_domain, cookie_consent_level, - shop_owner as shop_owner, + shop_owner, source, tax_shipping as has_shipping_taxes, ifnull(taxes_included, false) as has_taxes_included_in_price, From e2c6446ccce3ea0de4659cf8d5fe1d7db48d50ad Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 13:45:37 -0800 Subject: [PATCH 028/137] new fields added but not documented --- macros/get_customer_columns.sql | 31 +++ macros/get_order_adjustment_columns.sql | 18 ++ macros/get_order_columns.sql | 91 +++++++ macros/get_order_line_columns.sql | 41 ++++ macros/get_order_line_refund_columns.sql | 19 ++ macros/get_product_columns.sql | 20 ++ macros/get_product_variant_columns.sql | 34 +++ macros/get_refund_columns.sql | 17 ++ macros/get_transaction_columns.sql | 45 ++++ macros/staging_columns.sql | 287 ----------------------- 10 files changed, 316 insertions(+), 287 deletions(-) create mode 100644 macros/get_customer_columns.sql create mode 100644 macros/get_order_adjustment_columns.sql create mode 100644 macros/get_order_columns.sql create mode 100644 macros/get_order_line_columns.sql create mode 100644 macros/get_order_line_refund_columns.sql create mode 100644 macros/get_product_columns.sql create mode 100644 macros/get_product_variant_columns.sql create mode 100644 macros/get_refund_columns.sql create mode 100644 macros/get_transaction_columns.sql delete mode 100644 macros/staging_columns.sql diff --git a/macros/get_customer_columns.sql b/macros/get_customer_columns.sql new file mode 100644 index 0000000..dbfcceb --- /dev/null +++ b/macros/get_customer_columns.sql @@ -0,0 +1,31 @@ +{% macro get_customer_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "accepts_marketing", "datatype": "boolean", "alias": "has_accepted_marketing"}, + {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, + {"name": "default_address_id", "datatype": dbt.type_numeric()}, + {"name": "email", "datatype": dbt.type_string()}, + {"name": "first_name", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_numeric(), "alias": "customer_id"}, + {"name": "last_name", "datatype": dbt.type_string()}, + {"name": "orders_count", "datatype": dbt.type_numeric()}, + {"name": "phone", "datatype": dbt.type_string()}, + {"name": "state", "datatype": dbt.type_string(), "alias": "account_state"}, + {"name": "tax_exempt", "datatype": "boolean", "alias": "is_tax_exempt"}, + {"name": "total_spent", "datatype": dbt.type_float()}, + {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, + {"name": "verified_email", "datatype": "boolean", "alias": "is_verified_email"}, + {"name": "email_marketing_consent_consent_updated_at", "datatype": dbt.type_timestamp()}, + {"name": "email_marketing_consent_opt_in_level", "datatype": dbt.type_string()}, + {"name": "email_marketing_consent_state", "datatype": dbt.type_string()}, + {"name": "note", "datatype": dbt.type_string()}, + {"name": "accepts_marketing_updated_at", "datatype": dbt.type_timestamp()}, + {"name": "marketing_opt_in_level", "datatype": dbt.type_string()}, + {"name": "lifetime_duration", "datatype": dbt.type_string()}, + {"name": "currency", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_order_adjustment_columns.sql b/macros/get_order_adjustment_columns.sql new file mode 100644 index 0000000..9ff60d5 --- /dev/null +++ b/macros/get_order_adjustment_columns.sql @@ -0,0 +1,18 @@ +{% macro get_order_adjustment_columns() %} + +{% set columns = [ + {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_adjustment_id"}, + {"name": "order_id", "datatype": dbt.type_numeric()}, + {"name": "refund_id", "datatype": dbt.type_numeric()}, + {"name": "amount", "datatype": dbt.type_float()}, + {"name": "amount_set", "datatype": dbt.type_string()}, + {"name": "tax_amount", "datatype": dbt.type_float()}, + {"name": "tax_amount_set", "datatype": dbt.type_string()}, + {"name": "kind", "datatype": dbt.type_string()}, + {"name": "reason", "datatype": dbt.type_string()}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()} +] %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_order_columns.sql b/macros/get_order_columns.sql new file mode 100644 index 0000000..9cac45d --- /dev/null +++ b/macros/get_order_columns.sql @@ -0,0 +1,91 @@ +{% macro get_order_columns() %} + +{% set columns = [ + {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_id"}, + {"name": "processed_at", "datatype": dbt.type_timestamp(), "alias": "processed_timestamp"}, + {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, + {"name": "user_id", "datatype": dbt.type_numeric()}, + {"name": "total_discounts", "datatype": dbt.type_float()}, + {"name": "total_discounts_set", "datatype": dbt.type_string()}, + {"name": "total_line_items_price", "datatype": dbt.type_float()}, + {"name": "total_line_items_price_set", "datatype": dbt.type_string()}, + {"name": "total_price", "datatype": dbt.type_float()}, + {"name": "total_price_set", "datatype": dbt.type_string()}, + {"name": "total_price_usd", "datatype": dbt.type_float()}, + {"name": "total_tax_set", "datatype": dbt.type_string()}, + {"name": "total_tax", "datatype": dbt.type_float()}, + {"name": "source_name", "datatype": dbt.type_string()}, + {"name": "subtotal_price", "datatype": dbt.type_float()}, + {"name": "taxes_included", "datatype": "boolean", "alias": "has_taxes_included"}, + {"name": "total_weight", "datatype": dbt.type_numeric()}, + {"name": "total_tip_received", "datatype": dbt.type_float()}, + {"name": "landing_site_base_url", "datatype": dbt.type_string()}, + {"name": "landing_site_ref", "datatype": dbt.type_string()}, + {"name": "location_id", "datatype": dbt.type_numeric()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "note", "datatype": dbt.type_string()}, + {"name": "number", "datatype": dbt.type_numeric()}, + {"name": "order_number", "datatype": dbt.type_numeric()}, + {"name": "cancel_reason", "datatype": dbt.type_string()}, + {"name": "cancelled_at", "datatype": dbt.type_timestamp(), "alias": "cancelled_timestamp"}, + {"name": "cart_token", "datatype": dbt.type_string()}, + {"name": "checkout_token", "datatype": dbt.type_string()}, + {"name": "closed_at", "datatype": dbt.type_timestamp(), "alias": "closed_timestamp"}, + {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, + {"name": "currency", "datatype": dbt.type_string()}, + {"name": "customer_id", "datatype": dbt.type_numeric()}, + {"name": "email", "datatype": dbt.type_string()}, + {"name": "financial_status", "datatype": dbt.type_string()}, + {"name": "fulfillment_status", "datatype": dbt.type_string()}, + {"name": "processing_method", "datatype": dbt.type_string()}, + {"name": "referring_site", "datatype": dbt.type_string()}, + {"name": "billing_address_address_1", "datatype": dbt.type_string()}, + {"name": "billing_address_address_2", "datatype": dbt.type_string()}, + {"name": "billing_address_city", "datatype": dbt.type_string()}, + {"name": "billing_address_company", "datatype": dbt.type_string()}, + {"name": "billing_address_country", "datatype": dbt.type_string()}, + {"name": "billing_address_country_code", "datatype": dbt.type_string()}, + {"name": "billing_address_first_name", "datatype": dbt.type_string()}, + {"name": "billing_address_last_name", "datatype": dbt.type_string()}, + {"name": "billing_address_latitude", "datatype": dbt.type_string()}, + {"name": "billing_address_longitude", "datatype": dbt.type_string()}, + {"name": "billing_address_name", "datatype": dbt.type_string()}, + {"name": "billing_address_phone", "datatype": dbt.type_string()}, + {"name": "billing_address_province", "datatype": dbt.type_string()}, + {"name": "billing_address_province_code", "datatype": dbt.type_string()}, + {"name": "billing_address_zip", "datatype": dbt.type_string()}, + {"name": "browser_ip", "datatype": dbt.type_string()}, + {"name": "buyer_accepts_marketing", "datatype": "boolean", "alias": "has_buyer_accepted_marketing"}, + {"name": "total_shipping_price_set", "datatype": dbt.type_string()}, + {"name": "shipping_address_address_1", "datatype": dbt.type_string()}, + {"name": "shipping_address_address_2", "datatype": dbt.type_string()}, + {"name": "shipping_address_city", "datatype": dbt.type_string()}, + {"name": "shipping_address_company", "datatype": dbt.type_string()}, + {"name": "shipping_address_country", "datatype": dbt.type_string()}, + {"name": "shipping_address_country_code", "datatype": dbt.type_string()}, + {"name": "shipping_address_first_name", "datatype": dbt.type_string()}, + {"name": "shipping_address_last_name", "datatype": dbt.type_string()}, + {"name": "shipping_address_latitude", "datatype": dbt.type_string()}, + {"name": "shipping_address_longitude", "datatype": dbt.type_string()}, + {"name": "shipping_address_name", "datatype": dbt.type_string()}, + {"name": "shipping_address_phone", "datatype": dbt.type_string()}, + {"name": "shipping_address_province", "datatype": dbt.type_string()}, + {"name": "shipping_address_province_code", "datatype": dbt.type_string()}, + {"name": "shipping_address_zip", "datatype": dbt.type_string()}, + {"name": "test", "datatype": "boolean", "alias": "is_test_order"}, + {"name": "token", "datatype": dbt.type_string()}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "app_id", "datatype": dbt.type_int()}, + {"name": "checkout_id", "datatype": dbt.type_int()}, + {"name": "client_details_user_agent", "datatype": dbt.type_string()}, + {"name": "customer_locale", "datatype": dbt.type_string()}, + {"name": "device_id", "datatype": dbt.type_string()}, + {"name": "order_status_url", "datatype": dbt.type_string()}, + {"name": "presentment_currency", "datatype": dbt.type_string()}, + {"name": "confirmed", "datatype": "boolean"} +] %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_order_line_columns.sql b/macros/get_order_line_columns.sql new file mode 100644 index 0000000..877c431 --- /dev/null +++ b/macros/get_order_line_columns.sql @@ -0,0 +1,41 @@ +{% macro get_order_line_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "fulfillable_quantity", "datatype": dbt.type_numeric()}, + {"name": "fulfillment_service", "datatype": dbt.type_string()}, + {"name": "fulfillment_status", "datatype": dbt.type_string()}, + {"name": "gift_card", "datatype": "boolean", "alias": "is_gift_card"}, + {"name": "grams", "datatype": dbt.type_numeric()}, + {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_line_id"}, + {"name": "index", "datatype": dbt.type_numeric()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "order_id", "datatype": dbt.type_numeric()}, + {"name": "pre_tax_price", "datatype": dbt.type_float()}, + {"name": "pre_tax_price_set", "datatype": dbt.type_string()}, + {"name": "price", "datatype": dbt.type_float()}, + {"name": "price_set", "datatype": dbt.type_string()}, + {"name": "product_id", "datatype": dbt.type_numeric()}, + {"name": "property_charge_interval_frequency", "datatype": dbt.type_numeric()}, + {"name": "property_for_shipping_jan_3_rd_2020", "datatype": dbt.type_string()}, + {"name": "property_shipping_interval_frequency", "datatype": dbt.type_numeric()}, + {"name": "property_shipping_interval_unit_type", "datatype": dbt.type_string()}, + {"name": "property_subscription_id", "datatype": dbt.type_numeric()}, + {"name": "quantity", "datatype": dbt.type_numeric()}, + {"name": "requires_shipping", "datatype": "boolean", "alias": "is_requiring_shipping"}, + {"name": "sku", "datatype": dbt.type_string()}, + {"name": "taxable", "datatype": "boolean", "alias": "is_taxable"}, + {"name": "tax_code", "datatype": dbt.type_string()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "total_discount", "datatype": dbt.type_float()}, + {"name": "total_discount_set", "datatype": dbt.type_string()}, + {"name": "variant_id", "datatype": dbt.type_numeric()}, + {"name": "variant_title", "datatype": dbt.type_string()}, + {"name": "variant_inventory_management", "datatype": dbt.type_string()}, + {"name": "vendor", "datatype": dbt.type_string()}, + {"name": "properties", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_order_line_refund_columns.sql b/macros/get_order_line_refund_columns.sql new file mode 100644 index 0000000..696ffe0 --- /dev/null +++ b/macros/get_order_line_refund_columns.sql @@ -0,0 +1,19 @@ +{% macro get_order_line_refund_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_line_refund_id"}, + {"name": "location_id", "datatype": dbt.type_numeric()}, + {"name": "order_line_id", "datatype": dbt.type_numeric()}, + {"name": "subtotal", "datatype": dbt.type_numeric()}, + {"name": "subtotal_set", "datatype": dbt.type_string()}, + {"name": "total_tax", "datatype": dbt.type_numeric()}, + {"name": "total_tax_set", "datatype": dbt.type_string()}, + {"name": "quantity", "datatype": dbt.type_float()}, + {"name": "refund_id", "datatype": dbt.type_numeric()}, + {"name": "restock_type", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_product_columns.sql b/macros/get_product_columns.sql new file mode 100644 index 0000000..6f679f9 --- /dev/null +++ b/macros/get_product_columns.sql @@ -0,0 +1,20 @@ +{% macro get_product_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, + {"name": "handle", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_numeric(), "alias": "product_id"}, + {"name": "product_type", "datatype": dbt.type_string()}, + {"name": "published_at", "datatype": dbt.type_timestamp(), "alias": "published_timestamp"}, + {"name": "published_scope", "datatype": dbt.type_string()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, + {"name": "vendor", "datatype": dbt.type_string()}, + {"name": "status", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_product_variant_columns.sql b/macros/get_product_variant_columns.sql new file mode 100644 index 0000000..f1b6e7b --- /dev/null +++ b/macros/get_product_variant_columns.sql @@ -0,0 +1,34 @@ +{% macro get_product_variant_columns() %} + +{% set columns = [ + {"name": "id", "datatype": dbt.type_numeric(), "alias": "variant_id"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, + {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, + {"name": "product_id", "datatype": dbt.type_numeric()}, + {"name": "inventory_item_id", "datatype": dbt.type_numeric()}, + {"name": "image_id", "datatype": dbt.type_numeric()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "price", "datatype": dbt.type_float()}, + {"name": "sku", "datatype": dbt.type_string()}, + {"name": "position", "datatype": dbt.type_numeric()}, + {"name": "inventory_policy", "datatype": dbt.type_string()}, + {"name": "compare_at_price", "datatype": dbt.type_float()}, + {"name": "fulfillment_service", "datatype": dbt.type_string()}, + {"name": "inventory_management", "datatype": dbt.type_string()}, + {"name": "taxable", "datatype": "boolean", "alias": "is_taxable"}, + {"name": "barcode", "datatype": dbt.type_string()}, + {"name": "grams", "datatype": dbt.type_float()}, + {"name": "inventory_quantity", "datatype": dbt.type_numeric()}, + {"name": "weight", "datatype": dbt.type_float()}, + {"name": "weight_unit", "datatype": dbt.type_string()}, + {"name": "option_1", "datatype": dbt.type_string()}, + {"name": "option_2", "datatype": dbt.type_string()}, + {"name": "option_3", "datatype": dbt.type_string()}, + {"name": "tax_code", "datatype": dbt.type_string()}, + {"name": "requires_shipping", "datatype": "boolean", "alias": "is_requiring_shipping"} +] %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_refund_columns.sql b/macros/get_refund_columns.sql new file mode 100644 index 0000000..9845a10 --- /dev/null +++ b/macros/get_refund_columns.sql @@ -0,0 +1,17 @@ +{% macro get_refund_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_numeric(), "alias": "refund_id"}, + {"name": "note", "datatype": dbt.type_string()}, + {"name": "order_id", "datatype": dbt.type_numeric()}, + {"name": "processed_at", "datatype": dbt.type_timestamp()}, + {"name": "restock", "datatype": "boolean"}, + {"name": "total_duties_set", "datatype": dbt.type_string()}, + {"name": "user_id", "datatype": dbt.type_numeric()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_transaction_columns.sql b/macros/get_transaction_columns.sql new file mode 100644 index 0000000..0e7d9ab --- /dev/null +++ b/macros/get_transaction_columns.sql @@ -0,0 +1,45 @@ +{% macro get_transaction_columns() %} + +{% set columns = [ + {"name": "id", "datatype": dbt.type_numeric(), "alias": "transaction_id"}, + {"name": "order_id", "datatype": dbt.type_numeric()}, + {"name": "refund_id", "datatype": dbt.type_numeric()}, + {"name": "amount", "datatype": dbt.type_numeric()}, + {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, + {"name": "processed_at", "datatype": dbt.type_timestamp(), "alias": "processed_timestamp"}, + {"name": "device_id", "datatype": dbt.type_numeric()}, + {"name": "gateway", "datatype": dbt.type_string()}, + {"name": "source_name", "datatype": dbt.type_string()}, + {"name": "message", "datatype": dbt.type_string()}, + {"name": "currency", "datatype": dbt.type_string()}, + {"name": "location_id", "datatype": dbt.type_numeric()}, + {"name": "parent_id", "datatype": dbt.type_numeric()}, + {"name": "payment_avs_result_code", "datatype": dbt.type_string()}, + {"name": "payment_credit_card_bin", "datatype": dbt.type_string()}, + {"name": "payment_cvv_result_code", "datatype": dbt.type_string()}, + {"name": "payment_credit_card_number", "datatype": dbt.type_string()}, + {"name": "payment_credit_card_company", "datatype": dbt.type_string()}, + {"name": "kind", "datatype": dbt.type_string()}, + {"name": "receipt", "datatype": dbt.type_string()}, + {"name": "currency_exchange_id", "datatype": dbt.type_numeric()}, + {"name": "currency_exchange_adjustment", "datatype": dbt.type_numeric()}, + {"name": "currency_exchange_original_amount", "datatype": dbt.type_numeric()}, + {"name": "currency_exchange_final_amount", "datatype": dbt.type_numeric()}, + {"name": "currency_exchange_currency", "datatype": dbt.type_string()}, + {"name": "error_code", "datatype": dbt.type_string()}, + {"name": "status", "datatype": dbt.type_string()}, + {"name": "test", "datatype": "boolean"}, + {"name": "user_id", "datatype": dbt.type_numeric()}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "authorization_expires_at", "datatype": dbt.type_timestamp()} +] %} + +{% if target.type in ('redshift','postgres') %} + {{ columns.append({"name": "authorization", "datatype": dbt.type_string(), "quote": True, "alias": "authorization"}) }} +{% else %} + {"name": "authorization", "datatype": dbt.type_string()} +{% endif %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/staging_columns.sql b/macros/staging_columns.sql deleted file mode 100644 index a147538..0000000 --- a/macros/staging_columns.sql +++ /dev/null @@ -1,287 +0,0 @@ -{% macro get_order_columns() %} - -{% set columns = [ - {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_id"}, - {"name": "processed_at", "datatype": dbt.type_timestamp(), "alias": "processed_timestamp"}, - {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, - {"name": "user_id", "datatype": dbt.type_numeric()}, - {"name": "total_discounts", "datatype": dbt.type_float()}, - {"name": "total_line_items_price", "datatype": dbt.type_float()}, - {"name": "total_price", "datatype": dbt.type_float()}, - {"name": "total_tax", "datatype": dbt.type_float()}, - {"name": "source_name", "datatype": dbt.type_string()}, - {"name": "subtotal_price", "datatype": dbt.type_float()}, - {"name": "taxes_included", "datatype": "boolean", "alias": "has_taxes_included"}, - {"name": "total_weight", "datatype": dbt.type_numeric()}, - {"name": "landing_site_base_url", "datatype": dbt.type_string()}, - {"name": "location_id", "datatype": dbt.type_numeric()}, - {"name": "name", "datatype": dbt.type_string()}, - {"name": "note", "datatype": dbt.type_string()}, - {"name": "number", "datatype": dbt.type_numeric()}, - {"name": "order_number", "datatype": dbt.type_numeric()}, - {"name": "cancel_reason", "datatype": dbt.type_string()}, - {"name": "cancelled_at", "datatype": dbt.type_timestamp(), "alias": "cancelled_timestamp"}, - {"name": "cart_token", "datatype": dbt.type_string()}, - {"name": "checkout_token", "datatype": dbt.type_string()}, - {"name": "closed_at", "datatype": dbt.type_timestamp(), "alias": "closed_timestamp"}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "currency", "datatype": dbt.type_string()}, - {"name": "customer_id", "datatype": dbt.type_numeric()}, - {"name": "email", "datatype": dbt.type_string()}, - {"name": "financial_status", "datatype": dbt.type_string()}, - {"name": "fulfillment_status", "datatype": dbt.type_string()}, - {"name": "processing_method", "datatype": dbt.type_string()}, - {"name": "referring_site", "datatype": dbt.type_string()}, - {"name": "billing_address_address_1", "datatype": dbt.type_string()}, - {"name": "billing_address_address_2", "datatype": dbt.type_string()}, - {"name": "billing_address_city", "datatype": dbt.type_string()}, - {"name": "billing_address_company", "datatype": dbt.type_string()}, - {"name": "billing_address_country", "datatype": dbt.type_string()}, - {"name": "billing_address_country_code", "datatype": dbt.type_string()}, - {"name": "billing_address_first_name", "datatype": dbt.type_string()}, - {"name": "billing_address_last_name", "datatype": dbt.type_string()}, - {"name": "billing_address_latitude", "datatype": dbt.type_string()}, - {"name": "billing_address_longitude", "datatype": dbt.type_string()}, - {"name": "billing_address_name", "datatype": dbt.type_string()}, - {"name": "billing_address_phone", "datatype": dbt.type_string()}, - {"name": "billing_address_province", "datatype": dbt.type_string()}, - {"name": "billing_address_province_code", "datatype": dbt.type_string()}, - {"name": "billing_address_zip", "datatype": dbt.type_string()}, - {"name": "browser_ip", "datatype": dbt.type_string()}, - {"name": "buyer_accepts_marketing", "datatype": "boolean", "alias": "has_buyer_accepted_marketing"}, - {"name": "total_shipping_price_set", "datatype": dbt.type_string()}, - {"name": "shipping_address_address_1", "datatype": dbt.type_string()}, - {"name": "shipping_address_address_2", "datatype": dbt.type_string()}, - {"name": "shipping_address_city", "datatype": dbt.type_string()}, - {"name": "shipping_address_company", "datatype": dbt.type_string()}, - {"name": "shipping_address_country", "datatype": dbt.type_string()}, - {"name": "shipping_address_country_code", "datatype": dbt.type_string()}, - {"name": "shipping_address_first_name", "datatype": dbt.type_string()}, - {"name": "shipping_address_last_name", "datatype": dbt.type_string()}, - {"name": "shipping_address_latitude", "datatype": dbt.type_string()}, - {"name": "shipping_address_longitude", "datatype": dbt.type_string()}, - {"name": "shipping_address_name", "datatype": dbt.type_string()}, - {"name": "shipping_address_phone", "datatype": dbt.type_string()}, - {"name": "shipping_address_province", "datatype": dbt.type_string()}, - {"name": "shipping_address_province_code", "datatype": dbt.type_string()}, - {"name": "shipping_address_zip", "datatype": dbt.type_string()}, - {"name": "test", "datatype": "boolean", "alias": "is_test_order"}, - {"name": "token", "datatype": dbt.type_string()}, - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_customer_columns() %} - -{% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "accepts_marketing", "datatype": "boolean", "alias": "has_accepted_marketing"}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "default_address_id", "datatype": dbt.type_numeric()}, - {"name": "email", "datatype": dbt.type_string()}, - {"name": "first_name", "datatype": dbt.type_string()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "customer_id"}, - {"name": "last_name", "datatype": dbt.type_string()}, - {"name": "orders_count", "datatype": dbt.type_numeric()}, - {"name": "phone", "datatype": dbt.type_string()}, - {"name": "state", "datatype": dbt.type_string(), "alias": "account_state"}, - {"name": "tax_exempt", "datatype": "boolean", "alias": "is_tax_exempt"}, - {"name": "total_spent", "datatype": dbt.type_float()}, - {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, - {"name": "verified_email", "datatype": "boolean", "alias": "is_verified_email"} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_order_line_refund_columns() %} - -{% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_line_refund_id"}, - {"name": "location_id", "datatype": dbt.type_numeric()}, - {"name": "order_line_id", "datatype": dbt.type_numeric()}, - {"name": "subtotal", "datatype": dbt.type_numeric()}, - {"name": "total_tax", "datatype": dbt.type_numeric()}, - {"name": "quantity", "datatype": dbt.type_float()}, - {"name": "refund_id", "datatype": dbt.type_numeric()}, - {"name": "restock_type", "datatype": dbt.type_string()} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_order_line_columns() %} - -{% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "fulfillable_quantity", "datatype": dbt.type_numeric()}, - {"name": "fulfillment_service", "datatype": dbt.type_string()}, - {"name": "fulfillment_status", "datatype": dbt.type_string()}, - {"name": "gift_card", "datatype": "boolean", "alias": "is_gift_card"}, - {"name": "grams", "datatype": dbt.type_numeric()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_line_id"}, - {"name": "index", "datatype": dbt.type_numeric()}, - {"name": "name", "datatype": dbt.type_string()}, - {"name": "order_id", "datatype": dbt.type_numeric()}, - {"name": "pre_tax_price", "datatype": dbt.type_float()}, - {"name": "price", "datatype": dbt.type_float()}, - {"name": "product_id", "datatype": dbt.type_numeric()}, - {"name": "property_charge_interval_frequency", "datatype": dbt.type_numeric()}, - {"name": "property_for_shipping_jan_3_rd_2020", "datatype": dbt.type_string()}, - {"name": "property_shipping_interval_frequency", "datatype": dbt.type_numeric()}, - {"name": "property_shipping_interval_unit_type", "datatype": dbt.type_string()}, - {"name": "property_subscription_id", "datatype": dbt.type_numeric()}, - {"name": "quantity", "datatype": dbt.type_numeric()}, - {"name": "requires_shipping", "datatype": "boolean", "alias": "is_requiring_shipping"}, - {"name": "sku", "datatype": dbt.type_string()}, - {"name": "taxable", "datatype": "boolean", "alias": "is_taxable"}, - {"name": "title", "datatype": dbt.type_string()}, - {"name": "total_discount", "datatype": dbt.type_float()}, - {"name": "variant_id", "datatype": dbt.type_numeric()}, - {"name": "vendor", "datatype": dbt.type_string()} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_product_columns() %} - -{% set columns = [ - {"name": "_fivetran_deleted", "datatype": "boolean"}, - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "handle", "datatype": dbt.type_string()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "product_id"}, - {"name": "product_type", "datatype": dbt.type_string()}, - {"name": "published_at", "datatype": dbt.type_timestamp(), "alias": "published_timestamp"}, - {"name": "published_scope", "datatype": dbt.type_string()}, - {"name": "title", "datatype": dbt.type_string()}, - {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, - {"name": "vendor", "datatype": dbt.type_string()} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_product_variant_columns() %} - -{% set columns = [ - {"name": "id", "datatype": dbt.type_numeric(), "alias": "variant_id"}, - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, - {"name": "product_id", "datatype": dbt.type_numeric()}, - {"name": "inventory_item_id", "datatype": dbt.type_numeric()}, - {"name": "image_id", "datatype": dbt.type_numeric()}, - {"name": "title", "datatype": dbt.type_string()}, - {"name": "price", "datatype": dbt.type_float()}, - {"name": "sku", "datatype": dbt.type_string()}, - {"name": "position", "datatype": dbt.type_numeric()}, - {"name": "inventory_policy", "datatype": dbt.type_string()}, - {"name": "compare_at_price", "datatype": dbt.type_float()}, - {"name": "fulfillment_service", "datatype": dbt.type_string()}, - {"name": "inventory_management", "datatype": dbt.type_string()}, - {"name": "taxable", "datatype": "boolean", "alias": "is_taxable"}, - {"name": "barcode", "datatype": dbt.type_string()}, - {"name": "grams", "datatype": dbt.type_float()}, - {"name": "inventory_quantity", "datatype": dbt.type_numeric()}, - {"name": "weight", "datatype": dbt.type_float()}, - {"name": "weight_unit", "datatype": dbt.type_string()}, - {"name": "option_1", "datatype": dbt.type_string()}, - {"name": "option_2", "datatype": dbt.type_string()}, - {"name": "option_3", "datatype": dbt.type_string()}, - {"name": "tax_code", "datatype": dbt.type_string()}, - {"name": "old_inventory_quantity", "datatype": dbt.type_numeric()}, - {"name": "requires_shipping", "datatype": "boolean", "alias": "is_requiring_shipping"} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_transaction_columns() %} - -{% set columns = [ - {"name": "id", "datatype": dbt.type_numeric(), "alias": "transaction_id"}, - {"name": "order_id", "datatype": dbt.type_numeric()}, - {"name": "refund_id", "datatype": dbt.type_numeric()}, - {"name": "amount", "datatype": dbt.type_numeric()}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "processed_at", "datatype": dbt.type_timestamp(), "alias": "processed_timestamp"}, - {"name": "device_id", "datatype": dbt.type_numeric()}, - {"name": "gateway", "datatype": dbt.type_string()}, - {"name": "source_name", "datatype": dbt.type_string()}, - {"name": "message", "datatype": dbt.type_string()}, - {"name": "currency", "datatype": dbt.type_string()}, - {"name": "location_id", "datatype": dbt.type_numeric()}, - {"name": "parent_id", "datatype": dbt.type_numeric()}, - {"name": "payment_avs_result_code", "datatype": dbt.type_string()}, - {"name": "payment_credit_card_bin", "datatype": dbt.type_string()}, - {"name": "payment_cvv_result_code", "datatype": dbt.type_string()}, - {"name": "payment_credit_card_number", "datatype": dbt.type_string()}, - {"name": "payment_credit_card_company", "datatype": dbt.type_string()}, - {"name": "kind", "datatype": dbt.type_string()}, - {"name": "receipt", "datatype": dbt.type_string()}, - {"name": "currency_exchange_id", "datatype": dbt.type_numeric()}, - {"name": "currency_exchange_adjustment", "datatype": dbt.type_numeric()}, - {"name": "currency_exchange_original_amount", "datatype": dbt.type_numeric()}, - {"name": "currency_exchange_final_amount", "datatype": dbt.type_numeric()}, - {"name": "currency_exchange_currency", "datatype": dbt.type_string()}, - {"name": "error_code", "datatype": dbt.type_string()}, - {"name": "status", "datatype": dbt.type_string()}, - {"name": "test", "datatype": "boolean"}, - {"name": "user_id", "datatype": dbt.type_numeric()}, - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()} -] %} - -{% if target.type in ('redshift','postgres') %} - {{ columns.append({"name": "authorization", "datatype": dbt.type_string(), "quote": True, "alias": "authorization"}) }} -{% else %} - {"name": "authorization", "datatype": dbt.type_string()} -{% endif %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_refund_columns() %} - -{% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "created_at", "datatype": dbt.type_timestamp()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "refund_id"}, - {"name": "note", "datatype": dbt.type_string()}, - {"name": "order_id", "datatype": dbt.type_numeric()}, - {"name": "processed_at", "datatype": dbt.type_timestamp()}, - {"name": "restock", "datatype": "boolean"}, - {"name": "user_id", "datatype": dbt.type_numeric()} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_order_adjustment_columns() %} - -{% set columns = [ - {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_adjustment_id"}, - {"name": "order_id", "datatype": dbt.type_numeric()}, - {"name": "refund_id", "datatype": dbt.type_numeric()}, - {"name": "amount", "datatype": dbt.type_float()}, - {"name": "tax_amount", "datatype": dbt.type_float()}, - {"name": "kind", "datatype": dbt.type_string()}, - {"name": "reason", "datatype": dbt.type_string()}, - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()} -] %} - -{{ return(columns) }} - -{% endmacro %} From 9d2878e2fc215d70dcd4afd0288c7976f3a0d022 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 13:58:48 -0800 Subject: [PATCH 029/137] buildkite --- .../seeds/shopify_ order_note_attribute_data.csv | 10 +++++----- .../seeds/shopify_abandoned_checkout_data.csv | 6 +++--- .../shopify_abandoned_checkout_discount_code_data.csv | 6 +++--- integration_tests/seeds/shopify_collection_data.csv | 6 +++--- .../seeds/shopify_collection_product_data.csv | 6 +++--- integration_tests/seeds/shopify_customer_tag_data.csv | 6 +++--- integration_tests/seeds/shopify_discount_code_data.csv | 6 +++--- integration_tests/seeds/shopify_fulfillment_data.csv | 6 +++--- .../seeds/shopify_inventory_item_data.csv | 6 +++--- .../seeds/shopify_inventory_level_data.csv | 6 +++--- integration_tests/seeds/shopify_location_data.csv | 4 ++-- integration_tests/seeds/shopify_metafield_data.csv | 10 +++++----- .../seeds/shopify_order_discount_code_data.csv | 6 +++--- .../seeds/shopify_order_shipping_line_data.csv | 6 +++--- .../seeds/shopify_order_shipping_tax_line_data.csv | 6 +++--- integration_tests/seeds/shopify_order_tag_data.csv | 6 +++--- integration_tests/seeds/shopify_order_url_tag_data.csv | 6 +++--- integration_tests/seeds/shopify_price_rule_data.csv | 6 +++--- integration_tests/seeds/shopify_product_image_data.csv | 6 +++--- integration_tests/seeds/shopify_product_tag_data.csv | 10 +++++----- integration_tests/seeds/shopify_shop_data.csv | 2 +- .../seeds/shopify_tender_transaction_data.csv | 10 +++++----- 22 files changed, 71 insertions(+), 71 deletions(-) diff --git a/integration_tests/seeds/shopify_ order_note_attribute_data.csv b/integration_tests/seeds/shopify_ order_note_attribute_data.csv index edd6851..a3f2e92 100644 --- a/integration_tests/seeds/shopify_ order_note_attribute_data.csv +++ b/integration_tests/seeds/shopify_ order_note_attribute_data.csv @@ -1,6 +1,6 @@ name,order_id,_fivetran_synced,value -last_name,41234171115,2022-11-19 07:30:28.480000,"""1418143823.1643992155""" -first_name,41234171115,2022-11-19 07:30:28.480000,"""fb.1.1643992155109.1110590605""" -updated_at,41234171115,2022-11-19 07:30:28.480000,"""1643992163253""" -clientID,41234171115,2022-11-19 07:30:28.480000,"""a03d3118-4048-4159-b5bb-1b90d8abb69b""" -name,41234171115,2022-11-19 07:30:28.480000,"""22707603636395""" \ No newline at end of file +last_name,34171115,2022-11-19 07:30:28.480000,"""1418143823.1643992155""" +first_name,34171115,2022-11-19 07:30:28.480000,"""fb.1.1643992155109.1110590605""" +updated_at,34171115,2022-11-19 07:30:28.480000,"""1643992163253""" +clientID,34171115,2022-11-19 07:30:28.480000,"""a03d3118-4048-4159-b5bb-1b90d8abb69b""" +name,34171115,2022-11-19 07:30:28.480000,"""22707603636395""" \ No newline at end of file diff --git a/integration_tests/seeds/shopify_abandoned_checkout_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_data.csv index af790e4..9c4971a 100644 --- a/integration_tests/seeds/shopify_abandoned_checkout_data.csv +++ b/integration_tests/seeds/shopify_abandoned_checkout_data.csv @@ -1,4 +1,4 @@ id,_fivetran_synced,abandoned_checkout_url,applied_discount_amount,applied_discount_applicable,applied_discount_description,applied_discount_non_applicable_reason,applied_discount_title,applied_discount_value,applied_discount_value_type,billing_address_address_1,billing_address_address_0,billing_address_city,billing_address_company,billing_address_country,billing_address_country_code,billing_address_first_name,billing_address_last_name,billing_address_latitude,billing_address_longitude,billing_address_name,billing_address_phone,billing_address_province,billing_address_province_code,billing_address_zip,buyer_accepts_marketing,cart_token,closed_at,completed_at,created_at,credit_card_first_name,credit_card_last_name,credit_card_month,credit_card_number,credit_card_verification_value,credit_card_year,currency,customer_id,customer_locale,device_id,email,gateway,landing_site_base_url,location_id,name,note,phone,referring_site,shipping_address_address_1,shipping_address_address_0,shipping_address_city,shipping_address_company,shipping_address_country,shipping_address_country_code,shipping_address_first_name,shipping_address_last_name,shipping_address_latitude,shipping_address_longitude,shipping_address_name,shipping_address_phone,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_line,shipping_rate_id,shipping_rate_price,shipping_rate_title,source,source_identifier,source_name,source_url,subtotal_price,taxes_included,token,total_discounts,total_line_items_price,total_price,total_tax,total_weight,updated_at,user_id,note_attribute_littledata_updated_at,note_attribute_segment_client_id,billing_address_id,billing_address_is_default,presentment_currency,shipping_address_id,shipping_address_is_default,total_duties,note_attribute_email_client_id,note_attributes,note_attribute_google_client_id,_fivetran_deleted -10160311112111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,110f5eb2fd1d11211311311622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,1101311111121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311112111,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.1115111,-26.1126062,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda125a10cca513162f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, -13051511101311,2020-01-11 06:01:35.021111,https://kitties.com/1111311610/checkouts/6661ff02165dfd11b12db112f0111226/recover?key=51611efdff11e0caccc0fd30b0e1e202,,,,,,,,village,Apt 0,daytona Beach,,Florida,US,ohio,Calles,1.126113511111111,-21.502661,hi,+50266111110,Healdsburg,PA-11,,false,611faa630ce5e6bcc0bacc2a105c0126,,,2020-05-11 01:01:30.111111,,,,,,,USD,3021350266525,en,,hyrehher@gmail.com,,/collections/sale,,#13051511101311,,,https://www.google.com/,123 main st,Pty 3,ghreiuhtg,,United States,US,ohio,Calle pty115,,,ohio Calle pty115,+12161115152,Florida,FL,33120,,,,,,,web,,10.35,false,6661ff02165dfd11b12db112f0111226,16.65,111.0,10.35,1.0,1,2020-05-11 01:06:35.111111,,,,,,,,,,,,, -11151102066531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,1110c010361e1d11a0d613f3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,1620110310363,en,,hernebbe@hr.com,,/collections/new,,#11151102066531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,1abddd111c0211f1e616ec0d0c32021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,1613121625150,610a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file +12111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,110f5eb2fd1d11211311311622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,1101311111121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311112111,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.1115111,-26.1126062,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda125a10cca513162f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, +11101311,2020-01-11 06:01:35.021111,https://kitties.com/1111311610/checkouts/6661ff02165dfd11b12db112f0111226/recover?key=51611efdff11e0caccc0fd30b0e1e202,,,,,,,,village,Apt 0,daytona Beach,,Florida,US,ohio,Calles,1.126113511111111,-21.502661,hi,+50266111110,Healdsburg,PA-11,,false,611faa630ce5e6bcc0bacc2a105c0126,,,2020-05-11 01:01:30.111111,,,,,,,USD,3021350266525,en,,hyrehher@gmail.com,,/collections/sale,,#13051511101311,,,https://www.google.com/,123 main st,Pty 3,ghreiuhtg,,United States,US,ohio,Calle pty115,,,ohio Calle pty115,+12161115152,Florida,FL,33120,,,,,,,web,,10.35,false,6661ff02165dfd11b12db112f0111226,16.65,111.0,10.35,1.0,1,2020-05-11 01:06:35.111111,,,,,,,,,,,,, +066531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,1110c010361e1d11a0d613f3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,1620110310363,en,,hernebbe@hr.com,,/collections/new,,#11151102066531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,1abddd111c0211f1e616ec0d0c32021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,1613121625150,610a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_abandoned_checkout_discount_code_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_discount_code_data.csv index ccc5f56..56f6408 100644 --- a/integration_tests/seeds/shopify_abandoned_checkout_discount_code_data.csv +++ b/integration_tests/seeds/shopify_abandoned_checkout_discount_code_data.csv @@ -1,4 +1,4 @@ checkout_id,index,_fivetran_synced,amount,discount_id,code,created_at,type,updated_at,usage_count -12451602901163,0,2022-12-07 06:49:37.929000,0.0,,CYBER12,,percentage,, -24353554334827,0,2022-12-07 06:49:37.926000,0.0,,CYBER12,,percentage,, -24391234566403,0,2022-12-07 06:49:33.182000,0.0,,BONUS,,percentage,, \ No newline at end of file +901163,0,2022-12-07 06:49:37.929000,0.0,,CYBER12,,percentage,, +4334827,0,2022-12-07 06:49:37.926000,0.0,,CYBER12,,percentage,, +4566403,0,2022-12-07 06:49:33.182000,0.0,,BONUS,,percentage,, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_collection_data.csv b/integration_tests/seeds/shopify_collection_data.csv index 85cd722..858d15b 100644 --- a/integration_tests/seeds/shopify_collection_data.csv +++ b/integration_tests/seeds/shopify_collection_data.csv @@ -1,4 +1,4 @@ id,_fivetran_deleted,_fivetran_synced,handle,published_at,published_scope,title,updated_at,disjunctive,rules,sort_order,template_suffix,body_html -23999997355,true,2021-09-01 05:53:25.838000,,,,,1970-01-01 00:00:00.000000,,,,, -23599930779,true,2021-09-01 05:53:26.673000,,,,,1970-01-01 00:00:00.000000,,,,, -23454599967,true,2022-04-08 06:52:19.524000,,,,,1970-01-01 00:00:00.000000,,,,, \ No newline at end of file +997355,true,2021-09-01 05:53:25.838000,,,,,1970-01-01 00:00:00.000000,,,,, +9930779,true,2021-09-01 05:53:26.673000,,,,,1970-01-01 00:00:00.000000,,,,, +99967,true,2022-04-08 06:52:19.524000,,,,,1970-01-01 00:00:00.000000,,,,, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_collection_product_data.csv b/integration_tests/seeds/shopify_collection_product_data.csv index c35cd72..b269955 100644 --- a/integration_tests/seeds/shopify_collection_product_data.csv +++ b/integration_tests/seeds/shopify_collection_product_data.csv @@ -1,4 +1,4 @@ collection_id,product_id,_fivetran_synced -129999037124,7000164489131,2022-11-18 21:32:43.188000 -129999037124,72384654353899,2022-11-18 21:32:43.188000 -129999037124,7244664618891,2022-11-18 21:32:43.188000 \ No newline at end of file +37124,7000164489131,2022-11-18 21:32:43.188000 +9037124,72384654353899,2022-11-18 21:32:43.188000 +37124,7244664618891,2022-11-18 21:32:43.188000 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_customer_tag_data.csv b/integration_tests/seeds/shopify_customer_tag_data.csv index 55c9a2f..b94bcab 100644 --- a/integration_tests/seeds/shopify_customer_tag_data.csv +++ b/integration_tests/seeds/shopify_customer_tag_data.csv @@ -1,4 +1,4 @@ customer_id,index,_fivetran_synced,value -18999779919268,1,2022-12-03 06:49:03.314000,GGPP -18037777794404,1,2022-12-03 06:48:53.295000,GGPP -18055555509188,1,2022-12-03 06:48:55.067000,GGPP \ No newline at end of file +9919268,1,2022-12-03 06:49:03.314000,GGPP +4404,1,2022-12-03 06:48:53.295000,GGPP +5509188,1,2022-12-03 06:48:55.067000,GGPP \ No newline at end of file diff --git a/integration_tests/seeds/shopify_discount_code_data.csv b/integration_tests/seeds/shopify_discount_code_data.csv index 17924da..ca1f48b 100644 --- a/integration_tests/seeds/shopify_discount_code_data.csv +++ b/integration_tests/seeds/shopify_discount_code_data.csv @@ -1,4 +1,4 @@ id,_fivetran_synced,code,created_at,price_rule_id,updated_at,usage_count -45656764773499,2021-12-10 07:04:44.670000,CHECKVB34DDBQ3VH,2021-12-10 06:48:35.000000,126331232543,2021-12-10 06:48:35.000000,0.0 -12345630436267,2021-12-10 07:04:44.670000,CHECKVBLJG22DDD,2021-12-10 06:48:35.000000,126331232543,2021-12-10 06:48:35.000000,0.0 -12345667469035,2021-12-10 07:04:44.670000,CHECKV44CCCBCWB7,2021-12-10 06:48:35.000000,126331232543,2021-12-10 06:48:35.000000,0.0 \ No newline at end of file +4773499,2021-12-10 07:04:44.670000,CHECKVB34DDBQ3VH,2021-12-10 06:48:35.000000,32543,2021-12-10 06:48:35.000000,0.0 +0436267,2021-12-10 07:04:44.670000,CHECKVBLJG22DDD,2021-12-10 06:48:35.000000,12543,2021-12-10 06:48:35.000000,0.0 +469035,2021-12-10 07:04:44.670000,CHECKV44CCCBCWB7,2021-12-10 06:48:35.000000,12543,2021-12-10 06:48:35.000000,0.0 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_fulfillment_data.csv b/integration_tests/seeds/shopify_fulfillment_data.csv index ac536b1..ba588fa 100644 --- a/integration_tests/seeds/shopify_fulfillment_data.csv +++ b/integration_tests/seeds/shopify_fulfillment_data.csv @@ -1,4 +1,4 @@ id,_fivetran_synced,created_at,location_id,order_id,status,tracking_company,tracking_number,updated_at,tracking_numbers,tracking_urls,shipment_status,service,name,receipt_authorization -1172342423844,2022-11-22 08:06:32.902000,2019-07-13 01:17:22.000000,12334444548,12744443728100,success,,,2019-07-13 01:17:22.000000,[],[],,manual,#151212.1, -1174444448308,2022-11-22 08:06:33.863000,2019-07-13 01:17:21.000000,12334444548,12744443662564,success,,,2019-07-13 01:17:22.000000,[],[],,manual,#152317.1, -11755555548932,2022-11-22 08:06:56.262000,2019-07-13 01:17:21.000000,12334444548,1274944444884,success,,,2019-07-13 01:17:21.000000,[],[],,manual,#1555923.1, \ No newline at end of file +423844,2022-11-22 08:06:32.902000,2019-07-13 01:17:22.000000,123548,1228100,success,,,2019-07-13 01:17:22.000000,[],[],,manual,#151212.1, +8308,2022-11-22 08:06:33.863000,2019-07-13 01:17:21.000000,548,1274564,success,,,2019-07-13 01:17:22.000000,[],[],,manual,#152317.1, +548932,2022-11-22 08:06:56.262000,2019-07-13 01:17:21.000000,12348,1284,success,,,2019-07-13 01:17:21.000000,[],[],,manual,#1555923.1, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_inventory_item_data.csv b/integration_tests/seeds/shopify_inventory_item_data.csv index 5c9e242..42bef50 100644 --- a/integration_tests/seeds/shopify_inventory_item_data.csv +++ b/integration_tests/seeds/shopify_inventory_item_data.csv @@ -1,4 +1,4 @@ id,_fivetran_synced,cost,created_at,requires_shipping,sku,tracked,updated_at,country_code_of_origin,province_code_of_origin,_fivetran_deleted -4292304555,2021-12-18 06:56:22.877000,,,,,,,,,true -436501419,2022-02-25 06:52:29.767000,,,,,,,,,true -43650851179,2022-02-24 06:52:33.361000,,,,,,,,,true \ No newline at end of file +4555,2021-12-18 06:56:22.877000,,,,,,,,,true +501419,2022-02-25 06:52:29.767000,,,,,,,,,true +851179,2022-02-24 06:52:33.361000,,,,,,,,,true \ No newline at end of file diff --git a/integration_tests/seeds/shopify_inventory_level_data.csv b/integration_tests/seeds/shopify_inventory_level_data.csv index a7b984c..8bf44a3 100644 --- a/integration_tests/seeds/shopify_inventory_level_data.csv +++ b/integration_tests/seeds/shopify_inventory_level_data.csv @@ -1,4 +1,4 @@ inventory_item_id,location_id,_fivetran_synced,available,updated_at -4301780939,28664987748,2021-11-13 08:02:21.760000,, -43017806027,28664987748,2021-11-13 08:02:21.760000,, -432407515,28664987748,2021-11-06 08:04:16.213000,, \ No newline at end of file +780939,287748,2021-11-13 08:02:21.760000,, +6027,287748,2021-11-13 08:02:21.760000,, +515,28748,2021-11-06 08:04:16.213000,, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_location_data.csv b/integration_tests/seeds/shopify_location_data.csv index a413cfb..acb13ae 100644 --- a/integration_tests/seeds/shopify_location_data.csv +++ b/integration_tests/seeds/shopify_location_data.csv @@ -1,3 +1,3 @@ id,_fivetran_synced,active,address_1,address_2,city,country,created_at,legacy,name,phone,province,updated_at,zip,country_code,country_name,localized_country_name,localized_province_name,province_code,_fivetran_deleted -28698777748,2022-12-07 06:43:31.005000,true,,,,US,2019-06-11 15:58:20.000000,true,Plum,,,2019-06-11 15:58:20.000000,,US,United States,United States,,,false -12932577748,2022-12-07 06:43:31.005000,true,111 Tree Road,,Tree,US,2018-12-10 16:24:07.000000,false,Plum Express,,NY,2019-05-16 13:37:39.000000,07394,US,United States,United States,New Yorl,NY,false \ No newline at end of file +8777748,2022-12-07 06:43:31.005000,true,,,,US,2019-06-11 15:58:20.000000,true,Plum,,,2019-06-11 15:58:20.000000,,US,United States,United States,,,false +7748,2022-12-07 06:43:31.005000,true,111 Tree Road,,Tree,US,2018-12-10 16:24:07.000000,false,Plum Express,,NY,2019-05-16 13:37:39.000000,07394,US,United States,United States,New Yorl,NY,false \ No newline at end of file diff --git a/integration_tests/seeds/shopify_metafield_data.csv b/integration_tests/seeds/shopify_metafield_data.csv index 8aebd35..ca7fb5c 100644 --- a/integration_tests/seeds/shopify_metafield_data.csv +++ b/integration_tests/seeds/shopify_metafield_data.csv @@ -1,6 +1,6 @@ id,_fivetran_synced,created_at,description,key,namespace,owner_id,owner_resource,updated_at,value,value_type,type -112253905445055,2022-11-19 10:06:09.531000,2019-10-28 20:06:39.000000,,returnAuthorizations,blade_runner,1795760390244,order,2019-10-28 20:06:39.000000,"[{""id"":""ce95-49e4-9daf-41f29bbbb799"",""totalValue"":44444,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":4444,""validReturnItems"":[{""UPC"":""19073825552"",""Quantity"":""1"",""Reason"":""changed-mind"",""LineItem"":""40055558892132""}]},""createdAt"":""2019-10-28T20:06:39.569Z"",""modifiedAt"":""2019-10-28T20:06:39.569Z""}]",,json_string -121264446337647,2022-11-21 01:57:33.851000,2020-06-17 11:35:28.000000,,returnAuthorizations,blade_runner,2259785154671,order,2020-06-17 11:35:28.000000,"[{""id"":""557ece73-658b-cf694dcd3f7e"",""totalValue"":4444,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":444.77,""validReturnItems"":[{""UPC"":""19055550468"",""Quantity"":""1"",""Reason"":""fit-issues"",""LineItem"":""4935555579471""}]},""createdAt"":""2020-06-17T11:35:28.469Z"",""modifiedAt"":""2020-06-17T11:35:28.470Z""}]",,json_string -12133380576111,2022-11-21 03:19:59.064000,2020-06-10 18:35:44.000000,,returnAuthorizations,blade_runner,2254001340527,order,2020-06-10 18:35:44.000000,"[{""id"":""e461c20a-9dc7-d38de1c9012a"",""totalValue"":4444,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":444,""validReturnItems"":[{""UPC"":""190735551121"",""Quantity"":""1"",""Reason"":""too-big"",""LineItem"":""4925555231""}]},""createdAt"":""2020-06-10T18:35:44.043Z"",""modifiedAt"":""2020-06-10T18:35:44.043Z""}]",,json_string -12239555241839,2022-11-21 01:29:09.347000,2020-07-15 21:24:16.000000,,returnAuthorizations,blade_runner,2332496625775,order,2020-07-15 21:24:16.000000,"[{""id"":""0c79163e-f55b56f50aff"",""totalValue"":44478.000000000004,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":4444.78000000000003,""validReturnItems"":[{""UPC"":""190555325"",""Quantity"":""1"",""Reason"":""fit-issues"",""LineItem"":""5555599407""}]},""createdAt"":""2020-07-15T21:24:16.210Z"",""modifiedAt"":""2020-07-15T21:24:16.210Z""}]",,json_string -12344252214575,2022-11-21 03:07:20.669000,2020-06-24 17:23:12.000000,,returnAuthorizations,blade_runner,2279364460655,order,2020-06-24 17:23:12.000000,"[{""id"":""3679-4811-94fd-555bf9846753"",""totalValue"":44581,""status"":""BACKEND_GENERATED"",""payload"":{""totalReturnValue"":4444.81,""validReturnItems"":[{""UPC"":""190735558"",""Quantity"":1,""Reason"":""Changed My Mind"",""LineItem"":""455555711""}]},""createdAt"":""2020-06-24T17:23:12.272Z"",""modifiedAt"":""2020-06-24T17:23:12.272Z""}]",,json_string \ No newline at end of file +5445055,2022-11-19 10:06:09.531000,2019-10-28 20:06:39.000000,,returnAuthorizations,blade_runner,390244,order,2019-10-28 20:06:39.000000,"[{""id"":""ce95-49e4-9daf-41f29bbbb799"",""totalValue"":44444,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":4444,""validReturnItems"":[{""UPC"":""19073825552"",""Quantity"":""1"",""Reason"":""changed-mind"",""LineItem"":""40055558892132""}]},""createdAt"":""2019-10-28T20:06:39.569Z"",""modifiedAt"":""2019-10-28T20:06:39.569Z""}]",,json_string +6337647,2022-11-21 01:57:33.851000,2020-06-17 11:35:28.000000,,returnAuthorizations,blade_runner,254671,order,2020-06-17 11:35:28.000000,"[{""id"":""557ece73-658b-cf694dcd3f7e"",""totalValue"":4444,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":444.77,""validReturnItems"":[{""UPC"":""19055550468"",""Quantity"":""1"",""Reason"":""fit-issues"",""LineItem"":""4935555579471""}]},""createdAt"":""2020-06-17T11:35:28.469Z"",""modifiedAt"":""2020-06-17T11:35:28.470Z""}]",,json_string +576111,2022-11-21 03:19:59.064000,2020-06-10 18:35:44.000000,,returnAuthorizations,blade_runner,22527,order,2020-06-10 18:35:44.000000,"[{""id"":""e461c20a-9dc7-d38de1c9012a"",""totalValue"":4444,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":444,""validReturnItems"":[{""UPC"":""190735551121"",""Quantity"":""1"",""Reason"":""too-big"",""LineItem"":""4925555231""}]},""createdAt"":""2020-06-10T18:35:44.043Z"",""modifiedAt"":""2020-06-10T18:35:44.043Z""}]",,json_string +55241839,2022-11-21 01:29:09.347000,2020-07-15 21:24:16.000000,,returnAuthorizations,blade_runner,2335775,order,2020-07-15 21:24:16.000000,"[{""id"":""0c79163e-f55b56f50aff"",""totalValue"":44478.000000000004,""status"":""RECEIVED"",""payload"":{""totalReturnValue"":4444.78000000000003,""validReturnItems"":[{""UPC"":""190555325"",""Quantity"":""1"",""Reason"":""fit-issues"",""LineItem"":""5555599407""}]},""createdAt"":""2020-07-15T21:24:16.210Z"",""modifiedAt"":""2020-07-15T21:24:16.210Z""}]",,json_string +4575,2022-11-21 03:07:20.669000,2020-06-24 17:23:12.000000,,returnAuthorizations,blade_runner,220655,order,2020-06-24 17:23:12.000000,"[{""id"":""3679-4811-94fd-555bf9846753"",""totalValue"":44581,""status"":""BACKEND_GENERATED"",""payload"":{""totalReturnValue"":4444.81,""validReturnItems"":[{""UPC"":""190735558"",""Quantity"":1,""Reason"":""Changed My Mind"",""LineItem"":""455555711""}]},""createdAt"":""2020-06-24T17:23:12.272Z"",""modifiedAt"":""2020-06-24T17:23:12.272Z""}]",,json_string \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_discount_code_data.csv b/integration_tests/seeds/shopify_order_discount_code_data.csv index 8b8417e..1dc1083 100644 --- a/integration_tests/seeds/shopify_order_discount_code_data.csv +++ b/integration_tests/seeds/shopify_order_discount_code_data.csv @@ -1,4 +1,4 @@ index,order_id,_fivetran_synced,amount,code,type -1,3685556594347,2022-11-20 08:14:52.957000,11.0,GIFTCARD,percentage -1,420555553483,2022-11-19 11:59:50.040000,0.0,SHIPPING2022,shipping -1,368755535403,2022-11-20 10:22:23.877000,2.0,GIFTCARD,percentage \ No newline at end of file +1,368347,2022-11-20 08:14:52.957000,11.0,GIFTCARD,percentage +1,423483,2022-11-19 11:59:50.040000,0.0,SHIPPING2022,shipping +1,365403,2022-11-20 10:22:23.877000,2.0,GIFTCARD,percentage \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_shipping_line_data.csv b/integration_tests/seeds/shopify_order_shipping_line_data.csv index ebe0fa6..9496703 100644 --- a/integration_tests/seeds/shopify_order_shipping_line_data.csv +++ b/integration_tests/seeds/shopify_order_shipping_line_data.csv @@ -1,4 +1,4 @@ id,order_id,_fivetran_synced,carrier_identifier,code,delivery_category,discounted_price,phone,price,requested_fulfillment_service_id,source,title,discounted_price_set,price_set -351255554475,415855525355,2022-11-19 14:09:18.923000,,Standard,,0.0,,0.0,,shopify,Standard,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}","{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" -355555308651,421550545579,2022-11-19 11:28:21.391000,,Standard,,0.0,,0.0,,shopify,Standard,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}","{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" -3465557188139,4555681899,2022-11-19 16:03:15.430000,,Standard,,0.0,,0.0,,shopify,Standard,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}","{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" \ No newline at end of file +54475,55,2022-11-19 14:09:18.923000,,Standard,,0.0,,0.0,,shopify,Standard,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}","{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +651,425579,2022-11-19 11:28:21.391000,,Standard,,0.0,,0.0,,shopify,Standard,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}","{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +188139,4599,2022-11-19 16:03:15.430000,,Standard,,0.0,,0.0,,shopify,Standard,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}","{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_shipping_tax_line_data.csv b/integration_tests/seeds/shopify_order_shipping_tax_line_data.csv index 0fff36e..2d0d9b8 100644 --- a/integration_tests/seeds/shopify_order_shipping_tax_line_data.csv +++ b/integration_tests/seeds/shopify_order_shipping_tax_line_data.csv @@ -1,4 +1,4 @@ index,order_shipping_line_id,_fivetran_synced,price,rate,title,price_set -4,34557773221291,2022-11-19 15:05:15.847000,0.0,0.0,GEIWIHG,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" -3,35555106125995,2022-11-19 11:24:24.596000,0.0,0.007,BANANAN,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" -3,34777778409131,2022-11-19 16:52:35.685000,0.0,0.01,TOMATO,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" \ No newline at end of file +4,321291,2022-11-19 15:05:15.847000,0.0,0.0,GEIWIHG,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +3,5995,2022-11-19 11:24:24.596000,0.0,0.007,BANANAN,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +3,309131,2022-11-19 16:52:35.685000,0.0,0.01,TOMATO,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_tag_data.csv b/integration_tests/seeds/shopify_order_tag_data.csv index 3090e49..a417232 100644 --- a/integration_tests/seeds/shopify_order_tag_data.csv +++ b/integration_tests/seeds/shopify_order_tag_data.csv @@ -1,4 +1,4 @@ index,order_id,_fivetran_synced,value -1,46644446411,2022-12-07 06:49:30.307000,#33333 -1,4705555559195,2022-12-07 06:49:26.771000,#22222 -1,4625564155553,2022-12-07 06:49:38.197000,#771222 \ No newline at end of file +1,6411,2022-12-07 06:49:30.307000,#33333 +1,47195,2022-12-07 06:49:26.771000,#22222 +1,46553,2022-12-07 06:49:38.197000,#771222 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_url_tag_data.csv b/integration_tests/seeds/shopify_order_url_tag_data.csv index 00c0977..6cf7c2e 100644 --- a/integration_tests/seeds/shopify_order_url_tag_data.csv +++ b/integration_tests/seeds/shopify_order_url_tag_data.csv @@ -1,4 +1,4 @@ key,order_id,_fivetran_synced,value -image,47777090347,2022-11-19 10:29:18.624000,Image -utm_medium,4207771090347,2022-11-19 10:29:18.624000,email -prop_channel,4277771090347,2022-11-19 10:29:18.624000,flows \ No newline at end of file +image,40347,2022-11-19 10:29:18.624000,Image +utm_medium,4290347,2022-11-19 10:29:18.624000,email +prop_channel,47,2022-11-19 10:29:18.624000,flows \ No newline at end of file diff --git a/integration_tests/seeds/shopify_price_rule_data.csv b/integration_tests/seeds/shopify_price_rule_data.csv index 2583570..7f95496 100644 --- a/integration_tests/seeds/shopify_price_rule_data.csv +++ b/integration_tests/seeds/shopify_price_rule_data.csv @@ -1,4 +1,4 @@ id,_fivetran_synced,allocation_limit,allocation_method,created_at,customer_selection,ends_at,once_per_customer,prerequisite_quantity_range,prerequisite_shipping_price_range,prerequisite_subtotal_range,quantity_ratio_entitled_quantity,quantity_ratio_prerequisite_quantity,starts_at,target_selection,target_type,title,updated_at,usage_limit,value,value_type,prerequisite_to_entitlement_purchase_prerequisite_amount -1111111443,2021-03-22 05:43:56.784000,,across,2021-03-09 18:57:54.000000,all,2021-03-22 07:00:59.000000,false,,,500.0,,,2021-03-17 04:00:57.000000,all,line_item,GIFTCARD,2021-03-22 04:20:03.000000,,0.0,percentage, -66665564075,2021-11-11 07:43:53.706000,,across,2021-11-10 22:26:31.000000,all,2021-11-30 14:00:59.000000,false,,,,,,2021-11-10 22:25:32.000000,entitled,line_item,THANKS,2021-11-10 22:26:31.000000,,0.0,percentage, -6665719339,2021-12-03 06:47:21.433000,,across,2021-11-11 22:38:18.000000,all,2021-12-02 19:00:59.000000,false,,,,,,2021-11-23 21:30:38.000000,all,line_item,THANKS,2021-12-02 19:21:47.000000,,0.0,percentage, \ No newline at end of file +11443,2021-03-22 05:43:56.784000,,across,2021-03-09 18:57:54.000000,all,2021-03-22 07:00:59.000000,false,,,500.0,,,2021-03-17 04:00:57.000000,all,line_item,GIFTCARD,2021-03-22 04:20:03.000000,,0.0,percentage, +564075,2021-11-11 07:43:53.706000,,across,2021-11-10 22:26:31.000000,all,2021-11-30 14:00:59.000000,false,,,,,,2021-11-10 22:25:32.000000,entitled,line_item,THANKS,2021-11-10 22:26:31.000000,,0.0,percentage, +9339,2021-12-03 06:47:21.433000,,across,2021-11-11 22:38:18.000000,all,2021-12-02 19:00:59.000000,false,,,,,,2021-11-23 21:30:38.000000,all,line_item,THANKS,2021-12-02 19:21:47.000000,,0.0,percentage, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_product_image_data.csv b/integration_tests/seeds/shopify_product_image_data.csv index 2c0d054..a4cd776 100644 --- a/integration_tests/seeds/shopify_product_image_data.csv +++ b/integration_tests/seeds/shopify_product_image_data.csv @@ -1,4 +1,4 @@ id,product_id,_fivetran_deleted,_fivetran_synced,alt,created_at,height,position,src,updated_at,width,is_default,variant_ids -66662814180,34066638804,false,2022-12-01 06:51:36.660000,,2019-06-13 04:06:07.000000,1200,4,https://cdn.shopify.com/s/files/glassess-1784103173.jpg?v=1560398767,2019-06-13 04:06:07.000000,956,false,[] -666652748644,340966648666804,false,2022-12-01 06:51:36.660000,,2019-06-13 04:06:07.000000,1200,2,https://cdn.shopify.com/s/files/1/smile.jpg?v=1560398767,2019-06-13 04:06:07.000000,956,false,[] -666679716,346668486604,false,2022-12-01 06:51:36.660000,,2019-06-13 04:06:07.000000,1200,6,https://cdn.shopify.com/s/files/1/kitten.jpg?v=1560398767,2019-06-13 04:06:07.000000,956,false,"[2755330292,27559733,275597338,275597536,2755931364,2755973,2734989668]" \ No newline at end of file +14180,38804,false,2022-12-01 06:51:36.660000,,2019-06-13 04:06:07.000000,1200,4,https://cdn.shopify.com/s/files/glassess-1784103173.jpg?v=1560398767,2019-06-13 04:06:07.000000,956,false,[] +748644,34804,false,2022-12-01 06:51:36.660000,,2019-06-13 04:06:07.000000,1200,2,https://cdn.shopify.com/s/files/1/smile.jpg?v=1560398767,2019-06-13 04:06:07.000000,956,false,[] +679716,34604,false,2022-12-01 06:51:36.660000,,2019-06-13 04:06:07.000000,1200,6,https://cdn.shopify.com/s/files/1/kitten.jpg?v=1560398767,2019-06-13 04:06:07.000000,956,false,"[2755330292,27559733,275597338,275597536,2755931364,2755973,2734989668]" \ No newline at end of file diff --git a/integration_tests/seeds/shopify_product_tag_data.csv b/integration_tests/seeds/shopify_product_tag_data.csv index b11e5d7..1e83e7e 100644 --- a/integration_tests/seeds/shopify_product_tag_data.csv +++ b/integration_tests/seeds/shopify_product_tag_data.csv @@ -1,6 +1,6 @@ index,product_id,_fivetran_synced,value -9,1234072132,2022-12-01 06:51:36.480000 UTC,Type: Clothing -5,1234072132,2022-12-01 06:51:36.480000 UTC,Final Sale -7,1234072132,2022-12-01 06:51:36.480000 UTC,Sale -8,1234072132,2022-12-01 06:51:36.480000 UTC,StyleID:nice -3,1234072132,2022-12-01 06:51:36.480000 UTC,Collection: Bottoms \ No newline at end of file +9,41234,2022-12-01 06:51:36.480000 UTC,Type: Clothing +5,41234,2022-12-01 06:51:36.480000 UTC,Final Sale +7,41234,2022-12-01 06:51:36.480000 UTC,Sale +8,41234,2022-12-01 06:51:36.480000 UTC,StyleID:nice +3,41234,2022-12-01 06:51:36.480000 UTC,Collection: Bottoms \ No newline at end of file diff --git a/integration_tests/seeds/shopify_shop_data.csv b/integration_tests/seeds/shopify_shop_data.csv index e3bbdb2..c54f34f 100644 --- a/integration_tests/seeds/shopify_shop_data.csv +++ b/integration_tests/seeds/shopify_shop_data.csv @@ -1,2 +1,2 @@ id,_fivetran_deleted,_fivetran_synced,address_1,address_2,auto_configure_tax_inclusivity,checkout_api_supported,city,cookie_consent_level,country,country_code,country_name,county_taxes,created_at,currency,customer_email,domain,eligible_for_card_reader_giveaway,eligible_for_payments,email,enabled_presentment_currencies,force_ssl,google_apps_domain,google_apps_login_enabled,has_discounts,has_gift_cards,has_storefront,iana_timezone,latitude,longitude,money_format,money_in_emails_format,money_with_currency_format,money_with_currency_in_emails_format,multi_location_enabled,myshopify_domain,name,password_enabled,phone,plan_display_name,plan_name,pre_launch_enabled,primary_locale,primary_location_id,province,province_code,requires_extra_payments_agreement,setup_required,shop_owner,source,tax_shipping,taxes_included,timezone,updated_at,visitor_tracking_consent_preference,weight_unit,zip -1244320689,false,2022-12-07 06:49:41.652000,1 Main Street,200th Floor,,true,New York,implicit,US,US,United States,true,2018-12-10 16:24:00.000000,USD,noreply@kitties.com,kitties.com,true,true,abc@kitties.com,"[""USD""]",true,,,true,true,true,America/New_York,80.1234,-123.12345,${{amount}},${{amount}},${{amount}} USD,${{amount}} USD,true,kitties.myshopify.com,Garrett & Alfredo,false,1233373,Shopify Plus,shopify_plus,false,en,1234646345,New York,NY,false,false,Garrett & Alfredo,,,false,(GMT-05:00) America/New_York,2022-12-07 00:26:36.000000,allow_all,lb,10014 \ No newline at end of file +689,false,2022-12-07 06:49:41.652000,1 Main Street,200th Floor,,true,New York,implicit,US,US,United States,true,2018-12-10 16:24:00.000000,USD,noreply@kitties.com,kitties.com,true,true,abc@kitties.com,"[""USD""]",true,,,true,true,true,America/New_York,80.1234,-123.12345,${{amount}},${{amount}},${{amount}} USD,${{amount}} USD,true,kitties.myshopify.com,Garrett & Alfredo,false,13373,Shopify Plus,shopify_plus,false,en,1234646345,New York,NY,false,false,Garrett & Alfredo,,,false,(GMT-05:00) America/New_York,2022-12-07 00:26:36.000000,allow_all,lb,10014 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_tender_transaction_data.csv b/integration_tests/seeds/shopify_tender_transaction_data.csv index bdaaaed..f7da4b5 100644 --- a/integration_tests/seeds/shopify_tender_transaction_data.csv +++ b/integration_tests/seeds/shopify_tender_transaction_data.csv @@ -1,6 +1,6 @@ id,_fivetran_synced,amount,currency,order_id,payment_details_credit_card_company,payment_details_credit_card_number,payment_method,processed_at,remote_reference,test,user_id -111179034283,2022-12-01 06:51:34.004000,2895.74,USD,45555950942379,,,other,2022-11-30 18:14:37.000000,,false, -11111905707,2022-12-01 06:51:42.309000,5900.75,USD,455513667243,,,other,2022-12-01 02:00:39.000000,,false, -55553002411,2022-12-01 06:51:29.718000,-164.72,USD,45599755467,,,other,2022-11-30 14:29:13.000000,,false, -4203555179,2022-12-01 06:51:41.198000,5180.19,USD,475559835,,,other,2022-11-30 23:55:45.000000,,false, -111116923,2022-12-01 06:51:42.358000,3004.3,USD,45559563955,,,other,2022-12-01 02:09:47.000000,,false, \ No newline at end of file +34283,2022-12-01 06:51:34.004000,2895.74,USD,45555950942379,,,other,2022-11-30 18:14:37.000000,,false, +905707,2022-12-01 06:51:42.309000,5900.75,USD,455513667243,,,other,2022-12-01 02:00:39.000000,,false, +411,2022-12-01 06:51:29.718000,-164.72,USD,45599755467,,,other,2022-11-30 14:29:13.000000,,false, +55179,2022-12-01 06:51:41.198000,5180.19,USD,475559835,,,other,2022-11-30 23:55:45.000000,,false, +16923,2022-12-01 06:51:42.358000,3004.3,USD,45559563955,,,other,2022-12-01 02:09:47.000000,,false, \ No newline at end of file From 3ac8c38de55306a2f8d088f860a9328de334f526 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:01:55 -0800 Subject: [PATCH 030/137] seeds --- integration_tests/dbt_project.yml | 23 +++++++++++++++++++ ... => shopify_order_note_attribute_data.csv} | 0 2 files changed, 23 insertions(+) rename integration_tests/seeds/{shopify_ order_note_attribute_data.csv => shopify_order_note_attribute_data.csv} (100%) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 0c47500..c06d0f6 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -15,6 +15,29 @@ vars: refund_source: "{{ ref('shopify_refund_data') }}" transaction_source: "{{ ref('shopify_transaction_data') }}" + abandoned_checkout_source: "{{ ref('shopify_abandoned_checkout_data') }}" + collection_product_source: "{{ ref('shopify_collection_product_data') }}" + collection_source: "{{ ref('shopify_collection_data') }}" + customer_tag_source: "{{ ref('shopify_customer_tag_data') }}" + discount_code_source: "{{ ref('shopify_discount_code_data') }}" + fulfillment_source: "{{ ref('shopify_fulfillment_data') }}" + inventory_item_source: "{{ ref('shopify_inventory_item_data') }}" + inventory_level_source: "{{ ref('shopify_inventory_level_data') }}" + location_source: "{{ ref('shopify_location_data') }}" + metafield_source: "{{ ref('shopify_metafield_data') }}" + order_note_attribute_source: "{{ ref('shopify_order_note_attribute_data') }}" + order_shipping_line_source: "{{ ref('shopify_order_shipping_line_data') }}" + order_shipping_tax_line_source: "{{ ref('shopify_order_shipping_tax_line_data') }}" + order_tag_source: "{{ ref('shopify_order_tag_data') }}" + order_url_tag_source: "{{ ref('shopify_order_url_tag_data') }}" + price_rule_source: "{{ ref('shopify_price_rule_data') }}" + product_image_source: "{{ ref('shopify_product_image_data') }}" + product_tag_source: "{{ ref('shopify_product_tag_data') }}" + shop_source: "{{ ref('shopify_shop_data') }}" + tender_transaction_source: "{{ ref('shopify_tender_transaction_data') }}" + abandoned_checkout_discount_code_source: "{{ ref('shopify_abandoned_checkout_discount_code_data') }}" + order_discount_code_source: "{{ ref('shopify_order_discount_code_data') }}" + dispatch: - macro_namespace: dbt_utils search_order: ['spark_utils', 'dbt_utils'] diff --git a/integration_tests/seeds/shopify_ order_note_attribute_data.csv b/integration_tests/seeds/shopify_order_note_attribute_data.csv similarity index 100% rename from integration_tests/seeds/shopify_ order_note_attribute_data.csv rename to integration_tests/seeds/shopify_order_note_attribute_data.csv From 746c05877ca3cfc8c3501f9a885459f462b87b67 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:16:02 -0800 Subject: [PATCH 031/137] seeds --- .../seeds/shopify_abandoned_checkout_data.csv | 6 +++--- .../seeds/shopify_collection_product_data.csv | 6 +++--- .../seeds/shopify_tender_transaction_data.csv | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/integration_tests/seeds/shopify_abandoned_checkout_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_data.csv index 9c4971a..f76c83e 100644 --- a/integration_tests/seeds/shopify_abandoned_checkout_data.csv +++ b/integration_tests/seeds/shopify_abandoned_checkout_data.csv @@ -1,4 +1,4 @@ id,_fivetran_synced,abandoned_checkout_url,applied_discount_amount,applied_discount_applicable,applied_discount_description,applied_discount_non_applicable_reason,applied_discount_title,applied_discount_value,applied_discount_value_type,billing_address_address_1,billing_address_address_0,billing_address_city,billing_address_company,billing_address_country,billing_address_country_code,billing_address_first_name,billing_address_last_name,billing_address_latitude,billing_address_longitude,billing_address_name,billing_address_phone,billing_address_province,billing_address_province_code,billing_address_zip,buyer_accepts_marketing,cart_token,closed_at,completed_at,created_at,credit_card_first_name,credit_card_last_name,credit_card_month,credit_card_number,credit_card_verification_value,credit_card_year,currency,customer_id,customer_locale,device_id,email,gateway,landing_site_base_url,location_id,name,note,phone,referring_site,shipping_address_address_1,shipping_address_address_0,shipping_address_city,shipping_address_company,shipping_address_country,shipping_address_country_code,shipping_address_first_name,shipping_address_last_name,shipping_address_latitude,shipping_address_longitude,shipping_address_name,shipping_address_phone,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_line,shipping_rate_id,shipping_rate_price,shipping_rate_title,source,source_identifier,source_name,source_url,subtotal_price,taxes_included,token,total_discounts,total_line_items_price,total_price,total_tax,total_weight,updated_at,user_id,note_attribute_littledata_updated_at,note_attribute_segment_client_id,billing_address_id,billing_address_is_default,presentment_currency,shipping_address_id,shipping_address_is_default,total_duties,note_attribute_email_client_id,note_attributes,note_attribute_google_client_id,_fivetran_deleted -12111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,110f5eb2fd1d11211311311622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,1101311111121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311112111,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.1115111,-26.1126062,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda125a10cca513162f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, -11101311,2020-01-11 06:01:35.021111,https://kitties.com/1111311610/checkouts/6661ff02165dfd11b12db112f0111226/recover?key=51611efdff11e0caccc0fd30b0e1e202,,,,,,,,village,Apt 0,daytona Beach,,Florida,US,ohio,Calles,1.126113511111111,-21.502661,hi,+50266111110,Healdsburg,PA-11,,false,611faa630ce5e6bcc0bacc2a105c0126,,,2020-05-11 01:01:30.111111,,,,,,,USD,3021350266525,en,,hyrehher@gmail.com,,/collections/sale,,#13051511101311,,,https://www.google.com/,123 main st,Pty 3,ghreiuhtg,,United States,US,ohio,Calle pty115,,,ohio Calle pty115,+12161115152,Florida,FL,33120,,,,,,,web,,10.35,false,6661ff02165dfd11b12db112f0111226,16.65,111.0,10.35,1.0,1,2020-05-11 01:06:35.111111,,,,,,,,,,,,, -066531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,1110c010361e1d11a0d613f3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,1620110310363,en,,hernebbe@hr.com,,/collections/new,,#11151102066531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,1abddd111c0211f1e616ec0d0c32021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,1613121625150,610a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file +12111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,110f5eb2fd1d11211311311622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311112111,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.1115111,-26.1126062,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda125a10cca513162f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, +11111,2020-01-11 06:01:35.021111,https://kitties.com/1111311610/checkouts/6661ff02165dfd11b12db112f0111226/recover?key=51611efdff11e0caccc0fd30b0e1e202,,,,,,,,village,Apt 0,daytona Beach,,Florida,US,ohio,Calles,1.1261131111,-21.502661,hi,+50266111110,Healdsburg,PA-11,,false,611faa630ce5e6bcc0bacc2a105c0126,,,2020-05-11 01:01:30.111111,,,,,,,USD,3021350266525,en,,hyrehher@gmail.com,,/collections/sale,,#13051511101311,,,https://www.google.com/,123 main st,Pty 3,ghreiuhtg,,United States,US,ohio,Calle pty115,,,ohio Calle pty115,+12161115152,Florida,FL,33120,,,,,,,web,,10.35,false,6661ff02165dfd11b12db112f0111226,16.65,111.0,10.35,1.0,1,2020-05-11 01:06:35.111111,,,,,,,,,,,,, +066531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,1110c010361e1d11a0d613f3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,160363,en,,hernebbe@hr.com,,/collections/new,,#11151102066531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,1abddd111c0211f1e616ec0d0c32021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,125150,610a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file diff --git a/integration_tests/seeds/shopify_collection_product_data.csv b/integration_tests/seeds/shopify_collection_product_data.csv index b269955..5ad15c6 100644 --- a/integration_tests/seeds/shopify_collection_product_data.csv +++ b/integration_tests/seeds/shopify_collection_product_data.csv @@ -1,4 +1,4 @@ collection_id,product_id,_fivetran_synced -37124,7000164489131,2022-11-18 21:32:43.188000 -9037124,72384654353899,2022-11-18 21:32:43.188000 -37124,7244664618891,2022-11-18 21:32:43.188000 \ No newline at end of file +37124,789131,2022-11-18 21:32:43.188000 +9037124,74353899,2022-11-18 21:32:43.188000 +37124,8891,2022-11-18 21:32:43.188000 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_tender_transaction_data.csv b/integration_tests/seeds/shopify_tender_transaction_data.csv index f7da4b5..4022c5a 100644 --- a/integration_tests/seeds/shopify_tender_transaction_data.csv +++ b/integration_tests/seeds/shopify_tender_transaction_data.csv @@ -1,6 +1,6 @@ id,_fivetran_synced,amount,currency,order_id,payment_details_credit_card_company,payment_details_credit_card_number,payment_method,processed_at,remote_reference,test,user_id -34283,2022-12-01 06:51:34.004000,2895.74,USD,45555950942379,,,other,2022-11-30 18:14:37.000000,,false, -905707,2022-12-01 06:51:42.309000,5900.75,USD,455513667243,,,other,2022-12-01 02:00:39.000000,,false, -411,2022-12-01 06:51:29.718000,-164.72,USD,45599755467,,,other,2022-11-30 14:29:13.000000,,false, -55179,2022-12-01 06:51:41.198000,5180.19,USD,475559835,,,other,2022-11-30 23:55:45.000000,,false, -16923,2022-12-01 06:51:42.358000,3004.3,USD,45559563955,,,other,2022-12-01 02:09:47.000000,,false, \ No newline at end of file +34283,2022-12-01 06:51:34.004000,2895.74,USD,45379,,,other,2022-11-30 18:14:37.000000,,false, +905707,2022-12-01 06:51:42.309000,5900.75,USD,45243,,,other,2022-12-01 02:00:39.000000,,false, +411,2022-12-01 06:51:29.718000,-164.72,USD,4559467,,,other,2022-11-30 14:29:13.000000,,false, +55179,2022-12-01 06:51:41.198000,5180.19,USD,35,,,other,2022-11-30 23:55:45.000000,,false, +16923,2022-12-01 06:51:42.358000,3004.3,USD,45955,,,other,2022-12-01 02:09:47.000000,,false, \ No newline at end of file From 944071254b50338ee7b088746ac81aec5de9ddf3 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:21:53 -0800 Subject: [PATCH 032/137] int out of range --- integration_tests/seeds/shopify_abandoned_checkout_data.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration_tests/seeds/shopify_abandoned_checkout_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_data.csv index f76c83e..1f84235 100644 --- a/integration_tests/seeds/shopify_abandoned_checkout_data.csv +++ b/integration_tests/seeds/shopify_abandoned_checkout_data.csv @@ -1,4 +1,4 @@ id,_fivetran_synced,abandoned_checkout_url,applied_discount_amount,applied_discount_applicable,applied_discount_description,applied_discount_non_applicable_reason,applied_discount_title,applied_discount_value,applied_discount_value_type,billing_address_address_1,billing_address_address_0,billing_address_city,billing_address_company,billing_address_country,billing_address_country_code,billing_address_first_name,billing_address_last_name,billing_address_latitude,billing_address_longitude,billing_address_name,billing_address_phone,billing_address_province,billing_address_province_code,billing_address_zip,buyer_accepts_marketing,cart_token,closed_at,completed_at,created_at,credit_card_first_name,credit_card_last_name,credit_card_month,credit_card_number,credit_card_verification_value,credit_card_year,currency,customer_id,customer_locale,device_id,email,gateway,landing_site_base_url,location_id,name,note,phone,referring_site,shipping_address_address_1,shipping_address_address_0,shipping_address_city,shipping_address_company,shipping_address_country,shipping_address_country_code,shipping_address_first_name,shipping_address_last_name,shipping_address_latitude,shipping_address_longitude,shipping_address_name,shipping_address_phone,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_line,shipping_rate_id,shipping_rate_price,shipping_rate_title,source,source_identifier,source_name,source_url,subtotal_price,taxes_included,token,total_discounts,total_line_items_price,total_price,total_tax,total_weight,updated_at,user_id,note_attribute_littledata_updated_at,note_attribute_segment_client_id,billing_address_id,billing_address_is_default,presentment_currency,shipping_address_id,shipping_address_is_default,total_duties,note_attribute_email_client_id,note_attributes,note_attribute_google_client_id,_fivetran_deleted -12111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,110f5eb2fd1d11211311311622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311112111,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.1115111,-26.1126062,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda125a10cca513162f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, -11111,2020-01-11 06:01:35.021111,https://kitties.com/1111311610/checkouts/6661ff02165dfd11b12db112f0111226/recover?key=51611efdff11e0caccc0fd30b0e1e202,,,,,,,,village,Apt 0,daytona Beach,,Florida,US,ohio,Calles,1.1261131111,-21.502661,hi,+50266111110,Healdsburg,PA-11,,false,611faa630ce5e6bcc0bacc2a105c0126,,,2020-05-11 01:01:30.111111,,,,,,,USD,3021350266525,en,,hyrehher@gmail.com,,/collections/sale,,#13051511101311,,,https://www.google.com/,123 main st,Pty 3,ghreiuhtg,,United States,US,ohio,Calle pty115,,,ohio Calle pty115,+12161115152,Florida,FL,33120,,,,,,,web,,10.35,false,6661ff02165dfd11b12db112f0111226,16.65,111.0,10.35,1.0,1,2020-05-11 01:06:35.111111,,,,,,,,,,,,, -066531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,1110c010361e1d11a0d613f3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,160363,en,,hernebbe@hr.com,,/collections/new,,#11151102066531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,1abddd111c0211f1e616ec0d0c32021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,125150,610a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file +12111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,a110f5eb2fd1d11211622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311112111,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.1115111,-26.1126062,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda125a10cca513162f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, +11111,2020-01-11 06:01:35.021111,https://kitties.com/1111311610/checkouts/6661ff02165dfd11b12db112f0111226/recover?key=51611efdff11e0caccc0fd30b0e1e202,,,,,,,,village,Apt 0,daytona Beach,,Florida,US,ohio,Calles,1.1261131111,-21.502661,hi,+50266111110,Healdsburg,PA-11,,false,611faa630ce5e6bcc0bacc2a105c0126,,,2020-05-11 01:01:30.111111,,,,,,,USD,366525,en,,hyrehher@gmail.com,,/collections/sale,,#13051511101311,,,https://www.google.com/,123 main st,Pty 3,ghreiuhtg,,United States,US,ohio,Calle pty115,,,ohio Calle pty115,+12161115152,Florida,FL,33120,,,,,,,web,,10.35,false,6661ff02165dfd11b12db112f0111226,16.65,111.0,10.35,1.0,1,2020-05-11 01:06:35.111111,,,,,,,,,,,,, +66531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,a110c010361e1d11af3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,160363,en,,hernebbe@hr.com,,/collections/new,,#11151102066531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,1abddd111c0211f1e616ec0d0c32021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,125150,610a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file From b0cbd90480a46dba6430a7df2b225a46897f65e6 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:33:01 -0800 Subject: [PATCH 033/137] int out of range --- integration_tests/dbt_project.yml | 3 ++- integration_tests/seeds/shopify_abandoned_checkout_data.csv | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index c06d0f6..9a23038 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -37,7 +37,7 @@ vars: tender_transaction_source: "{{ ref('shopify_tender_transaction_data') }}" abandoned_checkout_discount_code_source: "{{ ref('shopify_abandoned_checkout_discount_code_data') }}" order_discount_code_source: "{{ ref('shopify_order_discount_code_data') }}" - + dispatch: - macro_namespace: dbt_utils search_order: ['spark_utils', 'dbt_utils'] @@ -110,6 +110,7 @@ seeds: shopify_abandoned_checkout_data: +column_types: total_line_items_price: float + shipping_address_phone: "{{ 'string' if target.name in ('bigquery', 'spark') else 'varchar' }}" shopify_discount_code_data: +column_types: usage_count: float diff --git a/integration_tests/seeds/shopify_abandoned_checkout_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_data.csv index 1f84235..4824fff 100644 --- a/integration_tests/seeds/shopify_abandoned_checkout_data.csv +++ b/integration_tests/seeds/shopify_abandoned_checkout_data.csv @@ -1,4 +1,4 @@ id,_fivetran_synced,abandoned_checkout_url,applied_discount_amount,applied_discount_applicable,applied_discount_description,applied_discount_non_applicable_reason,applied_discount_title,applied_discount_value,applied_discount_value_type,billing_address_address_1,billing_address_address_0,billing_address_city,billing_address_company,billing_address_country,billing_address_country_code,billing_address_first_name,billing_address_last_name,billing_address_latitude,billing_address_longitude,billing_address_name,billing_address_phone,billing_address_province,billing_address_province_code,billing_address_zip,buyer_accepts_marketing,cart_token,closed_at,completed_at,created_at,credit_card_first_name,credit_card_last_name,credit_card_month,credit_card_number,credit_card_verification_value,credit_card_year,currency,customer_id,customer_locale,device_id,email,gateway,landing_site_base_url,location_id,name,note,phone,referring_site,shipping_address_address_1,shipping_address_address_0,shipping_address_city,shipping_address_company,shipping_address_country,shipping_address_country_code,shipping_address_first_name,shipping_address_last_name,shipping_address_latitude,shipping_address_longitude,shipping_address_name,shipping_address_phone,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_line,shipping_rate_id,shipping_rate_price,shipping_rate_title,source,source_identifier,source_name,source_url,subtotal_price,taxes_included,token,total_discounts,total_line_items_price,total_price,total_tax,total_weight,updated_at,user_id,note_attribute_littledata_updated_at,note_attribute_segment_client_id,billing_address_id,billing_address_is_default,presentment_currency,shipping_address_id,shipping_address_is_default,total_duties,note_attribute_email_client_id,note_attributes,note_attribute_google_client_id,_fivetran_deleted -12111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,a110f5eb2fd1d11211622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311112111,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.1115111,-26.1126062,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda125a10cca513162f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, -11111,2020-01-11 06:01:35.021111,https://kitties.com/1111311610/checkouts/6661ff02165dfd11b12db112f0111226/recover?key=51611efdff11e0caccc0fd30b0e1e202,,,,,,,,village,Apt 0,daytona Beach,,Florida,US,ohio,Calles,1.1261131111,-21.502661,hi,+50266111110,Healdsburg,PA-11,,false,611faa630ce5e6bcc0bacc2a105c0126,,,2020-05-11 01:01:30.111111,,,,,,,USD,366525,en,,hyrehher@gmail.com,,/collections/sale,,#13051511101311,,,https://www.google.com/,123 main st,Pty 3,ghreiuhtg,,United States,US,ohio,Calle pty115,,,ohio Calle pty115,+12161115152,Florida,FL,33120,,,,,,,web,,10.35,false,6661ff02165dfd11b12db112f0111226,16.65,111.0,10.35,1.0,1,2020-05-11 01:06:35.111111,,,,,,,,,,,,, -66531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,a110c010361e1d11af3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,160363,en,,hernebbe@hr.com,,/collections/new,,#11151102066531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,1abddd111c0211f1e616ec0d0c32021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,125150,610a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file +12111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,a110f5eb2fd1d11211622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.111511,-26.112602,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda12f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, +11111,2020-01-11 06:01:35.021111,https://kitties.com/1111311610/checkouts/6661ff02165dfd11b12db112f0111226/recover?key=51611efdff11e0caccc0fd30b0e1e202,,,,,,,,village,Apt 0,daytona Beach,,Florida,US,ohio,Calles,1.1261131111,-21.502661,hi,+50266111110,Healdsburg,PA-11,,false,611faa630ce5e6bcc0bacc2a105c0126,,,2020-05-11 01:01:30.111111,,,,,,,USD,366525,en,,hyrehher@gmail.com,,/collections/sale,,#13311,,,https://www.google.com/,123 main st,Pty 3,ghreiuhtg,,United States,US,ohio,Calle pty115,,,ohio Calle pty115,+12161115152,Florida,FL,33120,,,,,,,web,,10.35,false,a165dfd11226,16.65,111.0,10.35,1.0,1,2020-05-11 01:06:35.111111,,,,,,,,,,,,, +66531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,a110c010361e1d11af3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,160363,en,,hernebbe@hr.com,,/collections/new,,#166531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,l1abddd111c0211f2021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,125150,a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file From e810268b337c3915da3590c153dd97ee3c289051 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:42:05 -0800 Subject: [PATCH 034/137] uhhhhh --- integration_tests/dbt_project.yml | 3 ++- integration_tests/seeds/shopify_abandoned_checkout_data.csv | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 9a23038..c94068d 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -110,7 +110,8 @@ seeds: shopify_abandoned_checkout_data: +column_types: total_line_items_price: float - shipping_address_phone: "{{ 'string' if target.name in ('bigquery', 'spark') else 'varchar' }}" + billing_address_phone: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" + shipping_address_phone: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" shopify_discount_code_data: +column_types: usage_count: float diff --git a/integration_tests/seeds/shopify_abandoned_checkout_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_data.csv index 4824fff..9a1c930 100644 --- a/integration_tests/seeds/shopify_abandoned_checkout_data.csv +++ b/integration_tests/seeds/shopify_abandoned_checkout_data.csv @@ -1,4 +1,4 @@ id,_fivetran_synced,abandoned_checkout_url,applied_discount_amount,applied_discount_applicable,applied_discount_description,applied_discount_non_applicable_reason,applied_discount_title,applied_discount_value,applied_discount_value_type,billing_address_address_1,billing_address_address_0,billing_address_city,billing_address_company,billing_address_country,billing_address_country_code,billing_address_first_name,billing_address_last_name,billing_address_latitude,billing_address_longitude,billing_address_name,billing_address_phone,billing_address_province,billing_address_province_code,billing_address_zip,buyer_accepts_marketing,cart_token,closed_at,completed_at,created_at,credit_card_first_name,credit_card_last_name,credit_card_month,credit_card_number,credit_card_verification_value,credit_card_year,currency,customer_id,customer_locale,device_id,email,gateway,landing_site_base_url,location_id,name,note,phone,referring_site,shipping_address_address_1,shipping_address_address_0,shipping_address_city,shipping_address_company,shipping_address_country,shipping_address_country_code,shipping_address_first_name,shipping_address_last_name,shipping_address_latitude,shipping_address_longitude,shipping_address_name,shipping_address_phone,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_line,shipping_rate_id,shipping_rate_price,shipping_rate_title,source,source_identifier,source_name,source_url,subtotal_price,taxes_included,token,total_discounts,total_line_items_price,total_price,total_tax,total_weight,updated_at,user_id,note_attribute_littledata_updated_at,note_attribute_segment_client_id,billing_address_id,billing_address_is_default,presentment_currency,shipping_address_id,shipping_address_is_default,total_duties,note_attribute_email_client_id,note_attributes,note_attribute_google_client_id,_fivetran_deleted -12111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,a110f5eb2fd1d11211622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.111511,-26.112602,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda12f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, +12111,2020-06-03 11:11:51.015110,https://kitties.com/1111311610/checkouts/f050eda125a10cca513162f01101b261/recover?key=bd0fdf1dc1a1af01aecbdaa3101ec063,,,,,,,,,,,,,,,,,,,,,,,false,aaaa211622dfb133,,,2020-11-12 10:06:50.111111,,,,,,,USD,121,en,,tnyrnbs@hh.com,paypal,/collections/the-archive-sale,,#10160311,,,,123 main st,Apt 02,Washington,,United States,US,Pauly,D,31.111511,-26.112602,DJ PAULY D,(115) 061-1012,District of Columbia,DC,12305,,,,,,,web,,56.0,false,f050eda12f111b261,1.0,560.0,501.36,13.36,1,2020-11-12 10:51:10.111111,,,,,,,,,,,,, 11111,2020-01-11 06:01:35.021111,https://kitties.com/1111311610/checkouts/6661ff02165dfd11b12db112f0111226/recover?key=51611efdff11e0caccc0fd30b0e1e202,,,,,,,,village,Apt 0,daytona Beach,,Florida,US,ohio,Calles,1.1261131111,-21.502661,hi,+50266111110,Healdsburg,PA-11,,false,611faa630ce5e6bcc0bacc2a105c0126,,,2020-05-11 01:01:30.111111,,,,,,,USD,366525,en,,hyrehher@gmail.com,,/collections/sale,,#13311,,,https://www.google.com/,123 main st,Pty 3,ghreiuhtg,,United States,US,ohio,Calle pty115,,,ohio Calle pty115,+12161115152,Florida,FL,33120,,,,,,,web,,10.35,false,a165dfd11226,16.65,111.0,10.35,1.0,1,2020-05-11 01:06:35.111111,,,,,,,,,,,,, -66531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,a110c010361e1d11af3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,160363,en,,hernebbe@hr.com,,/collections/new,,#166531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,l1abddd111c0211f2021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,125150,a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file +66531,2021-11-11 11:02:30.112110,https://kitties.com/1111311610/checkouts/0abddd111c0211f1e616ec0d0c32021c/recover?key=abed6505d26f1a60a50aa0c02e01be31,,,,,,,,,,,,,,,,,,,,,,,false,aaaaa61e1d11af3adfac1f0,,,2021-11-11 02:05:13.111111,,,,,,,USD,160363,en,,hernebbe@hr.com,,/collections/new,,#166531,,,https://l.facebook.com/,11-01 01st St,apt 0C,Springfield,,United States,US,dan,the man,,,dan the man,+13021115311,New York,NY,11111-020,,,,,,,web,,191.0,false,l1abddd111c0211f2021c,1.0,111.0,111.0,1.0,1,2021-11-11 02:05:55.111111,,125150,a111c-30fc-0bb6-a25e-06f201c6035c,,,USD,,,,,"[{""name"":""segment-clientID"",""value"":""610a111c-30fc-0bb6-a25e-06f201c6035c""},{""name"":""_updatedAt"",""value"":""1613121625150""}]",, \ No newline at end of file From 956e93064f6008c233fffdb7e24c238966259871 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:55:01 -0800 Subject: [PATCH 035/137] integration tests --- integration_tests/dbt_project.yml | 9 ++++++++- models/stg_shopify__collection_product.sql | 2 +- models/stg_shopify__order_tag.sql | 2 +- models/stg_shopify__shop.sql | 6 +++--- models/stg_shopify__tender_transaction.sql | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index c94068d..902775b 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -128,4 +128,11 @@ seeds: shopify_price_rule_data: +column_types: prerequisite_subtotal_range: float - value: float \ No newline at end of file + value: float + shopify_collection_data: + +column_types: + disjunctive: boolean + shopify_metafield_data: + +column_types: + value_type: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" + type: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" \ No newline at end of file diff --git a/models/stg_shopify__collection_product.sql b/models/stg_shopify__collection_product.sql index f2d7cc2..2bc12fa 100644 --- a/models/stg_shopify__collection_product.sql +++ b/models/stg_shopify__collection_product.sql @@ -22,7 +22,7 @@ final as ( select collection_id, product_id, - _fivetran_synced, + _fivetran_synced from fields ) diff --git a/models/stg_shopify__order_tag.sql b/models/stg_shopify__order_tag.sql index d579485..09f6bdf 100644 --- a/models/stg_shopify__order_tag.sql +++ b/models/stg_shopify__order_tag.sql @@ -23,7 +23,7 @@ final as ( order_id, index, value, - _fivetran_synced, + _fivetran_synced from fields ) diff --git a/models/stg_shopify__shop.sql b/models/stg_shopify__shop.sql index 399dcb7..2397998 100644 --- a/models/stg_shopify__shop.sql +++ b/models/stg_shopify__shop.sql @@ -50,7 +50,7 @@ final as ( shop_owner, source, tax_shipping as has_shipping_taxes, - ifnull(taxes_included, false) as has_taxes_included_in_price, + case when taxes_included is null then false else taxes_included end as has_taxes_included_in_price, has_discounts, has_gift_cards, has_storefront, @@ -58,7 +58,7 @@ final as ( eligible_for_card_reader_giveaway as is_eligible_for_card_reader_giveaway, eligible_for_payments as is_eligible_for_payments, google_apps_domain, - ifnull(google_apps_login_enabled, false) as is_google_apps_login_enabled, + case when google_apps_login_enabled is null then false else google_apps_login_enabled end as is_google_apps_login_enabled, money_format, money_in_emails_format, money_with_currency_format, @@ -67,7 +67,7 @@ final as ( plan_name, password_enabled as is_password_enabled, pre_launch_enabled as is_pre_launch_enabled, - requires_extra_payments_agreement as does_require_extra_payments_agreement, + requires_extra_payments_agreement as is_extra_payments_agreement_required, setup_required as is_setup_required, created_at, updated_at, diff --git a/models/stg_shopify__tender_transaction.sql b/models/stg_shopify__tender_transaction.sql index 04f6738..9d9d944 100644 --- a/models/stg_shopify__tender_transaction.sql +++ b/models/stg_shopify__tender_transaction.sql @@ -28,7 +28,7 @@ final as ( remote_reference, user_id, processed_at, - _fivetran_synced, + _fivetran_synced from fields where not coalesce(test, false) From 329ebd38abfeb9a2dbd8b85476456d7c15c1ed1a Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 15:06:33 -0800 Subject: [PATCH 036/137] data types --- integration_tests/dbt_project.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 902775b..4448a47 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -135,4 +135,9 @@ seeds: shopify_metafield_data: +column_types: value_type: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" - type: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" \ No newline at end of file + type: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" + shopify_shop_data: + +column_types: + taxes_included: boolean + google_apps_login_enabled: boolean + county_taxes: boolean \ No newline at end of file From b7151ad320d9339dcb5cfd24ee14bf969cf44864 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 15:23:38 -0800 Subject: [PATCH 037/137] postgres and redshift --- models/stg_shopify__shop.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify__shop.sql b/models/stg_shopify__shop.sql index 2397998..6c7af14 100644 --- a/models/stg_shopify__shop.sql +++ b/models/stg_shopify__shop.sql @@ -34,7 +34,7 @@ final as ( zip, latitude, longitude, - ifnull(county_taxes, false) as has_county_taxes, + case when county_taxes is null then false else county_taxes end as has_county_taxes, currency, enabled_presentment_currencies, customer_email, From 0657333081cbaa0cb6d5c76dda79e620390d5dee Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 8 Dec 2022 15:48:00 -0800 Subject: [PATCH 038/137] databricks --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 8ba31eb..01582ec 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_test + schema: shopify_source_integration_tests threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_test + schema: shopify_source_integration_tests threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_test + schema: shopify_source_integration_tests threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_test + schema: shopify_source_integration_tests threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_test + schema: shopify_source_integration_tests threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 4448a47..b1a3da7 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,6 +4,7 @@ profile: 'integration_tests' config-version: 2 vars: + shopify_schema: shopify_source_integration_tests shopify_source: customer_source: "{{ ref('shopify_customer_data') }}" order_line_refund_source: "{{ ref('shopify_order_line_refund_data') }}" @@ -110,8 +111,8 @@ seeds: shopify_abandoned_checkout_data: +column_types: total_line_items_price: float - billing_address_phone: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" - shipping_address_phone: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" + billing_address_phone: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" + shipping_address_phone: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" shopify_discount_code_data: +column_types: usage_count: float @@ -134,8 +135,8 @@ seeds: disjunctive: boolean shopify_metafield_data: +column_types: - value_type: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" - type: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" + value_type: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" + type: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" shopify_shop_data: +column_types: taxes_included: boolean From 110cbc9a7b172f9a1def8979432aedb7070a4536 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 9 Dec 2022 15:54:26 -0800 Subject: [PATCH 039/137] fields seelction --- macros/get_customer_columns.sql | 33 +++ macros/get_order_adjustment_columns.sql | 18 ++ macros/get_order_columns.sql | 93 +++++++ macros/get_order_line_columns.sql | 43 ++++ macros/get_order_line_refund_columns.sql | 21 ++ macros/get_product_columns.sql | 22 ++ macros/get_product_variant_columns.sql | 36 +++ macros/get_refund_columns.sql | 17 ++ macros/get_transaction_columns.sql | 45 ++++ macros/staging_columns.sql | 287 ---------------------- models/stg_shopify__customer.sql | 50 +++- models/stg_shopify__order.sql | 110 ++++++++- models/stg_shopify__order_adjustment.sql | 25 +- models/stg_shopify__order_line.sql | 62 ++++- models/stg_shopify__order_line_refund.sql | 38 ++- models/tmp/stg_shopify__refund_tmp.sql | 26 +- 16 files changed, 590 insertions(+), 336 deletions(-) create mode 100644 macros/get_customer_columns.sql create mode 100644 macros/get_order_adjustment_columns.sql create mode 100644 macros/get_order_columns.sql create mode 100644 macros/get_order_line_columns.sql create mode 100644 macros/get_order_line_refund_columns.sql create mode 100644 macros/get_product_columns.sql create mode 100644 macros/get_product_variant_columns.sql create mode 100644 macros/get_refund_columns.sql create mode 100644 macros/get_transaction_columns.sql delete mode 100644 macros/staging_columns.sql diff --git a/macros/get_customer_columns.sql b/macros/get_customer_columns.sql new file mode 100644 index 0000000..6167587 --- /dev/null +++ b/macros/get_customer_columns.sql @@ -0,0 +1,33 @@ +{% macro get_customer_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "accepts_marketing", "datatype": "boolean"}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "default_address_id", "datatype": dbt.type_numeric()}, + {"name": "email", "datatype": dbt.type_string()}, + {"name": "first_name", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_numeric()}, + {"name": "last_name", "datatype": dbt.type_string()}, + {"name": "orders_count", "datatype": dbt.type_numeric()}, + {"name": "phone", "datatype": dbt.type_string()}, + {"name": "state", "datatype": dbt.type_string()}, + {"name": "tax_exempt", "datatype": "boolean"}, + {"name": "total_spent", "datatype": dbt.type_float()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, + {"name": "verified_email", "datatype": "boolean"}, + {"name": "email_marketing_consent_consent_updated_at", "datatype": dbt.type_timestamp()}, + {"name": "email_marketing_consent_opt_in_level", "datatype": dbt.type_string()}, + {"name": "email_marketing_consent_state", "datatype": dbt.type_string()}, + {"name": "note", "datatype": dbt.type_string()}, + {"name": "accepts_marketing_updated_at", "datatype": dbt.type_timestamp()}, + {"name": "marketing_opt_in_level", "datatype": dbt.type_string()}, + {"name": "lifetime_duration", "datatype": dbt.type_string()}, + {"name": "currency", "datatype": dbt.type_string()} +] %} + +{{ fivetran_utils.add_pass_through_columns(columns, var('customer_pass_through_columns')) }} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_order_adjustment_columns.sql b/macros/get_order_adjustment_columns.sql new file mode 100644 index 0000000..77b9028 --- /dev/null +++ b/macros/get_order_adjustment_columns.sql @@ -0,0 +1,18 @@ +{% macro get_order_adjustment_columns() %} + +{% set columns = [ + {"name": "id", "datatype": dbt.type_numeric()}, + {"name": "order_id", "datatype": dbt.type_numeric()}, + {"name": "refund_id", "datatype": dbt.type_numeric()}, + {"name": "amount", "datatype": dbt.type_float()}, + {"name": "amount_set", "datatype": dbt.type_string()}, + {"name": "tax_amount", "datatype": dbt.type_float()}, + {"name": "tax_amount_set", "datatype": dbt.type_string()}, + {"name": "kind", "datatype": dbt.type_string()}, + {"name": "reason", "datatype": dbt.type_string()}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()} +] %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_order_columns.sql b/macros/get_order_columns.sql new file mode 100644 index 0000000..119d131 --- /dev/null +++ b/macros/get_order_columns.sql @@ -0,0 +1,93 @@ +{% macro get_order_columns() %} + +{% set columns = [ + {"name": "id", "datatype": dbt.type_numeric()}, + {"name": "processed_at", "datatype": dbt.type_timestamp()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, + {"name": "user_id", "datatype": dbt.type_numeric()}, + {"name": "total_discounts", "datatype": dbt.type_float()}, + {"name": "total_discounts_set", "datatype": dbt.type_string()}, + {"name": "total_line_items_price", "datatype": dbt.type_float()}, + {"name": "total_line_items_price_set", "datatype": dbt.type_string()}, + {"name": "total_price", "datatype": dbt.type_float()}, + {"name": "total_price_set", "datatype": dbt.type_string()}, + {"name": "total_price_usd", "datatype": dbt.type_float()}, + {"name": "total_tax_set", "datatype": dbt.type_string()}, + {"name": "total_tax", "datatype": dbt.type_float()}, + {"name": "source_name", "datatype": dbt.type_string()}, + {"name": "subtotal_price", "datatype": dbt.type_float()}, + {"name": "taxes_included", "datatype": "boolean"}, + {"name": "total_weight", "datatype": dbt.type_numeric()}, + {"name": "total_tip_received", "datatype": dbt.type_float()}, + {"name": "landing_site_base_url", "datatype": dbt.type_string()}, + {"name": "landing_site_ref", "datatype": dbt.type_string()}, + {"name": "location_id", "datatype": dbt.type_numeric()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "note", "datatype": dbt.type_string()}, + {"name": "number", "datatype": dbt.type_numeric()}, + {"name": "order_number", "datatype": dbt.type_numeric()}, + {"name": "cancel_reason", "datatype": dbt.type_string()}, + {"name": "cancelled_at", "datatype": dbt.type_timestamp()}, + {"name": "cart_token", "datatype": dbt.type_string()}, + {"name": "checkout_token", "datatype": dbt.type_string()}, + {"name": "closed_at", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "currency", "datatype": dbt.type_string()}, + {"name": "customer_id", "datatype": dbt.type_numeric()}, + {"name": "email", "datatype": dbt.type_string()}, + {"name": "financial_status", "datatype": dbt.type_string()}, + {"name": "fulfillment_status", "datatype": dbt.type_string()}, + {"name": "processing_method", "datatype": dbt.type_string()}, + {"name": "referring_site", "datatype": dbt.type_string()}, + {"name": "billing_address_address_1", "datatype": dbt.type_string()}, + {"name": "billing_address_address_2", "datatype": dbt.type_string()}, + {"name": "billing_address_city", "datatype": dbt.type_string()}, + {"name": "billing_address_company", "datatype": dbt.type_string()}, + {"name": "billing_address_country", "datatype": dbt.type_string()}, + {"name": "billing_address_country_code", "datatype": dbt.type_string()}, + {"name": "billing_address_first_name", "datatype": dbt.type_string()}, + {"name": "billing_address_last_name", "datatype": dbt.type_string()}, + {"name": "billing_address_latitude", "datatype": dbt.type_string()}, + {"name": "billing_address_longitude", "datatype": dbt.type_string()}, + {"name": "billing_address_name", "datatype": dbt.type_string()}, + {"name": "billing_address_phone", "datatype": dbt.type_string()}, + {"name": "billing_address_province", "datatype": dbt.type_string()}, + {"name": "billing_address_province_code", "datatype": dbt.type_string()}, + {"name": "billing_address_zip", "datatype": dbt.type_string()}, + {"name": "browser_ip", "datatype": dbt.type_string()}, + {"name": "buyer_accepts_marketing", "datatype": "boolean"}, + {"name": "total_shipping_price_set", "datatype": dbt.type_string()}, + {"name": "shipping_address_address_1", "datatype": dbt.type_string()}, + {"name": "shipping_address_address_2", "datatype": dbt.type_string()}, + {"name": "shipping_address_city", "datatype": dbt.type_string()}, + {"name": "shipping_address_company", "datatype": dbt.type_string()}, + {"name": "shipping_address_country", "datatype": dbt.type_string()}, + {"name": "shipping_address_country_code", "datatype": dbt.type_string()}, + {"name": "shipping_address_first_name", "datatype": dbt.type_string()}, + {"name": "shipping_address_last_name", "datatype": dbt.type_string()}, + {"name": "shipping_address_latitude", "datatype": dbt.type_string()}, + {"name": "shipping_address_longitude", "datatype": dbt.type_string()}, + {"name": "shipping_address_name", "datatype": dbt.type_string()}, + {"name": "shipping_address_phone", "datatype": dbt.type_string()}, + {"name": "shipping_address_province", "datatype": dbt.type_string()}, + {"name": "shipping_address_province_code", "datatype": dbt.type_string()}, + {"name": "shipping_address_zip", "datatype": dbt.type_string()}, + {"name": "test", "datatype": "boolean", "alias": "is_test_order"}, + {"name": "token", "datatype": dbt.type_string()}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "app_id", "datatype": dbt.type_int()}, + {"name": "checkout_id", "datatype": dbt.type_int()}, + {"name": "client_details_user_agent", "datatype": dbt.type_string()}, + {"name": "customer_locale", "datatype": dbt.type_string()}, + {"name": "device_id", "datatype": dbt.type_string()}, + {"name": "order_status_url", "datatype": dbt.type_string()}, + {"name": "presentment_currency", "datatype": dbt.type_string()}, + {"name": "confirmed", "datatype": "boolean"} +] %} + +{{ fivetran_utils.add_pass_through_columns(columns, var('order_pass_through_columns')) }} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_order_line_columns.sql b/macros/get_order_line_columns.sql new file mode 100644 index 0000000..574cc72 --- /dev/null +++ b/macros/get_order_line_columns.sql @@ -0,0 +1,43 @@ +{% macro get_order_line_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "fulfillable_quantity", "datatype": dbt.type_numeric()}, + {"name": "fulfillment_service", "datatype": dbt.type_string()}, + {"name": "fulfillment_status", "datatype": dbt.type_string()}, + {"name": "gift_card", "datatype": "boolean"}, + {"name": "grams", "datatype": dbt.type_numeric()}, + {"name": "id", "datatype": dbt.type_numeric()}, + {"name": "index", "datatype": dbt.type_numeric()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "order_id", "datatype": dbt.type_numeric()}, + {"name": "pre_tax_price", "datatype": dbt.type_float()}, + {"name": "pre_tax_price_set", "datatype": dbt.type_string()}, + {"name": "price", "datatype": dbt.type_float()}, + {"name": "price_set", "datatype": dbt.type_string()}, + {"name": "product_id", "datatype": dbt.type_numeric()}, + {"name": "property_charge_interval_frequency", "datatype": dbt.type_numeric()}, + {"name": "property_for_shipping_jan_3_rd_2020", "datatype": dbt.type_string()}, + {"name": "property_shipping_interval_frequency", "datatype": dbt.type_numeric()}, + {"name": "property_shipping_interval_unit_type", "datatype": dbt.type_string()}, + {"name": "property_subscription_id", "datatype": dbt.type_numeric()}, + {"name": "quantity", "datatype": dbt.type_numeric()}, + {"name": "requires_shipping", "datatype": "boolean"}, + {"name": "sku", "datatype": dbt.type_string()}, + {"name": "taxable", "datatype": "boolean"}, + {"name": "tax_code", "datatype": dbt.type_string()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "total_discount", "datatype": dbt.type_float()}, + {"name": "total_discount_set", "datatype": dbt.type_string()}, + {"name": "variant_id", "datatype": dbt.type_numeric()}, + {"name": "variant_title", "datatype": dbt.type_string()}, + {"name": "variant_inventory_management", "datatype": dbt.type_string()}, + {"name": "vendor", "datatype": dbt.type_string()}, + {"name": "properties", "datatype": dbt.type_string()} +] %} + +{{ fivetran_utils.add_pass_through_columns(columns, var('order_line_pass_through_columns')) }} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_order_line_refund_columns.sql b/macros/get_order_line_refund_columns.sql new file mode 100644 index 0000000..6cd8afa --- /dev/null +++ b/macros/get_order_line_refund_columns.sql @@ -0,0 +1,21 @@ +{% macro get_order_line_refund_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_line_refund_id"}, + {"name": "location_id", "datatype": dbt.type_numeric()}, + {"name": "order_line_id", "datatype": dbt.type_numeric()}, + {"name": "subtotal", "datatype": dbt.type_numeric()}, + {"name": "subtotal_set", "datatype": dbt.type_string()}, + {"name": "total_tax", "datatype": dbt.type_numeric()}, + {"name": "total_tax_set", "datatype": dbt.type_string()}, + {"name": "quantity", "datatype": dbt.type_float()}, + {"name": "refund_id", "datatype": dbt.type_numeric()}, + {"name": "restock_type", "datatype": dbt.type_string()} +] %} + +{{ fivetran_utils.add_pass_through_columns(columns, var('order_line_refund_pass_through_columns')) }} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_product_columns.sql b/macros/get_product_columns.sql new file mode 100644 index 0000000..9d49830 --- /dev/null +++ b/macros/get_product_columns.sql @@ -0,0 +1,22 @@ +{% macro get_product_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, + {"name": "handle", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_numeric(), "alias": "product_id"}, + {"name": "product_type", "datatype": dbt.type_string()}, + {"name": "published_at", "datatype": dbt.type_timestamp(), "alias": "published_timestamp"}, + {"name": "published_scope", "datatype": dbt.type_string()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, + {"name": "vendor", "datatype": dbt.type_string()}, + {"name": "status", "datatype": dbt.type_string()} +] %} + +{{ fivetran_utils.add_pass_through_columns(columns, var('product_pass_through_columns')) }} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_product_variant_columns.sql b/macros/get_product_variant_columns.sql new file mode 100644 index 0000000..80e5c00 --- /dev/null +++ b/macros/get_product_variant_columns.sql @@ -0,0 +1,36 @@ +{% macro get_product_variant_columns() %} + +{% set columns = [ + {"name": "id", "datatype": dbt.type_numeric(), "alias": "variant_id"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, + {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, + {"name": "product_id", "datatype": dbt.type_numeric()}, + {"name": "inventory_item_id", "datatype": dbt.type_numeric()}, + {"name": "image_id", "datatype": dbt.type_numeric()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "price", "datatype": dbt.type_float()}, + {"name": "sku", "datatype": dbt.type_string()}, + {"name": "position", "datatype": dbt.type_numeric()}, + {"name": "inventory_policy", "datatype": dbt.type_string()}, + {"name": "compare_at_price", "datatype": dbt.type_float()}, + {"name": "fulfillment_service", "datatype": dbt.type_string()}, + {"name": "inventory_management", "datatype": dbt.type_string()}, + {"name": "taxable", "datatype": "boolean", "alias": "is_taxable"}, + {"name": "barcode", "datatype": dbt.type_string()}, + {"name": "grams", "datatype": dbt.type_float()}, + {"name": "inventory_quantity", "datatype": dbt.type_numeric()}, + {"name": "weight", "datatype": dbt.type_float()}, + {"name": "weight_unit", "datatype": dbt.type_string()}, + {"name": "option_1", "datatype": dbt.type_string()}, + {"name": "option_2", "datatype": dbt.type_string()}, + {"name": "option_3", "datatype": dbt.type_string()}, + {"name": "tax_code", "datatype": dbt.type_string()}, + {"name": "requires_shipping", "datatype": "boolean", "alias": "is_requiring_shipping"} +] %} + +{{ fivetran_utils.add_pass_through_columns(columns, var('product_variant_pass_through_columns')) }} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_refund_columns.sql b/macros/get_refund_columns.sql new file mode 100644 index 0000000..8460132 --- /dev/null +++ b/macros/get_refund_columns.sql @@ -0,0 +1,17 @@ +{% macro get_refund_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_numeric(), "alias": "refund_id"}, + {"name": "note", "datatype": dbt.type_string()}, + {"name": "order_id", "datatype": dbt.type_numeric()}, + {"name": "processed_at", "datatype": dbt.type_timestamp()}, + {"name": "restock", "datatype": "boolean"}, + {"name": "total_duties_set", "datatype": dbt.type_string()}, + {"name": "user_id", "datatype": dbt.type_numeric()} +] %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/get_transaction_columns.sql b/macros/get_transaction_columns.sql new file mode 100644 index 0000000..0e7d9ab --- /dev/null +++ b/macros/get_transaction_columns.sql @@ -0,0 +1,45 @@ +{% macro get_transaction_columns() %} + +{% set columns = [ + {"name": "id", "datatype": dbt.type_numeric(), "alias": "transaction_id"}, + {"name": "order_id", "datatype": dbt.type_numeric()}, + {"name": "refund_id", "datatype": dbt.type_numeric()}, + {"name": "amount", "datatype": dbt.type_numeric()}, + {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, + {"name": "processed_at", "datatype": dbt.type_timestamp(), "alias": "processed_timestamp"}, + {"name": "device_id", "datatype": dbt.type_numeric()}, + {"name": "gateway", "datatype": dbt.type_string()}, + {"name": "source_name", "datatype": dbt.type_string()}, + {"name": "message", "datatype": dbt.type_string()}, + {"name": "currency", "datatype": dbt.type_string()}, + {"name": "location_id", "datatype": dbt.type_numeric()}, + {"name": "parent_id", "datatype": dbt.type_numeric()}, + {"name": "payment_avs_result_code", "datatype": dbt.type_string()}, + {"name": "payment_credit_card_bin", "datatype": dbt.type_string()}, + {"name": "payment_cvv_result_code", "datatype": dbt.type_string()}, + {"name": "payment_credit_card_number", "datatype": dbt.type_string()}, + {"name": "payment_credit_card_company", "datatype": dbt.type_string()}, + {"name": "kind", "datatype": dbt.type_string()}, + {"name": "receipt", "datatype": dbt.type_string()}, + {"name": "currency_exchange_id", "datatype": dbt.type_numeric()}, + {"name": "currency_exchange_adjustment", "datatype": dbt.type_numeric()}, + {"name": "currency_exchange_original_amount", "datatype": dbt.type_numeric()}, + {"name": "currency_exchange_final_amount", "datatype": dbt.type_numeric()}, + {"name": "currency_exchange_currency", "datatype": dbt.type_string()}, + {"name": "error_code", "datatype": dbt.type_string()}, + {"name": "status", "datatype": dbt.type_string()}, + {"name": "test", "datatype": "boolean"}, + {"name": "user_id", "datatype": dbt.type_numeric()}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "authorization_expires_at", "datatype": dbt.type_timestamp()} +] %} + +{% if target.type in ('redshift','postgres') %} + {{ columns.append({"name": "authorization", "datatype": dbt.type_string(), "quote": True, "alias": "authorization"}) }} +{% else %} + {"name": "authorization", "datatype": dbt.type_string()} +{% endif %} + +{{ return(columns) }} + +{% endmacro %} \ No newline at end of file diff --git a/macros/staging_columns.sql b/macros/staging_columns.sql deleted file mode 100644 index a147538..0000000 --- a/macros/staging_columns.sql +++ /dev/null @@ -1,287 +0,0 @@ -{% macro get_order_columns() %} - -{% set columns = [ - {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_id"}, - {"name": "processed_at", "datatype": dbt.type_timestamp(), "alias": "processed_timestamp"}, - {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, - {"name": "user_id", "datatype": dbt.type_numeric()}, - {"name": "total_discounts", "datatype": dbt.type_float()}, - {"name": "total_line_items_price", "datatype": dbt.type_float()}, - {"name": "total_price", "datatype": dbt.type_float()}, - {"name": "total_tax", "datatype": dbt.type_float()}, - {"name": "source_name", "datatype": dbt.type_string()}, - {"name": "subtotal_price", "datatype": dbt.type_float()}, - {"name": "taxes_included", "datatype": "boolean", "alias": "has_taxes_included"}, - {"name": "total_weight", "datatype": dbt.type_numeric()}, - {"name": "landing_site_base_url", "datatype": dbt.type_string()}, - {"name": "location_id", "datatype": dbt.type_numeric()}, - {"name": "name", "datatype": dbt.type_string()}, - {"name": "note", "datatype": dbt.type_string()}, - {"name": "number", "datatype": dbt.type_numeric()}, - {"name": "order_number", "datatype": dbt.type_numeric()}, - {"name": "cancel_reason", "datatype": dbt.type_string()}, - {"name": "cancelled_at", "datatype": dbt.type_timestamp(), "alias": "cancelled_timestamp"}, - {"name": "cart_token", "datatype": dbt.type_string()}, - {"name": "checkout_token", "datatype": dbt.type_string()}, - {"name": "closed_at", "datatype": dbt.type_timestamp(), "alias": "closed_timestamp"}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "currency", "datatype": dbt.type_string()}, - {"name": "customer_id", "datatype": dbt.type_numeric()}, - {"name": "email", "datatype": dbt.type_string()}, - {"name": "financial_status", "datatype": dbt.type_string()}, - {"name": "fulfillment_status", "datatype": dbt.type_string()}, - {"name": "processing_method", "datatype": dbt.type_string()}, - {"name": "referring_site", "datatype": dbt.type_string()}, - {"name": "billing_address_address_1", "datatype": dbt.type_string()}, - {"name": "billing_address_address_2", "datatype": dbt.type_string()}, - {"name": "billing_address_city", "datatype": dbt.type_string()}, - {"name": "billing_address_company", "datatype": dbt.type_string()}, - {"name": "billing_address_country", "datatype": dbt.type_string()}, - {"name": "billing_address_country_code", "datatype": dbt.type_string()}, - {"name": "billing_address_first_name", "datatype": dbt.type_string()}, - {"name": "billing_address_last_name", "datatype": dbt.type_string()}, - {"name": "billing_address_latitude", "datatype": dbt.type_string()}, - {"name": "billing_address_longitude", "datatype": dbt.type_string()}, - {"name": "billing_address_name", "datatype": dbt.type_string()}, - {"name": "billing_address_phone", "datatype": dbt.type_string()}, - {"name": "billing_address_province", "datatype": dbt.type_string()}, - {"name": "billing_address_province_code", "datatype": dbt.type_string()}, - {"name": "billing_address_zip", "datatype": dbt.type_string()}, - {"name": "browser_ip", "datatype": dbt.type_string()}, - {"name": "buyer_accepts_marketing", "datatype": "boolean", "alias": "has_buyer_accepted_marketing"}, - {"name": "total_shipping_price_set", "datatype": dbt.type_string()}, - {"name": "shipping_address_address_1", "datatype": dbt.type_string()}, - {"name": "shipping_address_address_2", "datatype": dbt.type_string()}, - {"name": "shipping_address_city", "datatype": dbt.type_string()}, - {"name": "shipping_address_company", "datatype": dbt.type_string()}, - {"name": "shipping_address_country", "datatype": dbt.type_string()}, - {"name": "shipping_address_country_code", "datatype": dbt.type_string()}, - {"name": "shipping_address_first_name", "datatype": dbt.type_string()}, - {"name": "shipping_address_last_name", "datatype": dbt.type_string()}, - {"name": "shipping_address_latitude", "datatype": dbt.type_string()}, - {"name": "shipping_address_longitude", "datatype": dbt.type_string()}, - {"name": "shipping_address_name", "datatype": dbt.type_string()}, - {"name": "shipping_address_phone", "datatype": dbt.type_string()}, - {"name": "shipping_address_province", "datatype": dbt.type_string()}, - {"name": "shipping_address_province_code", "datatype": dbt.type_string()}, - {"name": "shipping_address_zip", "datatype": dbt.type_string()}, - {"name": "test", "datatype": "boolean", "alias": "is_test_order"}, - {"name": "token", "datatype": dbt.type_string()}, - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_customer_columns() %} - -{% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "accepts_marketing", "datatype": "boolean", "alias": "has_accepted_marketing"}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "default_address_id", "datatype": dbt.type_numeric()}, - {"name": "email", "datatype": dbt.type_string()}, - {"name": "first_name", "datatype": dbt.type_string()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "customer_id"}, - {"name": "last_name", "datatype": dbt.type_string()}, - {"name": "orders_count", "datatype": dbt.type_numeric()}, - {"name": "phone", "datatype": dbt.type_string()}, - {"name": "state", "datatype": dbt.type_string(), "alias": "account_state"}, - {"name": "tax_exempt", "datatype": "boolean", "alias": "is_tax_exempt"}, - {"name": "total_spent", "datatype": dbt.type_float()}, - {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, - {"name": "verified_email", "datatype": "boolean", "alias": "is_verified_email"} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_order_line_refund_columns() %} - -{% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_line_refund_id"}, - {"name": "location_id", "datatype": dbt.type_numeric()}, - {"name": "order_line_id", "datatype": dbt.type_numeric()}, - {"name": "subtotal", "datatype": dbt.type_numeric()}, - {"name": "total_tax", "datatype": dbt.type_numeric()}, - {"name": "quantity", "datatype": dbt.type_float()}, - {"name": "refund_id", "datatype": dbt.type_numeric()}, - {"name": "restock_type", "datatype": dbt.type_string()} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_order_line_columns() %} - -{% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "fulfillable_quantity", "datatype": dbt.type_numeric()}, - {"name": "fulfillment_service", "datatype": dbt.type_string()}, - {"name": "fulfillment_status", "datatype": dbt.type_string()}, - {"name": "gift_card", "datatype": "boolean", "alias": "is_gift_card"}, - {"name": "grams", "datatype": dbt.type_numeric()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_line_id"}, - {"name": "index", "datatype": dbt.type_numeric()}, - {"name": "name", "datatype": dbt.type_string()}, - {"name": "order_id", "datatype": dbt.type_numeric()}, - {"name": "pre_tax_price", "datatype": dbt.type_float()}, - {"name": "price", "datatype": dbt.type_float()}, - {"name": "product_id", "datatype": dbt.type_numeric()}, - {"name": "property_charge_interval_frequency", "datatype": dbt.type_numeric()}, - {"name": "property_for_shipping_jan_3_rd_2020", "datatype": dbt.type_string()}, - {"name": "property_shipping_interval_frequency", "datatype": dbt.type_numeric()}, - {"name": "property_shipping_interval_unit_type", "datatype": dbt.type_string()}, - {"name": "property_subscription_id", "datatype": dbt.type_numeric()}, - {"name": "quantity", "datatype": dbt.type_numeric()}, - {"name": "requires_shipping", "datatype": "boolean", "alias": "is_requiring_shipping"}, - {"name": "sku", "datatype": dbt.type_string()}, - {"name": "taxable", "datatype": "boolean", "alias": "is_taxable"}, - {"name": "title", "datatype": dbt.type_string()}, - {"name": "total_discount", "datatype": dbt.type_float()}, - {"name": "variant_id", "datatype": dbt.type_numeric()}, - {"name": "vendor", "datatype": dbt.type_string()} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_product_columns() %} - -{% set columns = [ - {"name": "_fivetran_deleted", "datatype": "boolean"}, - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "handle", "datatype": dbt.type_string()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "product_id"}, - {"name": "product_type", "datatype": dbt.type_string()}, - {"name": "published_at", "datatype": dbt.type_timestamp(), "alias": "published_timestamp"}, - {"name": "published_scope", "datatype": dbt.type_string()}, - {"name": "title", "datatype": dbt.type_string()}, - {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, - {"name": "vendor", "datatype": dbt.type_string()} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_product_variant_columns() %} - -{% set columns = [ - {"name": "id", "datatype": dbt.type_numeric(), "alias": "variant_id"}, - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, - {"name": "product_id", "datatype": dbt.type_numeric()}, - {"name": "inventory_item_id", "datatype": dbt.type_numeric()}, - {"name": "image_id", "datatype": dbt.type_numeric()}, - {"name": "title", "datatype": dbt.type_string()}, - {"name": "price", "datatype": dbt.type_float()}, - {"name": "sku", "datatype": dbt.type_string()}, - {"name": "position", "datatype": dbt.type_numeric()}, - {"name": "inventory_policy", "datatype": dbt.type_string()}, - {"name": "compare_at_price", "datatype": dbt.type_float()}, - {"name": "fulfillment_service", "datatype": dbt.type_string()}, - {"name": "inventory_management", "datatype": dbt.type_string()}, - {"name": "taxable", "datatype": "boolean", "alias": "is_taxable"}, - {"name": "barcode", "datatype": dbt.type_string()}, - {"name": "grams", "datatype": dbt.type_float()}, - {"name": "inventory_quantity", "datatype": dbt.type_numeric()}, - {"name": "weight", "datatype": dbt.type_float()}, - {"name": "weight_unit", "datatype": dbt.type_string()}, - {"name": "option_1", "datatype": dbt.type_string()}, - {"name": "option_2", "datatype": dbt.type_string()}, - {"name": "option_3", "datatype": dbt.type_string()}, - {"name": "tax_code", "datatype": dbt.type_string()}, - {"name": "old_inventory_quantity", "datatype": dbt.type_numeric()}, - {"name": "requires_shipping", "datatype": "boolean", "alias": "is_requiring_shipping"} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_transaction_columns() %} - -{% set columns = [ - {"name": "id", "datatype": dbt.type_numeric(), "alias": "transaction_id"}, - {"name": "order_id", "datatype": dbt.type_numeric()}, - {"name": "refund_id", "datatype": dbt.type_numeric()}, - {"name": "amount", "datatype": dbt.type_numeric()}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "processed_at", "datatype": dbt.type_timestamp(), "alias": "processed_timestamp"}, - {"name": "device_id", "datatype": dbt.type_numeric()}, - {"name": "gateway", "datatype": dbt.type_string()}, - {"name": "source_name", "datatype": dbt.type_string()}, - {"name": "message", "datatype": dbt.type_string()}, - {"name": "currency", "datatype": dbt.type_string()}, - {"name": "location_id", "datatype": dbt.type_numeric()}, - {"name": "parent_id", "datatype": dbt.type_numeric()}, - {"name": "payment_avs_result_code", "datatype": dbt.type_string()}, - {"name": "payment_credit_card_bin", "datatype": dbt.type_string()}, - {"name": "payment_cvv_result_code", "datatype": dbt.type_string()}, - {"name": "payment_credit_card_number", "datatype": dbt.type_string()}, - {"name": "payment_credit_card_company", "datatype": dbt.type_string()}, - {"name": "kind", "datatype": dbt.type_string()}, - {"name": "receipt", "datatype": dbt.type_string()}, - {"name": "currency_exchange_id", "datatype": dbt.type_numeric()}, - {"name": "currency_exchange_adjustment", "datatype": dbt.type_numeric()}, - {"name": "currency_exchange_original_amount", "datatype": dbt.type_numeric()}, - {"name": "currency_exchange_final_amount", "datatype": dbt.type_numeric()}, - {"name": "currency_exchange_currency", "datatype": dbt.type_string()}, - {"name": "error_code", "datatype": dbt.type_string()}, - {"name": "status", "datatype": dbt.type_string()}, - {"name": "test", "datatype": "boolean"}, - {"name": "user_id", "datatype": dbt.type_numeric()}, - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()} -] %} - -{% if target.type in ('redshift','postgres') %} - {{ columns.append({"name": "authorization", "datatype": dbt.type_string(), "quote": True, "alias": "authorization"}) }} -{% else %} - {"name": "authorization", "datatype": dbt.type_string()} -{% endif %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_refund_columns() %} - -{% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "created_at", "datatype": dbt.type_timestamp()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "refund_id"}, - {"name": "note", "datatype": dbt.type_string()}, - {"name": "order_id", "datatype": dbt.type_numeric()}, - {"name": "processed_at", "datatype": dbt.type_timestamp()}, - {"name": "restock", "datatype": "boolean"}, - {"name": "user_id", "datatype": dbt.type_numeric()} -] %} - -{{ return(columns) }} - -{% endmacro %} - -{% macro get_order_adjustment_columns() %} - -{% set columns = [ - {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_adjustment_id"}, - {"name": "order_id", "datatype": dbt.type_numeric()}, - {"name": "refund_id", "datatype": dbt.type_numeric()}, - {"name": "amount", "datatype": dbt.type_float()}, - {"name": "tax_amount", "datatype": dbt.type_float()}, - {"name": "kind", "datatype": dbt.type_string()}, - {"name": "reason", "datatype": dbt.type_string()}, - {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()} -] %} - -{{ return(columns) }} - -{% endmacro %} diff --git a/models/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index 32e943c..3e2262b 100644 --- a/models/stg_shopify__customer.sql +++ b/models/stg_shopify__customer.sql @@ -1,10 +1,11 @@ -with source as ( +with base as ( - select * from {{ ref('stg_shopify__customer_tmp') }} + select * + from {{ ref('stg_shopify__customer_tmp') }} ), -renamed as ( +fields as ( select @@ -15,21 +16,46 @@ renamed as ( ) }} - --The below script allows for pass through columns. - {% if var('customer_pass_through_columns') %} - , - {{ var('customer_pass_through_columns') | join (", ")}} - - {% endif %} {{ fivetran_utils.source_relation( union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases') }} - from source + from base -) +), -select * from renamed +final as ( + + select + coalesce(accepts_marketing, email_marketing_consent_state) as has_accepted_marketing, + created_at as created_timestamp, + default_address_id, + email, + first_name, + id as customer_id, + last_name, + orders_count, + phone, + state as account_state, + tax_exempt as is_tax_exempt, + total_spent, + updated_at as updated_timestamp, + verified_email as is_verified_email, + note, + coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as accepts_marketing_updated_at, + coalesce(marketing_opt_in_level, email_marketing_consent_opt_in_level) as marketing_opt_in_level, + lifetime_duration, + currency, + source_relation, + _fivetran_synced + + {{ fivetran_utils.fill_pass_through_columns('customer_pass_through_columns') }} + + from fields + +) +select * +from final \ No newline at end of file diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index 17798dd..49197f5 100644 --- a/models/stg_shopify__order.sql +++ b/models/stg_shopify__order.sql @@ -1,10 +1,11 @@ -with source as ( +with base as ( - select * from {{ ref('stg_shopify__order_tmp') }} + select * + from {{ ref('stg_shopify__order_tmp') }} ), -renamed as ( +fields as ( select @@ -15,13 +16,6 @@ renamed as ( ) }} - --The below script allows for pass through columns. - {% if var('order_pass_through_columns') %} - , - {{ var('order_pass_through_columns') | join (", ")}} - - {% endif %} - {{ fivetran_utils.source_relation( union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases') @@ -29,6 +23,100 @@ renamed as ( from source +), + +final as ( + + select + id as order_id, + processed_at as processed_timestamp, + updated_at as updated_timestamp, + user_id, + total_discounts, + total_discounts_set, + total_line_items_price, + total_line_items_price_set, + total_price, + total_price_set, + total_price_usd, + total_tax_set, + total_tax, + source_name, + subtotal_price, + taxes_included as has_taxes_included, + total_weight, + total_tip_received, + landing_site_base_url, + landing_site_ref, + location_id, + name, + note, + number, + order_number, + cancel_reason, + cancelled_at as cancelled_timestamp, + cart_token, + checkout_token, + closed_at as closed_timestamp, + created_at as created_timestamp, + currency, + customer_id, + email, + financial_status, + fulfillment_status, + processing_method, + referring_site, + billing_address_address_1, + billing_address_address_2, + billing_address_city, + billing_address_company, + billing_address_country, + billing_address_country_code, + billing_address_first_name, + billing_address_last_name, + billing_address_latitude, + billing_address_longitude, + billing_address_name, + billing_address_phone, + billing_address_province, + billing_address_province_code, + billing_address_zip, + browser_ip, + buyer_accepts_marketing as has_buyer_accepted_marketing, + total_shipping_price_set, + shipping_address_address_1, + shipping_address_address_2, + shipping_address_city, + shipping_address_company, + shipping_address_country, + shipping_address_country_code, + shipping_address_first_name, + shipping_address_last_name, + shipping_address_latitude, + shipping_address_longitude, + shipping_address_name, + shipping_address_phone, + shipping_address_province, + shipping_address_province_code, + shipping_address_zip, + test, + token, + _fivetran_synced, + _fivetran_deleted, + app_id, + checkout_id, + client_details_user_agent, + customer_locale, + device_id, + order_status_url, + presentment_currency, + confirmed, + source_relation + + {{ fivetran_utils.fill_pass_through_columns('order_pass_through_columns') }} + + from fields ) -select * from renamed \ No newline at end of file +select * +from final \ No newline at end of file diff --git a/models/stg_shopify__order_adjustment.sql b/models/stg_shopify__order_adjustment.sql index 9570f35..fbd59a6 100644 --- a/models/stg_shopify__order_adjustment.sql +++ b/models/stg_shopify__order_adjustment.sql @@ -1,14 +1,14 @@ --To disable this model, set the shopify__using_order_adjustment variable within your dbt_project.yml file to False. {{ config(enabled=var('shopify__using_order_adjustment', True)) }} -with source as ( +with base as ( select * from {{ ref('stg_shopify__order_adjustment_tmp') }} ), -renamed as ( +fields as ( select {{ @@ -24,6 +24,25 @@ renamed as ( }} from source +), + +final as ( + + select + id as order_adjustment_id, + order_id, + refund_id, + amount, + amount_set, + tax_amount, + tax_amount_set, + kind, + reason, + source_relation, + _fivetran_synced + + from fields ) -select * from renamed +select * +from final diff --git a/models/stg_shopify__order_line.sql b/models/stg_shopify__order_line.sql index ab0297f..4811e1e 100644 --- a/models/stg_shopify__order_line.sql +++ b/models/stg_shopify__order_line.sql @@ -1,10 +1,11 @@ -with source as ( +with base as ( - select * from {{ ref('stg_shopify__order_line_tmp') }} + select * + from {{ ref('stg_shopify__order_line_tmp') }} ), -renamed as ( +fields as ( select @@ -15,13 +16,6 @@ renamed as ( ) }} - --The below script allows for pass through columns. - {% if var('order_line_pass_through_columns') %} - , - {{ var('order_line_pass_through_columns') | join (", ")}} - - {% endif %} - {{ fivetran_utils.source_relation( union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases') @@ -29,7 +23,53 @@ renamed as ( from source +), + +final as ( + + select + + fulfillable_quantity, + fulfillment_service, + fulfillment_status, + gift_card as is_gift_card, + grams, + id as order_line_id, + index, + name, + order_id, + pre_tax_price, + pre_tax_price_set, + price, + price_set, + product_id, + property_charge_interval_frequency, + property_for_shipping_jan_3_rd_2020, + property_shipping_interval_frequency, + property_shipping_interval_unit_type, + property_subscription_id, + quantity, + requires_shipping as is_shipping_required, + sku, + taxable as is_taxable, + tax_code, + title, + total_discount, + total_discount_set, + variant_id, + variant_title, + variant_inventory_management, + vendor, + properties, + source_relation, + _fivetran_synced + + {{ fivetran_utils.fill_pass_through_columns('order_line_pass_through_columns') }} + + from fields + ) -select * from renamed +select * +from final diff --git a/models/stg_shopify__order_line_refund.sql b/models/stg_shopify__order_line_refund.sql index f1ad8bb..7d20b1a 100644 --- a/models/stg_shopify__order_line_refund.sql +++ b/models/stg_shopify__order_line_refund.sql @@ -1,13 +1,14 @@ --To disable this model, set the shopify__using_order_line_refund variable within your dbt_project.yml file to False. {{ config(enabled=var('shopify__using_order_line_refund', True)) }} -with source as ( +with base as ( - select * from {{ ref('stg_shopify__order_line_refund_tmp') }} + select * + from {{ ref('stg_shopify__order_line_refund_tmp') }} ), -renamed as ( +fields as ( select @@ -18,13 +19,6 @@ renamed as ( ) }} - --The below script allows for pass through columns. - {% if var('order_line_refund_pass_through_columns') %} - , - {{ var('order_line_refund_pass_through_columns') | join (", ")}} - - {% endif %} - {{ fivetran_utils.source_relation( union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases') @@ -32,7 +26,29 @@ renamed as ( from source +), + +final as ( + + select + id as order_line_refund_id, + location_id, + order_line_id, + subtotal, + subtotal_set, + total_tax, + total_tax_set, + quantity, + refund_id, + restock_type, + _fivetran_synced, + source_relation, + + {{ fivetran_utils.fill_pass_through_columns('order_line_refund_pass_through_columns') }} + + from fields ) -select * from renamed +select * +from final diff --git a/models/tmp/stg_shopify__refund_tmp.sql b/models/tmp/stg_shopify__refund_tmp.sql index 80de149..c3eff2d 100644 --- a/models/tmp/stg_shopify__refund_tmp.sql +++ b/models/tmp/stg_shopify__refund_tmp.sql @@ -1,6 +1,15 @@ --To disable this model, set the shopify__using_refund variable within your dbt_project.yml file to False. {{ config(enabled=var('shopify__using_refund', True)) }} +{%- set source_relation = adapter.get_relation( + database=source('shopify', 'refund').database, + schema=source('shopify', 'refund').schema, + identifier=source('shopify', 'refund').name) -%} + +{% set table_exists=source_relation is not none %} + +{% if table_exists %} + {{ fivetran_utils.union_data( table_identifier='refund', @@ -12,4 +21,19 @@ union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases' ) -}} \ No newline at end of file +}} + +{% else %} + +select + cast(null as {{ dbt_utils.type_timestamp() }}) as _fivetran_synced, + cast(null as {{ dbt_utils.type_timestamp() }}) as created_at, + cast(null as {{ dbt_utils.type_numeric() }}) as id, + cast(null as {{ dbt_utils.type_string() }}) as note, + cast(null as {{ dbt_utils.type_numeric() }}) as order_id, + cast(null as {{ dbt_utils.type_timestamp() }}) as processed_at, + cast(null as boolean) as restock, + cast(null as {{ dbt_utils.type_string() }}) as total_duties_set, + cast(null as {{ dbt_utils.type_numeric() }}) as user_id + +{% endif %} \ No newline at end of file From 785c2ee302c57cb0a5e5ef42dcbe47652ba48d46 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:07:26 -0800 Subject: [PATCH 040/137] lotsa work --- CHANGELOG.md | 6 +++ macros/get_order_columns.sql | 2 +- macros/get_order_line_refund_columns.sql | 2 +- macros/get_product_columns.sql | 8 +-- macros/get_product_variant_columns.sql | 11 ++--- macros/get_refund_columns.sql | 2 +- macros/get_transaction_columns.sql | 8 +-- models/stg_shopify.yml | 4 +- models/stg_shopify__customer.sql | 8 +-- models/stg_shopify__order.sql | 14 +++--- models/stg_shopify__order_adjustment.sql | 4 +- models/stg_shopify__order_line.sql | 5 +- models/stg_shopify__order_line_refund.sql | 5 +- models/stg_shopify__product.sql | 43 ++++++++++++----- models/stg_shopify__product_variant.sql | 54 ++++++++++++++++----- models/stg_shopify__refund.sql | 26 ++++++++-- models/stg_shopify__transaction.sql | 59 ++++++++++++++++++----- models/tmp/stg_shopify__refund_tmp.sql | 17 ++++--- packages.yml | 7 ++- 19 files changed, 195 insertions(+), 90 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ee4f1b..96928a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,12 @@ - `dbt.current_timestamp_backcompat` - `dbt.current_timestamp_in_utc_backcompat` - Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. +- In the following tables, `*_timestamp` columns have been renamed to `*_at` for consistency: + - `stg_shopify__customer` + - `stg_shopify__order` + - `stg_shopify__product_variant` + - `stg_shopify__product` + - `stg_shopify__transaction` # dbt_shopify_source v0.6.0 🎉 dbt v1.0.0 Compatibility 🎉 diff --git a/macros/get_order_columns.sql b/macros/get_order_columns.sql index 119d131..c3b9a16 100644 --- a/macros/get_order_columns.sql +++ b/macros/get_order_columns.sql @@ -72,7 +72,7 @@ {"name": "shipping_address_province", "datatype": dbt.type_string()}, {"name": "shipping_address_province_code", "datatype": dbt.type_string()}, {"name": "shipping_address_zip", "datatype": dbt.type_string()}, - {"name": "test", "datatype": "boolean", "alias": "is_test_order"}, + {"name": "test", "datatype": "boolean"}, {"name": "token", "datatype": dbt.type_string()}, {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, {"name": "_fivetran_deleted", "datatype": "boolean"}, diff --git a/macros/get_order_line_refund_columns.sql b/macros/get_order_line_refund_columns.sql index 6cd8afa..818757b 100644 --- a/macros/get_order_line_refund_columns.sql +++ b/macros/get_order_line_refund_columns.sql @@ -2,7 +2,7 @@ {% set columns = [ {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "order_line_refund_id"}, + {"name": "id", "datatype": dbt.type_numeric()}, {"name": "location_id", "datatype": dbt.type_numeric()}, {"name": "order_line_id", "datatype": dbt.type_numeric()}, {"name": "subtotal", "datatype": dbt.type_numeric()}, diff --git a/macros/get_product_columns.sql b/macros/get_product_columns.sql index 9d49830..28c2254 100644 --- a/macros/get_product_columns.sql +++ b/macros/get_product_columns.sql @@ -3,14 +3,14 @@ {% set columns = [ {"name": "_fivetran_deleted", "datatype": "boolean"}, {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, {"name": "handle", "datatype": dbt.type_string()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "product_id"}, + {"name": "id", "datatype": dbt.type_numeric()}, {"name": "product_type", "datatype": dbt.type_string()}, - {"name": "published_at", "datatype": dbt.type_timestamp(), "alias": "published_timestamp"}, + {"name": "published_at", "datatype": dbt.type_timestamp()}, {"name": "published_scope", "datatype": dbt.type_string()}, {"name": "title", "datatype": dbt.type_string()}, - {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, {"name": "vendor", "datatype": dbt.type_string()}, {"name": "status", "datatype": dbt.type_string()} ] %} diff --git a/macros/get_product_variant_columns.sql b/macros/get_product_variant_columns.sql index 80e5c00..5738745 100644 --- a/macros/get_product_variant_columns.sql +++ b/macros/get_product_variant_columns.sql @@ -1,10 +1,10 @@ {% macro get_product_variant_columns() %} {% set columns = [ - {"name": "id", "datatype": dbt.type_numeric(), "alias": "variant_id"}, + {"name": "id", "datatype": dbt.type_numeric()}, {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "updated_at", "datatype": dbt.type_timestamp(), "alias": "updated_timestamp"}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, {"name": "product_id", "datatype": dbt.type_numeric()}, {"name": "inventory_item_id", "datatype": dbt.type_numeric()}, {"name": "image_id", "datatype": dbt.type_numeric()}, @@ -16,7 +16,7 @@ {"name": "compare_at_price", "datatype": dbt.type_float()}, {"name": "fulfillment_service", "datatype": dbt.type_string()}, {"name": "inventory_management", "datatype": dbt.type_string()}, - {"name": "taxable", "datatype": "boolean", "alias": "is_taxable"}, + {"name": "taxable", "datatype": "boolean"}, {"name": "barcode", "datatype": dbt.type_string()}, {"name": "grams", "datatype": dbt.type_float()}, {"name": "inventory_quantity", "datatype": dbt.type_numeric()}, @@ -25,8 +25,7 @@ {"name": "option_1", "datatype": dbt.type_string()}, {"name": "option_2", "datatype": dbt.type_string()}, {"name": "option_3", "datatype": dbt.type_string()}, - {"name": "tax_code", "datatype": dbt.type_string()}, - {"name": "requires_shipping", "datatype": "boolean", "alias": "is_requiring_shipping"} + {"name": "tax_code", "datatype": dbt.type_string()} ] %} {{ fivetran_utils.add_pass_through_columns(columns, var('product_variant_pass_through_columns')) }} diff --git a/macros/get_refund_columns.sql b/macros/get_refund_columns.sql index 8460132..affce51 100644 --- a/macros/get_refund_columns.sql +++ b/macros/get_refund_columns.sql @@ -3,7 +3,7 @@ {% set columns = [ {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, {"name": "created_at", "datatype": dbt.type_timestamp()}, - {"name": "id", "datatype": dbt.type_numeric(), "alias": "refund_id"}, + {"name": "id", "datatype": dbt.type_numeric()}, {"name": "note", "datatype": dbt.type_string()}, {"name": "order_id", "datatype": dbt.type_numeric()}, {"name": "processed_at", "datatype": dbt.type_timestamp()}, diff --git a/macros/get_transaction_columns.sql b/macros/get_transaction_columns.sql index 0e7d9ab..dfd2f6e 100644 --- a/macros/get_transaction_columns.sql +++ b/macros/get_transaction_columns.sql @@ -1,12 +1,12 @@ {% macro get_transaction_columns() %} {% set columns = [ - {"name": "id", "datatype": dbt.type_numeric(), "alias": "transaction_id"}, + {"name": "id", "datatype": dbt.type_numeric()}, {"name": "order_id", "datatype": dbt.type_numeric()}, {"name": "refund_id", "datatype": dbt.type_numeric()}, {"name": "amount", "datatype": dbt.type_numeric()}, - {"name": "created_at", "datatype": dbt.type_timestamp(), "alias": "created_timestamp"}, - {"name": "processed_at", "datatype": dbt.type_timestamp(), "alias": "processed_timestamp"}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "processed_at", "datatype": dbt.type_timestamp()}, {"name": "device_id", "datatype": dbt.type_numeric()}, {"name": "gateway", "datatype": dbt.type_string()}, {"name": "source_name", "datatype": dbt.type_string()}, @@ -37,7 +37,7 @@ {% if target.type in ('redshift','postgres') %} {{ columns.append({"name": "authorization", "datatype": dbt.type_string(), "quote": True, "alias": "authorization"}) }} {% else %} - {"name": "authorization", "datatype": dbt.type_string()} + {{ columns.append({"name": "authorization", "datatype": dbt.type_string()}) }} {% endif %} {{ return(columns) }} diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index e8c066e..8122bb6 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -99,7 +99,7 @@ models: description: The ID of the product that the line item belongs to. Can be null if the original product associated with the order is deleted at a later date. - name: quantity description: The number of items that were purchased. - - name: is_requiring_shipping + - name: is_shipping_required description: Whether the item requires shipping. - name: sku description: The item's SKU (stock keeping unit). @@ -336,8 +336,6 @@ models: description: The price of the product variant. - name: product_id description: The unique numeric identifier for the product. - - name: is_requiring_shipping - description: This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead. - name: sku description: A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService. - name: is_taxable diff --git a/models/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index 3e2262b..5c84f2c 100644 --- a/models/stg_shopify__customer.sql +++ b/models/stg_shopify__customer.sql @@ -16,7 +16,6 @@ fields as ( ) }} - {{ fivetran_utils.source_relation( union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases') @@ -29,8 +28,9 @@ fields as ( final as ( select - coalesce(accepts_marketing, email_marketing_consent_state) as has_accepted_marketing, - created_at as created_timestamp, + accepts_marketing as has_accepted_marketing, + email_marketing_consent_state, + created_at, default_address_id, email, first_name, @@ -41,7 +41,7 @@ final as ( state as account_state, tax_exempt as is_tax_exempt, total_spent, - updated_at as updated_timestamp, + updated_at, verified_email as is_verified_email, note, coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as accepts_marketing_updated_at, diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index 49197f5..ab9194f 100644 --- a/models/stg_shopify__order.sql +++ b/models/stg_shopify__order.sql @@ -21,7 +21,7 @@ fields as ( union_database_variable='shopify_union_databases') }} - from source + from base ), @@ -29,8 +29,8 @@ final as ( select id as order_id, - processed_at as processed_timestamp, - updated_at as updated_timestamp, + processed_at, + updated_at, user_id, total_discounts, total_discounts_set, @@ -54,11 +54,11 @@ final as ( number, order_number, cancel_reason, - cancelled_at as cancelled_timestamp, + cancelled_at, cart_token, checkout_token, - closed_at as closed_timestamp, - created_at as created_timestamp, + closed_at, + created_at, currency, customer_id, email, @@ -99,7 +99,7 @@ final as ( shipping_address_province, shipping_address_province_code, shipping_address_zip, - test, + test as is_test_order, token, _fivetran_synced, _fivetran_deleted, diff --git a/models/stg_shopify__order_adjustment.sql b/models/stg_shopify__order_adjustment.sql index fbd59a6..a24d915 100644 --- a/models/stg_shopify__order_adjustment.sql +++ b/models/stg_shopify__order_adjustment.sql @@ -23,7 +23,7 @@ fields as ( union_database_variable='shopify_union_databases') }} - from source + from base ), final as ( @@ -45,4 +45,4 @@ final as ( ) select * -from final +from final \ No newline at end of file diff --git a/models/stg_shopify__order_line.sql b/models/stg_shopify__order_line.sql index 4811e1e..a52b6ef 100644 --- a/models/stg_shopify__order_line.sql +++ b/models/stg_shopify__order_line.sql @@ -21,7 +21,7 @@ fields as ( union_database_variable='shopify_union_databases') }} - from source + from base ), @@ -71,5 +71,4 @@ final as ( ) select * -from final - +from final \ No newline at end of file diff --git a/models/stg_shopify__order_line_refund.sql b/models/stg_shopify__order_line_refund.sql index 7d20b1a..80fd3f0 100644 --- a/models/stg_shopify__order_line_refund.sql +++ b/models/stg_shopify__order_line_refund.sql @@ -24,7 +24,7 @@ fields as ( union_database_variable='shopify_union_databases') }} - from source + from base ), @@ -50,5 +50,4 @@ final as ( ) select * -from final - +from final \ No newline at end of file diff --git a/models/stg_shopify__product.sql b/models/stg_shopify__product.sql index 6be960f..405acca 100644 --- a/models/stg_shopify__product.sql +++ b/models/stg_shopify__product.sql @@ -1,10 +1,11 @@ -with source as ( +with base as ( - select * from {{ ref('stg_shopify__product_tmp') }} + select * + from {{ ref('stg_shopify__product_tmp') }} ), -renamed as ( +fields as ( select @@ -15,21 +16,37 @@ renamed as ( ) }} - --The below script allows for pass through columns. - {% if var('product_pass_through_columns') %} - , - {{ var('product_pass_through_columns') | join (", ")}} - - {% endif %} - {{ fivetran_utils.source_relation( union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases') }} - from source + from base -) +), -select * from renamed +final as ( + + select + created_at, + handle, + id as product_id, + product_type, + published_at, + published_scope, + title, + updated_at, + vendor, + status, + _fivetran_deleted as is_deleted, + _fivetran_synced, + source_relation + + {{ fivetran_utils.fill_pass_through_columns('product_pass_through_columns') }} + +from fields + +) +select * +from final \ No newline at end of file diff --git a/models/stg_shopify__product_variant.sql b/models/stg_shopify__product_variant.sql index 13c0fb5..07f9c80 100644 --- a/models/stg_shopify__product_variant.sql +++ b/models/stg_shopify__product_variant.sql @@ -1,10 +1,11 @@ -with source as ( +with base as ( - select * from {{ ref('stg_shopify__product_variant_tmp') }} + select * + from {{ ref('stg_shopify__product_variant_tmp') }} ), -renamed as ( +fields as ( select @@ -15,20 +16,49 @@ renamed as ( ) }} - --The below script allows for pass through columns. - {% if var('product_variant_pass_through_columns') %} - , - {{ var('product_variant_pass_through_columns') | join (", ")}} - - {% endif %} - {{ fivetran_utils.source_relation( union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases') }} - from source + from base + +), + +final as ( + + select + id as variant_id, + _fivetran_synced, + created_at, + updated_at, + product_id, + inventory_item_id, + image_id, + title, + price, + sku, + position, + inventory_policy, + compare_at_price, + fulfillment_service, + inventory_management, + taxable as is_taxable, + barcode, + grams, + inventory_quantity, + weight, + weight_unit, + option_1, + option_2, + option_3, + tax_code, + source_relation + + {{ fivetran_utils.fill_pass_through_columns('product_variant_pass_through_columns') }} + from fields ) -select * from renamed \ No newline at end of file +select * +from final \ No newline at end of file diff --git a/models/stg_shopify__refund.sql b/models/stg_shopify__refund.sql index 4e7c6e1..ef550d6 100644 --- a/models/stg_shopify__refund.sql +++ b/models/stg_shopify__refund.sql @@ -1,14 +1,14 @@ --To disable this model, set the shopify__using_refund variable within your dbt_project.yml file to False. {{ config(enabled=var('shopify__using_refund', True)) }} -with source as ( +with base as ( select * from {{ ref('stg_shopify__refund_tmp') }} ), -renamed as ( +fields as ( select {{ @@ -23,7 +23,25 @@ renamed as ( union_database_variable='shopify_union_databases') }} - from source + from base +), + +final as ( + + select + created_at, + id as refund_id, + note, + order_id, + processed_at, + restock, + total_duties_set, + user_id, + _fivetran_synced, + source_relation + + from fields ) -select * from renamed +select * +from final \ No newline at end of file diff --git a/models/stg_shopify__transaction.sql b/models/stg_shopify__transaction.sql index 6dc51d2..c0c5417 100644 --- a/models/stg_shopify__transaction.sql +++ b/models/stg_shopify__transaction.sql @@ -1,10 +1,10 @@ -with source as ( +with base as ( select * from {{ ref('stg_shopify__transaction_tmp') }} ), -renamed as ( +fields as ( select @@ -15,21 +15,56 @@ renamed as ( ) }} - --The below script allows for pass through columns. - {% if var('transaction_pass_through_columns') %} - , - {{ var('transaction_pass_through_columns') | join (", ")}} - - {% endif %} - {{ fivetran_utils.source_relation( union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases') }} - from source - where not test + from base + +), + +final as ( + + select + id as transaction_id, + order_id, + refund_id, + amount, + created_at, + processed_at, + device_id, + gateway, + source_name, + message, + currency, + location_id, + parent_id, + payment_avs_result_code, + payment_credit_card_bin, + payment_cvv_result_code, + payment_credit_card_number, + payment_credit_card_company, + kind, + receipt, + currency_exchange_id, + currency_exchange_adjustment, + currency_exchange_original_amount, + currency_exchange_final_amount, + currency_exchange_currency, + error_code, + status, + user_id, + _fivetran_synced, + authorization_expires_at, + authorization, + source_relation + + {{ fivetran_utils.fill_pass_through_columns('transaction_pass_through_columns') }} + from fields + where not coalesce(test, false) ) -select * from renamed +select * +from final \ No newline at end of file diff --git a/models/tmp/stg_shopify__refund_tmp.sql b/models/tmp/stg_shopify__refund_tmp.sql index c3eff2d..d57c0ce 100644 --- a/models/tmp/stg_shopify__refund_tmp.sql +++ b/models/tmp/stg_shopify__refund_tmp.sql @@ -26,14 +26,15 @@ {% else %} select - cast(null as {{ dbt_utils.type_timestamp() }}) as _fivetran_synced, - cast(null as {{ dbt_utils.type_timestamp() }}) as created_at, - cast(null as {{ dbt_utils.type_numeric() }}) as id, - cast(null as {{ dbt_utils.type_string() }}) as note, - cast(null as {{ dbt_utils.type_numeric() }}) as order_id, - cast(null as {{ dbt_utils.type_timestamp() }}) as processed_at, + cast(null as {{ dbt.type_timestamp() }}) as _fivetran_synced, + cast(null as {{ dbt.type_timestamp() }}) as created_at, + cast(null as {{ dbt.type_numeric() }}) as id, + cast(null as {{ dbt.type_string() }}) as note, + cast(null as {{ dbt.type_numeric() }}) as order_id, + cast(null as {{ dbt.type_timestamp() }}) as processed_at, cast(null as boolean) as restock, - cast(null as {{ dbt_utils.type_string() }}) as total_duties_set, - cast(null as {{ dbt_utils.type_numeric() }}) as user_id + cast(null as {{ dbt.type_string() }}) as total_duties_set, + cast(null as {{ dbt.type_numeric() }}) as user_id, + cast(null as {{ dbt.type_string() }}) as _dbt_source_relation {% endif %} \ No newline at end of file diff --git a/packages.yml b/packages.yml index 908f471..2f19c7a 100644 --- a/packages.yml +++ b/packages.yml @@ -1,5 +1,8 @@ packages: -- package: fivetran/fivetran_utils - version: [">=0.4.0", "<0.5.0"] +# - package: fivetran/fivetran_utils +# version: [">=0.4.0", "<0.5.0"] +- git: https://github.com/fivetran/dbt_fivetran_utils.git + revision: backwards-compat-passthru + warn-unpinned: false - package: dbt-labs/spark_utils version: [">=0.3.0", "<0.4.0"] From 2fbc84e7df200404cd810b8e7e165558e99f45e1 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:22:41 -0800 Subject: [PATCH 041/137] one more changelog thing --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96928a9..91311c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ - `stg_shopify__product_variant` - `stg_shopify__product` - `stg_shopify__transaction` +- The `is_requiring_shipping` field in `stg_shopify__order_line` has been renamed to `is_shipping_required`, just because it sounds better :) # dbt_shopify_source v0.6.0 🎉 dbt v1.0.0 Compatibility 🎉 From 0ae9d605a35386dd833dd3b3fe433bbe099caeff Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 13 Dec 2022 13:47:24 -0800 Subject: [PATCH 042/137] order identifier --- README.md | 2 +- integration_tests/dbt_project.yml | 2 +- models/src_shopify.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 46ed528..b19adc4 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ models: ``` ### Change the source table references If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable: -> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_shopify_source/blob/main/dbt_project.yml) variable declarations to see the expected names. +> IMPORTANT: See this project's [`src_shopify.yml`](https://github.com/fivetran/dbt_shopify_source/blob/main/models/src_shopify.yml) for the default names. ```yml # dbt_project.yml diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 48ec16f..d753875 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -8,7 +8,7 @@ vars: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" shopify_order_line_identifier: "shopify_order_line_data" - order_source: "{{ ref('shopify_order_data') }}" + shopify_order_identifier: "shopify_order_data" shopify_product_identifier: "shopify_product_data" shopify_order_adjustment_identifier: "shopify_order_adjustment_data" shopify_product_variant_identifier: "shopify_product_variant_data" diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 1c30d78..e720723 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -7,7 +7,7 @@ sources: tables: - name: order description: Each record represents an order in Shopify. - identifier: "{%- if target.type == 'snowflake' -%} ORDER {%- else -%} order {%- endif -%}" + identifier: "{{ var('shopify_order_identifier', 'ORDER' if target.type == 'snowflake' else 'order') }}" quoting: identifier: true columns: From 26dfc01024cc52f703bc126b3e242a1c8f2cbb59 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 13 Dec 2022 13:59:38 -0800 Subject: [PATCH 043/137] revert --- integration_tests/dbt_project.yml | 2 +- models/src_shopify.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index d753875..48ec16f 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -8,7 +8,7 @@ vars: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" shopify_order_line_identifier: "shopify_order_line_data" - shopify_order_identifier: "shopify_order_data" + order_source: "{{ ref('shopify_order_data') }}" shopify_product_identifier: "shopify_product_data" shopify_order_adjustment_identifier: "shopify_order_adjustment_data" shopify_product_variant_identifier: "shopify_product_variant_data" diff --git a/models/src_shopify.yml b/models/src_shopify.yml index e720723..1c30d78 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -7,7 +7,7 @@ sources: tables: - name: order description: Each record represents an order in Shopify. - identifier: "{{ var('shopify_order_identifier', 'ORDER' if target.type == 'snowflake' else 'order') }}" + identifier: "{%- if target.type == 'snowflake' -%} ORDER {%- else -%} order {%- endif -%}" quoting: identifier: true columns: From fa122362ede1828351afd2953d88d73d08f4f861 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 13 Dec 2022 14:36:07 -0800 Subject: [PATCH 044/137] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36d601a..370ebe7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,12 @@ - `dbt.current_timestamp_in_utc_backcompat` - Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. +## Updates: +[PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38) includes the following breaking changes: +- Esnured Postgres compatibility. +- README updated for easier package use and navigation. +- `shopify__identifier` variables added if an individual source table has a different name than the package expects. + # dbt_shopify_source v0.6.0 🎉 dbt v1.0.0 Compatibility 🎉 ## 🚨 Breaking Changes 🚨 From ffd07256c92bcc96ca7ce456bff6d437b6f0e437 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 13 Dec 2022 15:53:12 -0800 Subject: [PATCH 045/137] renee feedback --- models/stg_shopify__abandoned_checkout.sql | 17 ++++++++++++----- ...hopify__abandoned_checkout_discount_code.sql | 14 ++++++++++---- models/stg_shopify__collection.sql | 13 ++++++++++--- models/stg_shopify__collection_product.sql | 9 ++++++++- models/stg_shopify__customer_tag.sql | 9 ++++++++- models/stg_shopify__discount_code.sql | 13 ++++++++++--- models/stg_shopify__fulfillment.sql | 13 ++++++++++--- models/stg_shopify__inventory_item.sql | 13 ++++++++++--- models/stg_shopify__inventory_level.sql | 11 +++++++++-- models/stg_shopify__location.sql | 13 ++++++++++--- models/stg_shopify__metafield.sql | 13 ++++++++++--- models/stg_shopify__order_discount_code.sql | 9 ++++++++- models/stg_shopify__order_note_attribute.sql | 9 ++++++++- models/stg_shopify__order_shipping_line.sql | 9 ++++++++- models/stg_shopify__order_shipping_tax_line.sql | 9 ++++++++- models/stg_shopify__order_tag.sql | 9 ++++++++- models/stg_shopify__order_url_tag.sql | 13 ++++++++++--- models/stg_shopify__price_rule.sql | 17 ++++++++++++----- models/stg_shopify__product_image.sql | 13 ++++++++++--- models/stg_shopify__product_tag.sql | 9 ++++++++- models/stg_shopify__shop.sql | 13 ++++++++++--- models/stg_shopify__tender_transaction.sql | 11 +++++++++-- 22 files changed, 206 insertions(+), 53 deletions(-) diff --git a/models/stg_shopify__abandoned_checkout.sql b/models/stg_shopify__abandoned_checkout.sql index 54d6e49..fcccad8 100644 --- a/models/stg_shopify__abandoned_checkout.sql +++ b/models/stg_shopify__abandoned_checkout.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_abandoned_checkout_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -21,7 +27,6 @@ final as ( select _fivetran_deleted as is_deleted, - _fivetran_synced, abandoned_checkout_url, billing_address_address_1, billing_address_address_2, @@ -40,8 +45,8 @@ final as ( billing_address_zip, buyer_accepts_marketing as has_buyer_accepted_marketing, cart_token, - closed_at, - created_at, + cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at, + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, currency as shop_currency, customer_id, customer_locale, @@ -81,8 +86,10 @@ final as ( total_price, total_tax, total_weight, - updated_at, - user_id + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + user_id, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__abandoned_checkout_discount_code.sql b/models/stg_shopify__abandoned_checkout_discount_code.sql index 32f8265..1696465 100644 --- a/models/stg_shopify__abandoned_checkout_discount_code.sql +++ b/models/stg_shopify__abandoned_checkout_discount_code.sql @@ -15,6 +15,12 @@ fields as ( ) }} , row_number() over(partition by checkout_id, discount_id order by index desc) as n + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -24,12 +30,12 @@ final as ( checkout_id, code, discount_id, - index, amount, type, - created_at, - updated_at, - _fivetran_synced + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields where n = 1 diff --git a/models/stg_shopify__collection.sql b/models/stg_shopify__collection.sql index 3f30629..d1a5545 100644 --- a/models/stg_shopify__collection.sql +++ b/models/stg_shopify__collection.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_collection_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -27,13 +33,14 @@ final as ( when disjunctive then 'disjunctive' else 'conjunctive' end as rule_logic, handle, - published_at, + cast(published_at as {{ dbt.type_timestamp() }}) as published_at, published_scope, rules, sort_order, title, - updated_at, - _fivetran_synced + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__collection_product.sql b/models/stg_shopify__collection_product.sql index 2bc12fa..5e3df61 100644 --- a/models/stg_shopify__collection_product.sql +++ b/models/stg_shopify__collection_product.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_collection_product_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -22,7 +28,8 @@ final as ( select collection_id, product_id, - _fivetran_synced + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__customer_tag.sql b/models/stg_shopify__customer_tag.sql index be34e7f..9403f9a 100644 --- a/models/stg_shopify__customer_tag.sql +++ b/models/stg_shopify__customer_tag.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_customer_tag_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -23,7 +29,8 @@ final as ( customer_id, index, value, - _fivetran_synced + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__discount_code.sql b/models/stg_shopify__discount_code.sql index 550fe2d..2332aca 100644 --- a/models/stg_shopify__discount_code.sql +++ b/models/stg_shopify__discount_code.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_discount_code_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -24,9 +30,10 @@ final as ( code, price_rule_id, usage_count, - created_at, - updated_at, - _fivetran_synced + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__fulfillment.sql b/models/stg_shopify__fulfillment.sql index da31014..e0430df 100644 --- a/models/stg_shopify__fulfillment.sql +++ b/models/stg_shopify__fulfillment.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_fulfillment_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -31,9 +37,10 @@ final as ( tracking_number, tracking_numbers, tracking_urls, - created_at, - updated_at, - _fivetran_synced + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__inventory_item.sql b/models/stg_shopify__inventory_item.sql index 7afb730..5cfa95f 100644 --- a/models/stg_shopify__inventory_item.sql +++ b/models/stg_shopify__inventory_item.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_inventory_item_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -28,9 +34,10 @@ final as ( province_code_of_origin, requires_shipping as is_shipping_required, tracked as is_inventory_quantity_tracked, - created_at, - updated_at, - _fivetran_synced + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__inventory_level.sql b/models/stg_shopify__inventory_level.sql index 3c7a2b0..0f6efac 100644 --- a/models/stg_shopify__inventory_level.sql +++ b/models/stg_shopify__inventory_level.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_inventory_level_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -23,8 +29,9 @@ final as ( inventory_item_id, location_id, available as available_quantity, - updated_at, - _fivetran_synced + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__location.sql b/models/stg_shopify__location.sql index 746c5d3..65221a9 100644 --- a/models/stg_shopify__location.sql +++ b/models/stg_shopify__location.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_location_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -37,9 +43,10 @@ final as ( province, province_code, zip, - created_at, - updated_at, - _fivetran_synced + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__metafield.sql b/models/stg_shopify__metafield.sql index 951ed7f..6ac100d 100644 --- a/models/stg_shopify__metafield.sql +++ b/models/stg_shopify__metafield.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_metafield_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -28,9 +34,10 @@ final as ( lower(coalesce(type, value_type)) as value_type, owner_id as owner_resource_id, owner_resource, - created_at, - updated_at, - _fivetran_synced + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__order_discount_code.sql b/models/stg_shopify__order_discount_code.sql index 29ac6f7..b970b18 100644 --- a/models/stg_shopify__order_discount_code.sql +++ b/models/stg_shopify__order_discount_code.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_order_discount_code_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -24,7 +30,8 @@ final as ( code, type, amount, - _fivetran_synced + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields where index = 1 -- Sanity check. index should not > 1 but open an issue if that's not the case in your data diff --git a/models/stg_shopify__order_note_attribute.sql b/models/stg_shopify__order_note_attribute.sql index 52fbe14..0ea6883 100644 --- a/models/stg_shopify__order_note_attribute.sql +++ b/models/stg_shopify__order_note_attribute.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_order_note_attribute_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -23,7 +29,8 @@ final as ( order_id, name, value, - _fivetran_synced + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__order_shipping_line.sql b/models/stg_shopify__order_shipping_line.sql index 57a573b..a4397c2 100644 --- a/models/stg_shopify__order_shipping_line.sql +++ b/models/stg_shopify__order_shipping_line.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_order_shipping_line_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -33,7 +39,8 @@ final as ( requested_fulfillment_service_id is not null as is_third_party_required, source, title, - _fivetran_synced + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__order_shipping_tax_line.sql b/models/stg_shopify__order_shipping_tax_line.sql index 17ad21c..3173fcf 100644 --- a/models/stg_shopify__order_shipping_tax_line.sql +++ b/models/stg_shopify__order_shipping_tax_line.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_order_shipping_tax_line_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -26,7 +32,8 @@ final as ( price_set, rate, title, - _fivetran_synced + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__order_tag.sql b/models/stg_shopify__order_tag.sql index 09f6bdf..0c164b5 100644 --- a/models/stg_shopify__order_tag.sql +++ b/models/stg_shopify__order_tag.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_order_tag_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -23,7 +29,8 @@ final as ( order_id, index, value, - _fivetran_synced + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__order_url_tag.sql b/models/stg_shopify__order_url_tag.sql index 1b2dc33..2354907 100644 --- a/models/stg_shopify__order_url_tag.sql +++ b/models/stg_shopify__order_url_tag.sql @@ -14,16 +14,23 @@ fields as ( staging_columns=get_order_url_tag_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), final as ( select - _fivetran_synced, - key, order_id, - value + key, + value, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__price_rule.sql b/models/stg_shopify__price_rule.sql index 135fa6b..4d98774 100644 --- a/models/stg_shopify__price_rule.sql +++ b/models/stg_shopify__price_rule.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_price_rule_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -37,11 +43,12 @@ final as ( usage_limit, value, value_type, - starts_at, - ends_at, - created_at, - updated_at, - _fivetran_synced + cast(starts_at as {{ dbt.type_timestamp() }}) as starts_at, + cast(ends_at as {{ dbt.type_timestamp() }}) as ends_at, + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__product_image.sql b/models/stg_shopify__product_image.sql index 4df21fe..a8d31af 100644 --- a/models/stg_shopify__product_image.sql +++ b/models/stg_shopify__product_image.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_product_image_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -27,9 +33,10 @@ final as ( src, variant_ids, width, - created_at, - updated_at, - _fivetran_synced + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields where not coalesce(_fivetran_deleted, false) diff --git a/models/stg_shopify__product_tag.sql b/models/stg_shopify__product_tag.sql index 6438189..3a94a6c 100644 --- a/models/stg_shopify__product_tag.sql +++ b/models/stg_shopify__product_tag.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_product_tag_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -23,7 +29,8 @@ final as ( product_id, index, value, - _fivetran_synced + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__shop.sql b/models/stg_shopify__shop.sql index 6c7af14..192fcb0 100644 --- a/models/stg_shopify__shop.sql +++ b/models/stg_shopify__shop.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_shop_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -69,9 +75,10 @@ final as ( pre_launch_enabled as is_pre_launch_enabled, requires_extra_payments_agreement as is_extra_payments_agreement_required, setup_required as is_setup_required, - created_at, - updated_at, - _fivetran_synced + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__tender_transaction.sql b/models/stg_shopify__tender_transaction.sql index 9d9d944..04e47da 100644 --- a/models/stg_shopify__tender_transaction.sql +++ b/models/stg_shopify__tender_transaction.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_tender_transaction_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), @@ -27,8 +33,9 @@ final as ( payment_method, remote_reference, user_id, - processed_at, - _fivetran_synced + cast(processed_at as {{ dbt.type_timestamp() }}) as processed_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields where not coalesce(test, false) From 0e1df179e729610ac8756df7fba2aa60c97d4cd2 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 13 Dec 2022 15:55:57 -0800 Subject: [PATCH 046/137] merged figvetran utils --- packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.yml b/packages.yml index 2f19c7a..fd66aa3 100644 --- a/packages.yml +++ b/packages.yml @@ -2,7 +2,7 @@ packages: # - package: fivetran/fivetran_utils # version: [">=0.4.0", "<0.5.0"] - git: https://github.com/fivetran/dbt_fivetran_utils.git - revision: backwards-compat-passthru + revision: releases/v0.4.latest warn-unpinned: false - package: dbt-labs/spark_utils version: [">=0.3.0", "<0.4.0"] From ac8c50ee425d18a2ad3b52a37e1b6209c5bc709f Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 13 Dec 2022 16:24:04 -0800 Subject: [PATCH 047/137] buildkite --- integration_tests/dbt_project.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index b1a3da7..05ba64e 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -108,11 +108,16 @@ seeds: shopify_abandoned_checkout_discount_code_data: +column_types: amount: float + created_at: timestamp + updated_at: timestamp shopify_abandoned_checkout_data: +column_types: total_line_items_price: float billing_address_phone: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" shipping_address_phone: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" + closed_at: timestamp + created_at: timestamp + updated_at: timestamp shopify_discount_code_data: +column_types: usage_count: float @@ -133,6 +138,8 @@ seeds: shopify_collection_data: +column_types: disjunctive: boolean + published_at: timestamp + updated_at: timestamp shopify_metafield_data: +column_types: value_type: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" @@ -141,4 +148,11 @@ seeds: +column_types: taxes_included: boolean google_apps_login_enabled: boolean - county_taxes: boolean \ No newline at end of file + county_taxes: boolean + shopify_inventory_level_data: + +column_types: + updated_at: timestamp + shopify_inventory_item_data: + +column_types: + updated_at: timestamp + created_at: timestamp \ No newline at end of file From 565052486b885004f8027b24fe098d22a5a109d8 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:18:26 -0800 Subject: [PATCH 048/137] change yml to capture field changes --- .../seeds/shopify_product_tag_data.csv | 10 +++---- models/stg_shopify.yml | 28 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/integration_tests/seeds/shopify_product_tag_data.csv b/integration_tests/seeds/shopify_product_tag_data.csv index 1e83e7e..7b44ed3 100644 --- a/integration_tests/seeds/shopify_product_tag_data.csv +++ b/integration_tests/seeds/shopify_product_tag_data.csv @@ -1,6 +1,6 @@ index,product_id,_fivetran_synced,value -9,41234,2022-12-01 06:51:36.480000 UTC,Type: Clothing -5,41234,2022-12-01 06:51:36.480000 UTC,Final Sale -7,41234,2022-12-01 06:51:36.480000 UTC,Sale -8,41234,2022-12-01 06:51:36.480000 UTC,StyleID:nice -3,41234,2022-12-01 06:51:36.480000 UTC,Collection: Bottoms \ No newline at end of file +9,1234,2022-12-01 06:51:36.480000,Type: Clothing +5,1234,2022-12-01 06:51:36.480000,Final Sale +7,1234,2022-12-01 06:51:36.480000,Sale +8,1234,2022-12-01 06:51:36.480000,StyleID:nice +3,1234,2022-12-01 06:51:36.480000,Collection: Bottoms \ No newline at end of file diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index b89587b..6f98107 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -13,7 +13,7 @@ models: description: "{{ doc('_fivetran_synced') }}" - name: has_accepted_marketing description: Whether the customer has consented to receive marketing material via email. - - name: created_timestamp + - name: created_at description: The date and time when the customer was created. - name: default_address_id description: The default address for the customer. @@ -35,7 +35,7 @@ models: description: Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout. - name: total_spent description: The total amount of money that the customer has spent across their order history. - - name: updated_timestamp + - name: updated_at description: The date and time when the customer information was last updated. - name: is_verified_email description: Whether the customer has verified their email address. @@ -162,13 +162,13 @@ models: description: Whether the customer consented to receive email updates from the shop. - name: cancel_reason description: The reason why the order was canceled. - - name: cancelled_timestamp + - name: cancelled_at description: The date and time when the order was canceled. - name: cart_token description: The ID of the cart that's associated with the order. - - name: closed_timestamp + - name: closed_at description: The date and time when the order was closed. - - name: created_timestamp + - name: created_at description: The autogenerated date and time when the order was created in Shopify. - name: currency description: The three-letter code for the shop currency. @@ -194,7 +194,7 @@ models: description: The order's position in the shop's count of orders. Numbers are sequential and start at 1. - name: order_number description: The order 's position in the shop's count of orders starting at 1001. Order numbers are sequential and start at 1001. - - name: processed_timestamp + - name: processed_at description: The date and time when an order was processed. This value is the date that appears on your orders and that's used in the analytic reports. - name: processing_method description: How the payment was processed. @@ -250,7 +250,7 @@ models: description: The sum of all the taxes applied to the order in th shop currency. Must be positive). - name: total_weight description: The sum of all line item weights in grams. - - name: updated_timestamp + - name: updated_at description: The date and time (ISO 8601 format) when the order was last modified. - name: user_id description: The ID of the user logged into Shopify POS who processed the order, if applicable. @@ -273,7 +273,7 @@ models: description: Whether the record has been deleted in the source system. - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - - name: created_timestamp + - name: created_at description: The date and time when the product was created. - name: handle description: A unique human-friendly string for the product. Automatically generated from the product's title. @@ -281,13 +281,13 @@ models: description: An unsigned 64-bit integer that's used as a unique identifier for the product. Each id is unique across the Shopify system. No two products will have the same id, even if they're from different shops. - name: product_type description: A categorization for the product used for filtering and searching products. - - name: published_timestamp + - name: published_at description: The date and time (ISO 8601 format) when the product was published. Can be set to null to unpublish the product from the Online Store channel. - name: published_scope description: Whether the product is published to the Point of Sale channel. - name: title description: The name of the product. - - name: updated_timestamp + - name: updated_at description: The date and time when the product was last modified. - name: vendor description: The name of the product's vendor. @@ -304,7 +304,7 @@ models: description: The barcode, UPC, or ISBN number for the product. - name: compare_at_price description: The original price of the item before an adjustment or a sale. - - name: created_timestamp + - name: created_at description: The date and time (ISO 8601 format) when the product variant was created. - name: fulfillment_service description: The fulfillment service associated with the product variant. @@ -346,7 +346,7 @@ models: description: This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant. - name: title description: The title of the product variant. The title field is a concatenation of the option1, option2, and option3 fields. You can only update title indirectly using the option fields. - - name: updated_timestamp + - name: updated_at description: The date and time when the product variant was last modified. Gets returned in ISO 8601 format. - name: weight description: The weight of the product variant in the unit system specified with weight_unit. @@ -373,9 +373,9 @@ models: description: The amount of money included in the transaction. - name: authorization description: The authorization code associated with the transaction. - - name: created_timestamp + - name: created_at description: The date and time when the transaction was created. - - name: processed_timestamp + - name: processed_at description: The date and time when a transaction was processed. - name: device_id description: The ID for the device. From 714f26b5b90a73b4cc2f387731910e4aa9be10ad Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:51:49 -0800 Subject: [PATCH 049/137] buildkite --- macros/get_transaction_columns.sql | 4 ++-- models/stg_shopify__order_line_refund.sql | 2 +- models/stg_shopify__transaction.sql | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/macros/get_transaction_columns.sql b/macros/get_transaction_columns.sql index dfd2f6e..2835938 100644 --- a/macros/get_transaction_columns.sql +++ b/macros/get_transaction_columns.sql @@ -35,9 +35,9 @@ ] %} {% if target.type in ('redshift','postgres') %} - {{ columns.append({"name": "authorization", "datatype": dbt.type_string(), "quote": True, "alias": "authorization"}) }} + {{ columns.append({"name": "authorization", "datatype": dbt.type_string(), "quote": True, "alias": "authorization_code"}) }} {% else %} - {{ columns.append({"name": "authorization", "datatype": dbt.type_string()}) }} + {{ columns.append({"name": "authorization", "datatype": dbt.type_string(), "alias": "authorization_code"}) }} {% endif %} {{ return(columns) }} diff --git a/models/stg_shopify__order_line_refund.sql b/models/stg_shopify__order_line_refund.sql index 80fd3f0..844f97e 100644 --- a/models/stg_shopify__order_line_refund.sql +++ b/models/stg_shopify__order_line_refund.sql @@ -42,7 +42,7 @@ final as ( refund_id, restock_type, _fivetran_synced, - source_relation, + source_relation {{ fivetran_utils.fill_pass_through_columns('order_line_refund_pass_through_columns') }} diff --git a/models/stg_shopify__transaction.sql b/models/stg_shopify__transaction.sql index c0c5417..91a94e0 100644 --- a/models/stg_shopify__transaction.sql +++ b/models/stg_shopify__transaction.sql @@ -57,7 +57,7 @@ final as ( user_id, _fivetran_synced, authorization_expires_at, - authorization, + authorization_code, source_relation {{ fivetran_utils.fill_pass_through_columns('transaction_pass_through_columns') }} From 08c561893ebeefe979f3989f68167b5bdff6d32d Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 14 Dec 2022 10:01:57 -0800 Subject: [PATCH 050/137] databricks --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 8ba31eb..01582ec 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_test + schema: shopify_source_integration_tests threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_test + schema: shopify_source_integration_tests threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_test + schema: shopify_source_integration_tests threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_test + schema: shopify_source_integration_tests threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_test + schema: shopify_source_integration_tests threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index ccf73d1..1e8358e 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,6 +4,7 @@ profile: 'integration_tests' config-version: 2 vars: + shopify_schema: shopify_source_integration_tests shopify_source: customer_source: "{{ ref('shopify_customer_data') }}" order_line_refund_source: "{{ ref('shopify_order_line_refund_data') }}" From 0def2e302be2b3a4bb45a5a865e290a48f01de26 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 14 Dec 2022 10:02:15 -0800 Subject: [PATCH 051/137] docs --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 8122bb6..570c7e1 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -369,7 +369,7 @@ models: description: The ID associated with a refund in the refund table. - name: amount description: The amount of money included in the transaction. - - name: authorization + - name: authorization_code description: The authorization code associated with the transaction. - name: created_timestamp description: The date and time when the transaction was created. From 17aedd2718fb67fb8dbdec2da330ac39e90b383d Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 14 Dec 2022 11:33:03 -0800 Subject: [PATCH 052/137] Refunds explanation --- CHANGELOG.md | 5 +++++ README.md | 2 ++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91311c3..f5afab2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,9 @@ - `dbt.current_timestamp_backcompat` - `dbt.current_timestamp_in_utc_backcompat` - Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. + + +[PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following breaking changes: - In the following tables, `*_timestamp` columns have been renamed to `*_at` for consistency: - `stg_shopify__customer` - `stg_shopify__order` @@ -43,6 +46,8 @@ - `stg_shopify__product` - `stg_shopify__transaction` - The `is_requiring_shipping` field in `stg_shopify__order_line` has been renamed to `is_shipping_required`, just because it sounds better :) +- TODO more stuff +- By default, if the refunds table does not exist, the package will create an empty `stg_shopify__refunds` model. This can still be overwritten by setting `shopify__using_refund` to `false`. We did this because the refunds table is only created once your Shopify account has processed its first refund, and it is unnecessary overhead to have to monitor this and change your dbt_project accordingly. Thus, we took the approach of having this refund table be one that syncs as empty if it is not populated, then seamlessly switches to the source table once it exists. # dbt_shopify_source v0.6.0 🎉 dbt v1.0.0 Compatibility 🎉 diff --git a/README.md b/README.md index d97d7ce..f8941e9 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,8 @@ vars: shopify__using_refund: false # true by default ``` +> By default, if the refunds table does not exist, the package will create an empty `stg_shopify__refunds` model. This can still be overwritten by setting `shopify__using_refund` to `false`. We did this because the refunds table is only created once your Shopify account has processed its first refund, and it is unnecessary overhead to have to monitor this and change your dbt_project accordingly. Thus, we took the approach of having this refund table be one that syncs as empty if it is not populated, then seamlessly switches to the source table once it exists. + ### Changing the Build Schema By default this package will build the Shopify staging models within a schema titled ( + `_stg_shopify`) in your target database. If this is not where you would like your staging Shopify data to be written to, add the following configuration to your `dbt_project.yml` file: From a89bd2d552a84bc1f0b49f36296d7c8972475c3a Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 14 Dec 2022 12:32:21 -0800 Subject: [PATCH 053/137] cast timestamps explicitly for old models --- models/stg_shopify__customer.sql | 10 +++++----- models/stg_shopify__order.sql | 10 +++++----- models/stg_shopify__order_adjustment.sql | 4 ++-- models/stg_shopify__order_line.sql | 4 ++-- models/stg_shopify__order_line_refund.sql | 2 +- models/stg_shopify__product.sql | 10 +++++----- models/stg_shopify__product_variant.sql | 6 +++--- models/stg_shopify__refund.sql | 6 +++--- models/stg_shopify__transaction.sql | 8 ++++---- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/models/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index 5c84f2c..8a564fa 100644 --- a/models/stg_shopify__customer.sql +++ b/models/stg_shopify__customer.sql @@ -30,7 +30,6 @@ final as ( select accepts_marketing as has_accepted_marketing, email_marketing_consent_state, - created_at, default_address_id, email, first_name, @@ -41,15 +40,16 @@ final as ( state as account_state, tax_exempt as is_tax_exempt, total_spent, - updated_at, verified_email as is_verified_email, note, - coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as accepts_marketing_updated_at, coalesce(marketing_opt_in_level, email_marketing_consent_opt_in_level) as marketing_opt_in_level, lifetime_duration, currency, - source_relation, - _fivetran_synced + cast( coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as {{ dbt.type_timestamp() }}) as accepts_marketing_updated_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation {{ fivetran_utils.fill_pass_through_columns('customer_pass_through_columns') }} diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index ab9194f..9480adf 100644 --- a/models/stg_shopify__order.sql +++ b/models/stg_shopify__order.sql @@ -29,8 +29,8 @@ final as ( select id as order_id, - processed_at, - updated_at, + cast(processed_at as {{ dbt.type_timestamp() }}) as processed_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, user_id, total_discounts, total_discounts_set, @@ -54,11 +54,11 @@ final as ( number, order_number, cancel_reason, - cancelled_at, + cast(cancelled_at as {{ dbt.type_timestamp() }}) as cancelled_at, cart_token, checkout_token, - closed_at, - created_at, + cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at, + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, currency, customer_id, email, diff --git a/models/stg_shopify__order_adjustment.sql b/models/stg_shopify__order_adjustment.sql index a24d915..4bf2991 100644 --- a/models/stg_shopify__order_adjustment.sql +++ b/models/stg_shopify__order_adjustment.sql @@ -38,8 +38,8 @@ final as ( tax_amount_set, kind, reason, - source_relation, - _fivetran_synced + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation from fields ) diff --git a/models/stg_shopify__order_line.sql b/models/stg_shopify__order_line.sql index a52b6ef..6cbb244 100644 --- a/models/stg_shopify__order_line.sql +++ b/models/stg_shopify__order_line.sql @@ -61,8 +61,8 @@ final as ( variant_inventory_management, vendor, properties, - source_relation, - _fivetran_synced + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + source_relation {{ fivetran_utils.fill_pass_through_columns('order_line_pass_through_columns') }} diff --git a/models/stg_shopify__order_line_refund.sql b/models/stg_shopify__order_line_refund.sql index 844f97e..4594dd6 100644 --- a/models/stg_shopify__order_line_refund.sql +++ b/models/stg_shopify__order_line_refund.sql @@ -41,7 +41,7 @@ final as ( quantity, refund_id, restock_type, - _fivetran_synced, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('order_line_refund_pass_through_columns') }} diff --git a/models/stg_shopify__product.sql b/models/stg_shopify__product.sql index 405acca..78fad70 100644 --- a/models/stg_shopify__product.sql +++ b/models/stg_shopify__product.sql @@ -28,18 +28,18 @@ fields as ( final as ( select - created_at, - handle, id as product_id, + handle, product_type, - published_at, published_scope, title, - updated_at, vendor, status, _fivetran_deleted as is_deleted, - _fivetran_synced, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(published_at as {{ dbt.type_timestamp() }}) as published_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('product_pass_through_columns') }} diff --git a/models/stg_shopify__product_variant.sql b/models/stg_shopify__product_variant.sql index 07f9c80..3305477 100644 --- a/models/stg_shopify__product_variant.sql +++ b/models/stg_shopify__product_variant.sql @@ -29,9 +29,6 @@ final as ( select id as variant_id, - _fivetran_synced, - created_at, - updated_at, product_id, inventory_item_id, image_id, @@ -53,6 +50,9 @@ final as ( option_2, option_3, tax_code, + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('product_variant_pass_through_columns') }} diff --git a/models/stg_shopify__refund.sql b/models/stg_shopify__refund.sql index ef550d6..7d63c45 100644 --- a/models/stg_shopify__refund.sql +++ b/models/stg_shopify__refund.sql @@ -29,15 +29,15 @@ fields as ( final as ( select - created_at, id as refund_id, note, order_id, - processed_at, restock, total_duties_set, user_id, - _fivetran_synced, + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(processed_at as {{ dbt.type_timestamp() }}) as processed_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__transaction.sql b/models/stg_shopify__transaction.sql index 91a94e0..455d9d4 100644 --- a/models/stg_shopify__transaction.sql +++ b/models/stg_shopify__transaction.sql @@ -31,8 +31,6 @@ final as ( order_id, refund_id, amount, - created_at, - processed_at, device_id, gateway, source_name, @@ -55,9 +53,11 @@ final as ( error_code, status, user_id, - _fivetran_synced, - authorization_expires_at, authorization_code, + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + cast(processed_at as {{ dbt.type_timestamp() }}) as processed_at, + cast(authorization_expires_at as {{ dbt.type_timestamp() }}) as authorization_expires_at, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('transaction_pass_through_columns') }} From d15704b45920de7e740475e7dc5adca4ba38e739 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 14 Dec 2022 12:33:48 -0800 Subject: [PATCH 054/137] databricks needs new schema --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 01582ec..d538491 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 05ba64e..686b9b1 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,7 +4,7 @@ profile: 'integration_tests' config-version: 2 vars: - shopify_schema: shopify_source_integration_tests + shopify_schema: shopify_source_integration_tests_1 shopify_source: customer_source: "{{ ref('shopify_customer_data') }}" order_line_refund_source: "{{ ref('shopify_order_line_refund_data') }}" From 55c52f6aabb070d94c6e72fd03ba9aa552ea229b Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 15 Dec 2022 10:32:46 -0800 Subject: [PATCH 055/137] some docs --- macros/get_order_columns.sql | 2 -- models/src_shopify.yml | 33 +++++++++++++++++++++++++++++- models/stg_shopify.yml | 35 ++++++++++++++++++++++++++++++-- models/stg_shopify__customer.sql | 17 ++++++++++------ models/stg_shopify__order.sql | 11 +++++----- 5 files changed, 81 insertions(+), 17 deletions(-) diff --git a/macros/get_order_columns.sql b/macros/get_order_columns.sql index c3b9a16..abae5fe 100644 --- a/macros/get_order_columns.sql +++ b/macros/get_order_columns.sql @@ -20,7 +20,6 @@ {"name": "total_weight", "datatype": dbt.type_numeric()}, {"name": "total_tip_received", "datatype": dbt.type_float()}, {"name": "landing_site_base_url", "datatype": dbt.type_string()}, - {"name": "landing_site_ref", "datatype": dbt.type_string()}, {"name": "location_id", "datatype": dbt.type_numeric()}, {"name": "name", "datatype": dbt.type_string()}, {"name": "note", "datatype": dbt.type_string()}, @@ -80,7 +79,6 @@ {"name": "checkout_id", "datatype": dbt.type_int()}, {"name": "client_details_user_agent", "datatype": dbt.type_string()}, {"name": "customer_locale", "datatype": dbt.type_string()}, - {"name": "device_id", "datatype": dbt.type_string()}, {"name": "order_status_url", "datatype": dbt.type_string()}, {"name": "presentment_currency", "datatype": dbt.type_string()}, {"name": "confirmed", "datatype": "boolean"} diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 7ab0171..d00af69 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -143,6 +143,21 @@ sources: description: The date and time (ISO 8601 format) when the order was last modified. - name: user_id description: The ID of the user logged into Shopify POS who processed the order, if applicable. + - name: checkout_token + description: A unique value when referencing the checkout that's associated with the order. + - name: confirmed + description: Whether inventory has been reserved for the order. + - name: customer_locale + description: A two-letter or three-letter language code, optionally followed by a region modifier. + - name: checkout_id + description: ID of the order's checkout. + - name: order_status_url + description: The URL pointing to the order status web page, if applicable. + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: total_tip_received + description: The sum of all the tips in the order in the shop currency. + - name: customer identifier: "{{ var('shopify_customer_identifier', 'customer') }}" description: Each record represents a customer in Shopify. @@ -150,7 +165,7 @@ sources: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: accepts_marketing - description: Whether the customer has consented to receive marketing material via email. + description: Whether the customer has consented to receive marketing material via email. Deprecated and will be coalesced with `email_marketing_consent_state`. - name: created_at description: The date and time when the customer was created. - name: default_address_id @@ -177,6 +192,22 @@ sources: description: The date and time when the customer information was last updated. - name: verified_email description: Whether the customer has verified their email address. + - name: email_marketing_consent_state + description: The current email marketing state for the customer. New version of `accepts_marketing` field. + - name: email_marketing_consent_opt_in_level + description: The marketing subscription opt-in level, as described in the M3AAWG Sender Best Common Practices, that the customer gave when they consented to receive marketing material by email. New version of `marketing_opt_in_level` field. + - name: email_marketing_consent_consent_updated_at + description: The date and time when the customer consented to receive marketing material by email. If no date is provided, then the date and time when the consent information was sent is used. New version of `accepts_marketing_updated_at` field. + - name: accepts_marketing_updated_at + description: Deprecated. The package will coalesce with `email_marketing_consent_consent_updated_at`. + - name: marketing_opt_in_level + description: Deprecated. The package will coalesce with `email_marketing_consent_opt_in_level`. + - name: lifetime_duration + description: The amount of time since the customer was first added to the store. + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: currency + description: The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order. Defaults to the shop currency. Returns the shop currency for test orders. - name: order_line identifier: "{{ var('shopify_order_line_identifier', 'order_line') }}" description: Each record represents a line item for an order in Shopify. diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 5e6357a..7b899c9 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -11,8 +11,14 @@ models: columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - - name: has_accepted_marketing - description: Whether the customer has consented to receive marketing material via email. + - name: marketing_consent_state + description: > + Field indicating if the customer has consented to receive marketing material via email. Coalescing of the new `email_marketing_consent_state` + field and the deprected `accepts_marketing` field. Records with the old field will be marked with '(legacy)'. + - name: marketing_opt_in_level + description: The marketing subscription opt-in level, as described in the M3AAWG Sender Best Common Practices, that the customer gave when they consented to receive marketing material by email. + - name: marketing_consent_updated_at + description: The date and time when the customer consented to receive marketing material by email. If no date is provided, then the date and time when the consent information was sent is used. - name: created_at description: The date and time when the customer was created. - name: default_address_id @@ -39,6 +45,10 @@ models: description: The date and time when the customer information was last updated. - name: is_verified_email description: Whether the customer has verified their email address. + - name: lifetime_duration + description: The amount of time since the customer was first added to the store. + - name: currency + description: The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order. Defaults to the shop currency. Returns the shop currency for test orders. - name: stg_shopify__order_line_refund description: Each record represents a line item from an order in Shopify. @@ -126,6 +136,10 @@ models: description: "{{ doc('_fivetran_synced') }}" - name: app_id description: The ID of the app that created the order. + - name: checkout_id + description: ID of the order's checkout. + - name: order_status_url + description: The URL pointing to the order status web page, if applicable. - name: billing_address_address_1 description: The street address of the billing address. - name: billing_address_address_2 @@ -260,6 +274,23 @@ models: description: The index associated with the order. - name: pre_tax_price description: The total pre tax price of the order. + - name: checkout_token + description: A unique value when referencing the checkout that's associated with the order. + - name: is_inventory_confirmed + description: Whether inventory has been reserved for the order. + - name: customer_locale + description: A two-letter or three-letter language code, optionally followed by a region modifier. + - name: is_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: total_tip_received + description: The sum of all the tips in the order in the shop currency. + - name: client_details_user_agent + description: Details of the browsing client, including software and operating versions. + - name: total_tax_set + - name: total_shipping_price_set + - name: total_discounts_set + - name: subtotal_price_set + - name: presentment_currency - name: stg_shopify__product description: Each record represents a product in Shopify. diff --git a/models/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index 8a564fa..54d9740 100644 --- a/models/stg_shopify__customer.sql +++ b/models/stg_shopify__customer.sql @@ -28,24 +28,29 @@ fields as ( final as ( select - accepts_marketing as has_accepted_marketing, - email_marketing_consent_state, - default_address_id, + id as customer_id, email, first_name, - id as customer_id, last_name, orders_count, + default_address_id, phone, state as account_state, tax_exempt as is_tax_exempt, total_spent, verified_email as is_verified_email, note, - coalesce(marketing_opt_in_level, email_marketing_consent_opt_in_level) as marketing_opt_in_level, lifetime_duration, currency, - cast( coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as {{ dbt.type_timestamp() }}) as accepts_marketing_updated_at, + case + when email_marketing_consent_state is null then + case + when accepts_marketing is null then null + when accepts_marketing then 'subscribed (legacy)' + else 'not_subscribed (legacy)' end + else lower(email_marketing_consent_state) end as marketing_consent_state, + lower(coalesce(email_marketing_consent_opt_in_level, marketing_opt_in_level)) as marketing_opt_in_level, + cast( coalesce(email_marketing_consent_consent_updated_at, accepts_marketing_updated_at) as {{ dbt.type_timestamp() }}) as marketing_consent_updated_at, cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, cast(created_at as {{ dbt.type_timestamp() }}) as created_at, cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index 9480adf..ee065df 100644 --- a/models/stg_shopify__order.sql +++ b/models/stg_shopify__order.sql @@ -47,7 +47,6 @@ final as ( total_weight, total_tip_received, landing_site_base_url, - landing_site_ref, location_id, name, note, @@ -99,23 +98,23 @@ final as ( shipping_address_province, shipping_address_province_code, shipping_address_zip, - test as is_test_order, + {# test as is_test_order, #} token, - _fivetran_synced, - _fivetran_deleted, + _fivetran_deleted as is_deleted, app_id, checkout_id, client_details_user_agent, customer_locale, - device_id, order_status_url, presentment_currency, - confirmed, + confirmed as is_inventory_confirmed, + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('order_pass_through_columns') }} from fields + where not coalesce(test, false) ) select * From 36d38b784f11614903167c37d750e961f747162a Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 16 Dec 2022 11:16:39 -0800 Subject: [PATCH 056/137] test buildkite on one table --- models/stg_shopify__customer.sql | 9 ++++++++- packages.yml | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/models/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index 8a564fa..f2ed540 100644 --- a/models/stg_shopify__customer.sql +++ b/models/stg_shopify__customer.sql @@ -45,9 +45,16 @@ final as ( coalesce(marketing_opt_in_level, email_marketing_consent_opt_in_level) as marketing_opt_in_level, lifetime_duration, currency, + + + cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + {{ dbt_date.convert_timezone(column='created_at', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at_tz, cast( coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as {{ dbt.type_timestamp() }}) as accepts_marketing_updated_at, + {{ dbt_date.convert_timezone(column='coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at)', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as accepts_marketing_updated_at_tz, cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + {{ dbt_date.convert_timezone(column='updated_at', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at_tz, + + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, source_relation diff --git a/packages.yml b/packages.yml index fd66aa3..7dee2ce 100644 --- a/packages.yml +++ b/packages.yml @@ -6,3 +6,5 @@ packages: warn-unpinned: false - package: dbt-labs/spark_utils version: [">=0.3.0", "<0.4.0"] +- package: calogica/dbt_date + version: [">=0.7.0", "<0.8.0"] \ No newline at end of file From 1e6158a4643b91e7c9e63ac55fedee3ac616f9b2 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 16 Dec 2022 11:27:09 -0800 Subject: [PATCH 057/137] fix seeds --- .../seeds/shopify_order_adjustment_data.csv | 10 +++++----- integration_tests/seeds/shopify_order_data.csv | 6 +++--- .../seeds/shopify_product_variant_data.csv | 10 +++++----- integration_tests/seeds/shopify_refund_data.csv | 10 +++++----- integration_tests/seeds/shopify_transaction_data.csv | 10 +++++----- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/integration_tests/seeds/shopify_order_adjustment_data.csv b/integration_tests/seeds/shopify_order_adjustment_data.csv index 8f6edd9..191f585 100644 --- a/integration_tests/seeds/shopify_order_adjustment_data.csv +++ b/integration_tests/seeds/shopify_order_adjustment_data.csv @@ -1,6 +1,6 @@ id,order_id,refund_id,amount,tax_amount,kind,reason,amount_set,tax_amount_set,_fivetran_synced -109271056455,2712175083591,675617407047,-465,0,shipping_refund,Shipping refund,,,2020-11-14 07:52:56.522 +0000 -109277085767,2773486501959,675634708551,-95,0,shipping_refund,Shipping refund,,,2020-11-14 07:54:41.682 +0000 -109245956167,2771757826119,675548168263,-27,-1.6,shipping_refund,Shipping refund,,,2020-11-14 07:44:24.602 +0000 -109248118855,2771329908807,675555016775,-35,0,shipping_refund,Shipping refund,,,2020-11-14 07:45:11.536 +0000 -109275742279,2773429682247,675632644167,-515,0,refund_discrepancy,Refund discrepancy,,,2020-11-14 07:54:31.054 +0000 \ No newline at end of file +109271056455,2712175083591,675617407047,-465,0,shipping_refund,Shipping refund,,,2020-11-14 07:52:56.522 +109277085767,2773486501959,675634708551,-95,0,shipping_refund,Shipping refund,,,2020-11-14 07:54:41.682 +109245956167,2771757826119,675548168263,-27,-1.6,shipping_refund,Shipping refund,,,2020-11-14 07:44:24.602 +109248118855,2771329908807,675555016775,-35,0,shipping_refund,Shipping refund,,,2020-11-14 07:45:11.536 +109275742279,2773429682247,675632644167,-515,0,refund_discrepancy,Refund discrepancy,,,2020-11-14 07:54:31.054 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_data.csv b/integration_tests/seeds/shopify_order_data.csv index 319131e..03d9320 100644 --- a/integration_tests/seeds/shopify_order_data.csv +++ b/integration_tests/seeds/shopify_order_data.csv @@ -1,4 +1,4 @@ id,note,email,taxes_included,currency,subtotal_price,total_tax,total_price,created_at,updated_at,name,shipping_address_name,shipping_address_first_name,shipping_address_last_name,shipping_address_company,shipping_address_phone,shipping_address_address_1,shipping_address_address_2,shipping_address_city,shipping_address_country,shipping_address_country_code,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_address_latitude,shipping_address_longitude,billing_address_name,billing_address_first_name,billing_address_last_name,billing_address_company,billing_address_phone,billing_address_address_1,billing_address_address_2,billing_address_city,billing_address_country,billing_address_country_code,billing_address_province,billing_address_province_code,billing_address_zip,billing_address_latitude,billing_address_longitude,customer_id,location_id,user_id,number,order_number,financial_status,fulfillment_status,processed_at,processing_method,referring_site,cancel_reason,cancelled_at,closed_at,total_discounts,total_line_items_price,total_weight,source_name,browser_ip,buyer_accepts_marketing,token,cart_token,checkout_token,test,landing_site_base_url,_fivetran_synced,total_shipping_price_set -2674098602081,71509c29301d2cc14e37ecb53f735608,021cb20b5c78751fc7ddc091b6b69b3e,TRUE,GBP,2.8,0,2.8,2020-09-11 19:35:42.000 ,2020-09-11 19:35:46.000 ,d1743fc58a1e4d78769eaac49994a994,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,3589760876641,,,4135,5135,paid,,2020-09-11 19:35:42.000 ,,,,,,2.8,5.6,0,294517,,TRUE,0f9c2880de17f71511eee5542c29b999,,,FALSE,,2020-09-12 00:15:10.199,one -2669516488801,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,2.8,0,3.79,2020-09-09 23:01:54.000 ,2020-09-10 15:38:26.000 ,4fcb884b5b46413bae526a6e7e49d706,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4066,5066,paid,fulfilled,2020-09-09 23:01:53.000 ,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:26.000 ,0,2.8,0,web,109.249.185.68,FALSE,fb489b3ccc0ae36ce47744d7595e9746,b1ff04883dfeab658cd5211050476729,7bdb994e1196de3e4f34586e357613f9,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.536,one -2669509541985,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,4.4,0,5.39,2020-09-09 22:57:51.000 ,2020-09-10 15:38:25.000 ,9e346f2e912c60e16679f4a4c8d29422,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4065,5065,paid,fulfilled,2020-09-09 22:57:50.000 ,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:25.000 ,0,4.4,0,web,109.249.185.68,FALSE,e44b7f04610a8f4032530cc7f12663de,9600543f4d4613db59ac58a1009ecbb9,cf0a9fe2c7c606b86559007dbb890a62,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.037,one \ No newline at end of file +2674098602081,71509c29301d2cc14e37ecb53f735608,021cb20b5c78751fc7ddc091b6b69b3e,TRUE,GBP,2.8,0,2.8,2020-09-11 19:35:42.000,2020-09-11 19:35:46.000,d1743fc58a1e4d78769eaac49994a994,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,3589760876641,,,4135,5135,paid,,2020-09-11 19:35:42.000,,,,,,2.8,5.6,0,294517,,TRUE,0f9c2880de17f71511eee5542c29b999,,,FALSE,,2020-09-12 00:15:10.199,one +2669516488801,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,2.8,0,3.79,2020-09-09 23:01:54.000,2020-09-10 15:38:26.000,4fcb884b5b46413bae526a6e7e49d706,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4066,5066,paid,fulfilled,2020-09-09 23:01:53.000,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:26.000,0,2.8,0,web,109.249.185.68,FALSE,fb489b3ccc0ae36ce47744d7595e9746,b1ff04883dfeab658cd5211050476729,7bdb994e1196de3e4f34586e357613f9,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.536,one +2669509541985,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,4.4,0,5.39,2020-09-09 22:57:51.000,2020-09-10 15:38:25.000,9e346f2e912c60e16679f4a4c8d29422,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4065,5065,paid,fulfilled,2020-09-09 22:57:50.000,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:25.000,0,4.4,0,web,109.249.185.68,FALSE,e44b7f04610a8f4032530cc7f12663de,9600543f4d4613db59ac58a1009ecbb9,cf0a9fe2c7c606b86559007dbb890a62,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.037,one \ No newline at end of file diff --git a/integration_tests/seeds/shopify_product_variant_data.csv b/integration_tests/seeds/shopify_product_variant_data.csv index 18dcd0c..44dde0f 100644 --- a/integration_tests/seeds/shopify_product_variant_data.csv +++ b/integration_tests/seeds/shopify_product_variant_data.csv @@ -1,6 +1,6 @@ id,product_id,inventory_item_id,title,price,sku,position,inventory_policy,compare_at_price,fulfillment_service,inventory_management,created_at,updated_at,taxable,barcode,grams,image_id,inventory_quantity,weight,weight_unit,old_inventory_quantity,requires_shipping,_fivetran_synced,option_2,tax_code,option_3,option_1 -39262114414663,6540108431431,41356021661767,my title here,111,,1,deny,,manual,,2021-03-08 16:30:15.000 +0000,2021-04-12 19:49:43.000 +0000,FALSE,,0,,0,0,lb,0,FALSE,2021-04-16 07:50:32.995 +0000,,,,my title here -39273118957639,6544066379847,41367035936839,my title here,222,,1,deny,,manual,,2021-03-17 16:39:45.000 +0000,2021-04-12 19:46:59.000 +0000,FALSE,,0,,0,0,lb,0,FALSE,2021-04-16 07:50:29.241 +0000,,,,my title here -39290169262151,6548438188103,41384094924871,my title here,5,,1,deny,,manual,inventory manager,2021-03-30 19:48:15.000 +0000,2021-03-30 19:48:15.000 +0000,TRUE,,0,,0,0,lb,0,TRUE,2021-04-16 07:50:32.720 +0000,,,,my title here -39262115397703,6540109250631,41356022644807,my title here,333,,1,deny,,manual,,2021-03-08 16:31:31.000 +0000,2021-04-12 19:47:26.000 +0000,FALSE,,0,,-5,0,lb,-5,FALSE,2021-04-16 07:50:29.822 +0000,,,,my title here -29217058947142,3879735590982,30309980143686,my other title,444,,1,deny,,manual,inventory manager,2019-06-25 18:32:03.000 +0000,2019-10-01 23:40:09.000 +0000,TRUE,,222,,0,1,lb,0,TRUE,2021-04-16 07:50:25.006 +0000,,TR9999,,my other title \ No newline at end of file +39262114414663,6540108431431,41356021661767,my title here,111,,1,deny,,manual,,2021-03-08 16:30:15.000,2021-04-12 19:49:43.000,FALSE,,0,,0,0,lb,0,FALSE,2021-04-16 07:50:32.995,,,,my title here +39273118957639,6544066379847,41367035936839,my title here,222,,1,deny,,manual,,2021-03-17 16:39:45.000,2021-04-12 19:46:59.000,FALSE,,0,,0,0,lb,0,FALSE,2021-04-16 07:50:29.241,,,,my title here +39290169262151,6548438188103,41384094924871,my title here,5,,1,deny,,manual,inventory manager,2021-03-30 19:48:15.000,2021-03-30 19:48:15.000,TRUE,,0,,0,0,lb,0,TRUE,2021-04-16 07:50:32.720,,,,my title here +39262115397703,6540109250631,41356022644807,my title here,333,,1,deny,,manual,,2021-03-08 16:31:31.000,2021-04-12 19:47:26.000,FALSE,,0,,-5,0,lb,-5,FALSE,2021-04-16 07:50:29.822,,,,my title here +29217058947142,3879735590982,30309980143686,my other title,444,,1,deny,,manual,inventory manager,2019-06-25 18:32:03.000,2019-10-01 23:40:09.000,TRUE,,222,,0,1,lb,0,TRUE,2021-04-16 07:50:25.006,,TR9999,,my other title \ No newline at end of file diff --git a/integration_tests/seeds/shopify_refund_data.csv b/integration_tests/seeds/shopify_refund_data.csv index 3ed823d..7a7f50f 100644 --- a/integration_tests/seeds/shopify_refund_data.csv +++ b/integration_tests/seeds/shopify_refund_data.csv @@ -1,6 +1,6 @@ id,created_at,processed_at,note,restock,user_id,_fivetran_synced,total_duties_set,order_id -801704738887,2021-04-17 20:25:08.000 +0000,2021-04-17 20:25:08.000 +0000,,FALSE,40467791943,2021-04-18 08:05:22.056 +0000,,3726667481159 -801695039559,2021-04-17 15:45:21.000 +0000,2021-04-17 15:45:21.000 +0000,,FALSE,40467791943,2021-04-18 07:52:19.104 +0000,,3725521846343 -801704181831,2021-04-17 20:15:01.000 +0000,2021-04-17 20:15:01.000 +0000,,FALSE,40467791943,2021-04-18 08:05:22.522 +0000,,3726619476039 -801703428167,2021-04-17 19:56:51.000 +0000,2021-04-17 19:56:51.000 +0000,my refund note,FALSE,40467791943,2021-04-18 08:05:22.841 +0000,,3726370996295 -801707360327,2021-04-17 21:32:50.000 +0000,2021-04-17 21:32:50.000 +0000,,FALSE,40467791943,2021-04-18 08:02:24.256 +0000,,3726858289223 \ No newline at end of file +801704738887,2021-04-17 20:25:08.000,2021-04-17 20:25:08.000,,FALSE,40467791943,2021-04-18 08:05:22.056,,3726667481159 +801695039559,2021-04-17 15:45:21.000,2021-04-17 15:45:21.000,,FALSE,40467791943,2021-04-18 07:52:19.104,,3725521846343 +801704181831,2021-04-17 20:15:01.000,2021-04-17 20:15:01.000,,FALSE,40467791943,2021-04-18 08:05:22.522,,3726619476039 +801703428167,2021-04-17 19:56:51.000,2021-04-17 19:56:51.000,my refund note,FALSE,40467791943,2021-04-18 08:05:22.841,,3726370996295 +801707360327,2021-04-17 21:32:50.000,2021-04-17 21:32:50.000,,FALSE,40467791943,2021-04-18 08:02:24.256,,3726858289223 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_transaction_data.csv b/integration_tests/seeds/shopify_transaction_data.csv index ed6dc8a..9bf0015 100644 --- a/integration_tests/seeds/shopify_transaction_data.csv +++ b/integration_tests/seeds/shopify_transaction_data.csv @@ -1,6 +1,6 @@ id,order_id,refund_id,amount,authorization,created_at,processed_at,device_id,gateway,source_name,message,currency,location_id,parent_id,payment_avs_result_code,kind,currency_exchange_id,currency_exchange_adjustment,currency_exchange_original_amount,currency_exchange_final_amount,currency_exchange_currency,error_code,status,test,user_id,_fivetran_synced,payment_credit_card_bin,payment_cvv_result_code,payment_credit_card_number,payment_credit_card_company,receipt -2667417567303,2181743870023,,415,abcd999999,2020-02-27 16:05:37.000 +0000,2020-02-27 16:05:37.000 +0000,,gateway_here,source_name,message_here,USD,,,Z,sale,,,,,,,success,FALSE,,2020-10-28 20:33:09.797 +0000,,,,, -2572210896967,2089104834631,,415,abcd888888,2020-01-12 20:06:37.000 +0000,2020-01-12 20:06:37.000 +0000,,gateway_here,source_name,message_here,USD,,,Y,sale,,,,,,,success,FALSE,,2020-10-28 17:05:27.756 +0000,,,,, -2664325611591,2179107356743,,415,abcd77777,2020-02-26 00:12:37.000 +0000,2020-02-26 00:12:37.000 +0000,,gateway_here,source_name,message_here,USD,,,,sale,,,,,,,success,FALSE,,2020-10-28 20:23:50.344 +0000,,,,, -2595729735751,2114590769223,,15.95,abcd66666,2020-01-26 11:04:41.000 +0000,2020-01-26 11:04:41.000 +0000,,gateway_here,source_name,message_here,USD,,,Y,sale,,,,,,,success,FALSE,,2020-10-28 18:10:27.604 +0000,,,,, -2705030512711,2214516916295,,212.12,abcd5555,2020-03-18 00:17:24.000 +0000,2020-03-18 00:17:24.000 +0000,,gateway_here,source_name,message_here,USD,,,,sale,,,,,,,success,FALSE,,2020-10-28 22:14:02.944 +0000,,,,, \ No newline at end of file +2667417567303,2181743870023,,415,abcd999999,2020-02-27 16:05:37.000,2020-02-27 16:05:37.000,,gateway_here,source_name,message_here,USD,,,Z,sale,,,,,,,success,FALSE,,2020-10-28 20:33:09.797,,,,, +2572210896967,2089104834631,,415,abcd888888,2020-01-12 20:06:37.000,2020-01-12 20:06:37.000,,gateway_here,source_name,message_here,USD,,,Y,sale,,,,,,,success,FALSE,,2020-10-28 17:05:27.756,,,,, +2664325611591,2179107356743,,415,abcd77777,2020-02-26 00:12:37.000,2020-02-26 00:12:37.000,,gateway_here,source_name,message_here,USD,,,,sale,,,,,,,success,FALSE,,2020-10-28 20:23:50.344,,,,, +2595729735751,2114590769223,,15.95,abcd66666,2020-01-26 11:04:41.000,2020-01-26 11:04:41.000,,gateway_here,source_name,message_here,USD,,,Y,sale,,,,,,,success,FALSE,,2020-10-28 18:10:27.604,,,,, +2705030512711,2214516916295,,212.12,abcd5555,2020-03-18 00:17:24.000,2020-03-18 00:17:24.000,,gateway_here,source_name,message_here,USD,,,,sale,,,,,,,success,FALSE,,2020-10-28 22:14:02.944,,,,, \ No newline at end of file From 0c5044fe56716f25dc5ab11df583f283d8054f72 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 16 Dec 2022 11:43:27 -0800 Subject: [PATCH 058/137] fix schema --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 594f55e..fbf1d5a 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 22d0668..7c73aba 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,7 +4,6 @@ profile: 'integration_tests' config-version: 2 vars: - shopify_schema: shopify_source_integration_tests_1 shopify_source: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" From 779ccebf95bc74d301ca9bd3a30f0fbeb09b7c17 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 16 Dec 2022 11:44:25 -0800 Subject: [PATCH 059/137] Fix buiodkite schema --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 594f55e..fbf1d5a 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_tests + schema: shopify_source_integration_tests_1 threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 22d0668..7c73aba 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,7 +4,6 @@ profile: 'integration_tests' config-version: 2 vars: - shopify_schema: shopify_source_integration_tests_1 shopify_source: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" From ab89daf7252d285715bf13106ff4b5d572fd5361 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 16 Dec 2022 11:58:05 -0800 Subject: [PATCH 060/137] anoter schema --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index fbf1d5a..150e898 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_tests_1 + schema: shopify_source_integration_tests_2 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_tests_1 + schema: shopify_source_integration_tests_2 threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_tests_1 + schema: shopify_source_integration_tests_2 threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_tests_1 + schema: shopify_source_integration_tests_2 threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_tests_1 + schema: shopify_source_integration_tests_2 threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 7c73aba..4df4786 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -14,7 +14,7 @@ vars: shopify_product_variant_identifier: "shopify_product_variant_data" shopify_refund_identifier: "shopify_refund_data" shopify_transaction_identifier: "shopify_transaction_data" - shopify_schema: shopify_source_integration_tests_1 + shopify_schema: shopify_source_integration_tests_2 abandoned_checkout_source: "{{ ref('shopify_abandoned_checkout_data') }}" collection_product_source: "{{ ref('shopify_collection_product_data') }}" From dfdb543d1e37366b9f2c4937203f44b5d0979244 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 16 Dec 2022 12:22:07 -0800 Subject: [PATCH 061/137] use doiff schema --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index fbf1d5a..150e898 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_tests_1 + schema: shopify_source_integration_tests_2 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_tests_1 + schema: shopify_source_integration_tests_2 threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_tests_1 + schema: shopify_source_integration_tests_2 threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_tests_1 + schema: shopify_source_integration_tests_2 threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_tests_1 + schema: shopify_source_integration_tests_2 threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 7c73aba..4df4786 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -14,7 +14,7 @@ vars: shopify_product_variant_identifier: "shopify_product_variant_data" shopify_refund_identifier: "shopify_refund_data" shopify_transaction_identifier: "shopify_transaction_data" - shopify_schema: shopify_source_integration_tests_1 + shopify_schema: shopify_source_integration_tests_2 abandoned_checkout_source: "{{ ref('shopify_abandoned_checkout_data') }}" collection_product_source: "{{ ref('shopify_collection_product_data') }}" From 10efb1bd7ddda6b2d608b70f7f37fcb8f18dabf5 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 16 Dec 2022 14:49:07 -0800 Subject: [PATCH 062/137] use dbt date macro --- CHANGELOG.md | 7 ++++--- models/stg_shopify__abandoned_checkout.sql | 8 +++---- ...pify__abandoned_checkout_discount_code.sql | 6 +++--- models/stg_shopify__collection.sql | 6 +++--- models/stg_shopify__collection_product.sql | 2 +- models/stg_shopify__customer.sql | 15 ++++--------- models/stg_shopify__customer_tag.sql | 2 +- models/stg_shopify__discount_code.sql | 6 +++--- models/stg_shopify__fulfillment.sql | 6 +++--- models/stg_shopify__inventory_item.sql | 6 +++--- models/stg_shopify__inventory_level.sql | 4 ++-- models/stg_shopify__location.sql | 6 +++--- models/stg_shopify__metafield.sql | 6 +++--- models/stg_shopify__order.sql | 21 ++++++++++--------- models/stg_shopify__order_adjustment.sql | 2 +- models/stg_shopify__order_discount_code.sql | 2 +- models/stg_shopify__order_line.sql | 2 +- models/stg_shopify__order_line_refund.sql | 2 +- models/stg_shopify__order_note_attribute.sql | 2 +- models/stg_shopify__order_shipping_line.sql | 2 +- .../stg_shopify__order_shipping_tax_line.sql | 2 +- models/stg_shopify__order_tag.sql | 2 +- models/stg_shopify__order_url_tag.sql | 2 +- models/stg_shopify__price_rule.sql | 10 ++++----- models/stg_shopify__product.sql | 8 +++---- models/stg_shopify__product_image.sql | 6 +++--- models/stg_shopify__product_tag.sql | 2 +- models/stg_shopify__product_variant.sql | 6 +++--- models/stg_shopify__refund.sql | 6 +++--- models/stg_shopify__shop.sql | 6 +++--- models/stg_shopify__tender_transaction.sql | 4 ++-- models/stg_shopify__transaction.sql | 8 +++---- 32 files changed, 85 insertions(+), 90 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01fb853..904cf16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,8 +40,7 @@ - `dbt.current_timestamp_in_utc_backcompat` - Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. -## Updates: -[PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following changes: +[PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following breaking changes: - In the following tables, `*_timestamp` columns have been renamed to `*_at` for consistency: - `stg_shopify__customer` - `stg_shopify__order` @@ -49,8 +48,10 @@ - `stg_shopify__product` - `stg_shopify__transaction` - The `is_requiring_shipping` field in `stg_shopify__order_line` has been renamed to `is_shipping_required`, just because it sounds better :) -- TODO more stuff +## Updates: +[PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following changes: - By default, if the refunds table does not exist, the package will create an empty `stg_shopify__refunds` model. This can still be overwritten by setting `shopify__using_refund` to `false`. We did this because the refunds table is only created once your Shopify account has processed its first refund, and it is unnecessary overhead to have to monitor this and change your dbt_project accordingly. Thus, we took the approach of having this refund table be one that syncs as empty if it is not populated, then seamlessly switches to the source table once it exists. +- TODO more stuff - new tables, fields, passthrough columns, timezone etc. [PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38) includes the following changes: - Esnured Postgres compatibility. diff --git a/models/stg_shopify__abandoned_checkout.sql b/models/stg_shopify__abandoned_checkout.sql index fcccad8..fe0a842 100644 --- a/models/stg_shopify__abandoned_checkout.sql +++ b/models/stg_shopify__abandoned_checkout.sql @@ -45,8 +45,8 @@ final as ( billing_address_zip, buyer_accepts_marketing as has_buyer_accepted_marketing, cart_token, - cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(closed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as closed_at, currency as shop_currency, customer_id, customer_locale, @@ -86,9 +86,9 @@ final as ( total_price, total_tax, total_weight, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, user_id, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__abandoned_checkout_discount_code.sql b/models/stg_shopify__abandoned_checkout_discount_code.sql index 1696465..7eb4482 100644 --- a/models/stg_shopify__abandoned_checkout_discount_code.sql +++ b/models/stg_shopify__abandoned_checkout_discount_code.sql @@ -32,9 +32,9 @@ final as ( discount_id, amount, type, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__collection.sql b/models/stg_shopify__collection.sql index d1a5545..7c6c536 100644 --- a/models/stg_shopify__collection.sql +++ b/models/stg_shopify__collection.sql @@ -33,13 +33,13 @@ final as ( when disjunctive then 'disjunctive' else 'conjunctive' end as rule_logic, handle, - cast(published_at as {{ dbt.type_timestamp() }}) as published_at, published_scope, rules, sort_order, title, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(published_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as published_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__collection_product.sql b/models/stg_shopify__collection_product.sql index 5e3df61..1d6d56a 100644 --- a/models/stg_shopify__collection_product.sql +++ b/models/stg_shopify__collection_product.sql @@ -28,7 +28,7 @@ final as ( select collection_id, product_id, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index f2ed540..62a43f9 100644 --- a/models/stg_shopify__customer.sql +++ b/models/stg_shopify__customer.sql @@ -45,17 +45,10 @@ final as ( coalesce(marketing_opt_in_level, email_marketing_consent_opt_in_level) as marketing_opt_in_level, lifetime_duration, currency, - - - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - {{ dbt_date.convert_timezone(column='created_at', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at_tz, - cast( coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as {{ dbt.type_timestamp() }}) as accepts_marketing_updated_at, - {{ dbt_date.convert_timezone(column='coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at)', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as accepts_marketing_updated_at_tz, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - {{ dbt_date.convert_timezone(column='updated_at', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at_tz, - - - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as accepts_marketing_updated_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('customer_pass_through_columns') }} diff --git a/models/stg_shopify__customer_tag.sql b/models/stg_shopify__customer_tag.sql index 9403f9a..f03c7a9 100644 --- a/models/stg_shopify__customer_tag.sql +++ b/models/stg_shopify__customer_tag.sql @@ -29,7 +29,7 @@ final as ( customer_id, index, value, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__discount_code.sql b/models/stg_shopify__discount_code.sql index 2332aca..af2205b 100644 --- a/models/stg_shopify__discount_code.sql +++ b/models/stg_shopify__discount_code.sql @@ -30,9 +30,9 @@ final as ( code, price_rule_id, usage_count, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__fulfillment.sql b/models/stg_shopify__fulfillment.sql index e0430df..fd8ec61 100644 --- a/models/stg_shopify__fulfillment.sql +++ b/models/stg_shopify__fulfillment.sql @@ -37,9 +37,9 @@ final as ( tracking_number, tracking_numbers, tracking_urls, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__inventory_item.sql b/models/stg_shopify__inventory_item.sql index 5cfa95f..d64a081 100644 --- a/models/stg_shopify__inventory_item.sql +++ b/models/stg_shopify__inventory_item.sql @@ -34,9 +34,9 @@ final as ( province_code_of_origin, requires_shipping as is_shipping_required, tracked as is_inventory_quantity_tracked, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__inventory_level.sql b/models/stg_shopify__inventory_level.sql index 0f6efac..7d3e094 100644 --- a/models/stg_shopify__inventory_level.sql +++ b/models/stg_shopify__inventory_level.sql @@ -29,8 +29,8 @@ final as ( inventory_item_id, location_id, available as available_quantity, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__location.sql b/models/stg_shopify__location.sql index 65221a9..c102d75 100644 --- a/models/stg_shopify__location.sql +++ b/models/stg_shopify__location.sql @@ -43,9 +43,9 @@ final as ( province, province_code, zip, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__metafield.sql b/models/stg_shopify__metafield.sql index 6ac100d..766ee81 100644 --- a/models/stg_shopify__metafield.sql +++ b/models/stg_shopify__metafield.sql @@ -34,9 +34,9 @@ final as ( lower(coalesce(type, value_type)) as value_type, owner_id as owner_resource_id, owner_resource, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index 9480adf..78b9061 100644 --- a/models/stg_shopify__order.sql +++ b/models/stg_shopify__order.sql @@ -29,8 +29,6 @@ final as ( select id as order_id, - cast(processed_at as {{ dbt.type_timestamp() }}) as processed_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, user_id, total_discounts, total_discounts_set, @@ -54,11 +52,13 @@ final as ( number, order_number, cancel_reason, - cast(cancelled_at as {{ dbt.type_timestamp() }}) as cancelled_at, cart_token, checkout_token, - cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(cancelled_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as cancelled_at, + {{ dbt_date.convert_timezone(column='cast(closed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as closed_at, + {{ dbt_date.convert_timezone(column='cast(processed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as processed_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, currency, customer_id, email, @@ -82,7 +82,6 @@ final as ( billing_address_province_code, billing_address_zip, browser_ip, - buyer_accepts_marketing as has_buyer_accepted_marketing, total_shipping_price_set, shipping_address_address_1, shipping_address_address_2, @@ -99,10 +98,7 @@ final as ( shipping_address_province, shipping_address_province_code, shipping_address_zip, - test as is_test_order, token, - _fivetran_synced, - _fivetran_deleted, app_id, checkout_id, client_details_user_agent, @@ -110,12 +106,17 @@ final as ( device_id, order_status_url, presentment_currency, - confirmed, + {# test as is_test_order, #} + _fivetran_deleted as is_deleted, + buyer_accepts_marketing as has_buyer_accepted_marketing, + confirmed as is_confirmed, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('order_pass_through_columns') }} from fields + where not coalesce(test, false) ) select * diff --git a/models/stg_shopify__order_adjustment.sql b/models/stg_shopify__order_adjustment.sql index 4bf2991..23ab848 100644 --- a/models/stg_shopify__order_adjustment.sql +++ b/models/stg_shopify__order_adjustment.sql @@ -38,7 +38,7 @@ final as ( tax_amount_set, kind, reason, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__order_discount_code.sql b/models/stg_shopify__order_discount_code.sql index b970b18..325e79f 100644 --- a/models/stg_shopify__order_discount_code.sql +++ b/models/stg_shopify__order_discount_code.sql @@ -30,7 +30,7 @@ final as ( code, type, amount, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__order_line.sql b/models/stg_shopify__order_line.sql index 6cbb244..3c56784 100644 --- a/models/stg_shopify__order_line.sql +++ b/models/stg_shopify__order_line.sql @@ -61,7 +61,7 @@ final as ( variant_inventory_management, vendor, properties, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('order_line_pass_through_columns') }} diff --git a/models/stg_shopify__order_line_refund.sql b/models/stg_shopify__order_line_refund.sql index 4594dd6..93a558b 100644 --- a/models/stg_shopify__order_line_refund.sql +++ b/models/stg_shopify__order_line_refund.sql @@ -41,7 +41,7 @@ final as ( quantity, refund_id, restock_type, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('order_line_refund_pass_through_columns') }} diff --git a/models/stg_shopify__order_note_attribute.sql b/models/stg_shopify__order_note_attribute.sql index 0ea6883..70aa616 100644 --- a/models/stg_shopify__order_note_attribute.sql +++ b/models/stg_shopify__order_note_attribute.sql @@ -29,7 +29,7 @@ final as ( order_id, name, value, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__order_shipping_line.sql b/models/stg_shopify__order_shipping_line.sql index a4397c2..1d5579f 100644 --- a/models/stg_shopify__order_shipping_line.sql +++ b/models/stg_shopify__order_shipping_line.sql @@ -39,7 +39,7 @@ final as ( requested_fulfillment_service_id is not null as is_third_party_required, source, title, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__order_shipping_tax_line.sql b/models/stg_shopify__order_shipping_tax_line.sql index 3173fcf..f00c49f 100644 --- a/models/stg_shopify__order_shipping_tax_line.sql +++ b/models/stg_shopify__order_shipping_tax_line.sql @@ -32,7 +32,7 @@ final as ( price_set, rate, title, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__order_tag.sql b/models/stg_shopify__order_tag.sql index 0c164b5..a12d4d9 100644 --- a/models/stg_shopify__order_tag.sql +++ b/models/stg_shopify__order_tag.sql @@ -29,7 +29,7 @@ final as ( order_id, index, value, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__order_url_tag.sql b/models/stg_shopify__order_url_tag.sql index 2354907..2497166 100644 --- a/models/stg_shopify__order_url_tag.sql +++ b/models/stg_shopify__order_url_tag.sql @@ -29,7 +29,7 @@ final as ( order_id, key, value, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__price_rule.sql b/models/stg_shopify__price_rule.sql index 4d98774..152c34d 100644 --- a/models/stg_shopify__price_rule.sql +++ b/models/stg_shopify__price_rule.sql @@ -43,11 +43,11 @@ final as ( usage_limit, value, value_type, - cast(starts_at as {{ dbt.type_timestamp() }}) as starts_at, - cast(ends_at as {{ dbt.type_timestamp() }}) as ends_at, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(starts_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as starts_at, + {{ dbt_date.convert_timezone(column='cast(ends_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as ends_at, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__product.sql b/models/stg_shopify__product.sql index 78fad70..1f09947 100644 --- a/models/stg_shopify__product.sql +++ b/models/stg_shopify__product.sql @@ -36,10 +36,10 @@ final as ( vendor, status, _fivetran_deleted as is_deleted, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(published_at as {{ dbt.type_timestamp() }}) as published_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(published_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as published_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('product_pass_through_columns') }} diff --git a/models/stg_shopify__product_image.sql b/models/stg_shopify__product_image.sql index a8d31af..54844c4 100644 --- a/models/stg_shopify__product_image.sql +++ b/models/stg_shopify__product_image.sql @@ -33,9 +33,9 @@ final as ( src, variant_ids, width, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__product_tag.sql b/models/stg_shopify__product_tag.sql index 3a94a6c..162c3a5 100644 --- a/models/stg_shopify__product_tag.sql +++ b/models/stg_shopify__product_tag.sql @@ -29,7 +29,7 @@ final as ( product_id, index, value, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__product_variant.sql b/models/stg_shopify__product_variant.sql index 3305477..f37efd0 100644 --- a/models/stg_shopify__product_variant.sql +++ b/models/stg_shopify__product_variant.sql @@ -50,9 +50,9 @@ final as ( option_2, option_3, tax_code, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('product_variant_pass_through_columns') }} diff --git a/models/stg_shopify__refund.sql b/models/stg_shopify__refund.sql index 7d63c45..3e656da 100644 --- a/models/stg_shopify__refund.sql +++ b/models/stg_shopify__refund.sql @@ -35,9 +35,9 @@ final as ( restock, total_duties_set, user_id, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(processed_at as {{ dbt.type_timestamp() }}) as processed_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(processed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as processed_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__shop.sql b/models/stg_shopify__shop.sql index 192fcb0..0e2068d 100644 --- a/models/stg_shopify__shop.sql +++ b/models/stg_shopify__shop.sql @@ -75,9 +75,9 @@ final as ( pre_launch_enabled as is_pre_launch_enabled, requires_extra_payments_agreement as is_extra_payments_agreement_required, setup_required as is_setup_required, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__tender_transaction.sql b/models/stg_shopify__tender_transaction.sql index 04e47da..95090df 100644 --- a/models/stg_shopify__tender_transaction.sql +++ b/models/stg_shopify__tender_transaction.sql @@ -33,8 +33,8 @@ final as ( payment_method, remote_reference, user_id, - cast(processed_at as {{ dbt.type_timestamp() }}) as processed_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(processed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as processed_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation from fields diff --git a/models/stg_shopify__transaction.sql b/models/stg_shopify__transaction.sql index 455d9d4..f57e778 100644 --- a/models/stg_shopify__transaction.sql +++ b/models/stg_shopify__transaction.sql @@ -54,10 +54,10 @@ final as ( status, user_id, authorization_code, - cast(created_at as {{ dbt.type_timestamp() }}) as created_at, - cast(processed_at as {{ dbt.type_timestamp() }}) as processed_at, - cast(authorization_expires_at as {{ dbt.type_timestamp() }}) as authorization_expires_at, - cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(processed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as processed_at, + {{ dbt_date.convert_timezone(column='cast(authorization_expires_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as authorization_expires_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation {{ fivetran_utils.fill_pass_through_columns('transaction_pass_through_columns') }} From 3f147f052df319d80274842f8726cbdf9e5dc46d Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 16 Dec 2022 14:53:03 -0800 Subject: [PATCH 063/137] redme weak --- README.md | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b086147..8505ecc 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,8 @@ vars: shopify__using_refund: false # true by default ``` +> By default, if the refunds table does not exist, the package will create an empty `stg_shopify__refunds` model. This can still be overwritten by setting `shopify__using_refund` to `false`. We did this because the refunds table is only created once your Shopify account has processed its first refund, and it is unnecessary overhead to have to monitor this and change your dbt_project accordingly. Thus, we took the approach of having this refund table be one that syncs as empty if it is not populated, then seamlessly switches to the source table once it exists. + ## (Optional) Step 5: Additional configurations
Expand to view configurations @@ -85,21 +87,6 @@ vars: product_variant_pass_through_columns: [] ``` -### Disable Models -This package was designed with the intention that users have all relevant Shopify tables being synced by Fivetran. However, if you are a Shopify user that does not operate on returns or adjustments then you will not have the related source tables. As such, you may use the below variable configurations to disable the respective downstream models. All variables are `true` by default. Only add the below configuration if you are wishing to disable the models: - -```yml -# dbt_project.yml - -... -vars: - shopify__using_order_adjustment: false # true by default - shopify__using_order_line_refund: false # true by default - shopify__using_refund: false # true by default -``` - -> By default, if the refunds table does not exist, the package will create an empty `stg_shopify__refunds` model. This can still be overwritten by setting `shopify__using_refund` to `false`. We did this because the refunds table is only created once your Shopify account has processed its first refund, and it is unnecessary overhead to have to monitor this and change your dbt_project accordingly. Thus, we took the approach of having this refund table be one that syncs as empty if it is not populated, then seamlessly switches to the source table once it exists. - ### Changing the Build Schema By default this package will build the Shopify staging models within a schema titled ( + `_stg_shopify`) in your target database. If this is not where you would like your staging Shopify data to be written to, add the following configuration to your `dbt_project.yml` file: From 2bda52e5d5882ad0a1ffacb0c20daa466122d001 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 16 Dec 2022 14:55:36 -0800 Subject: [PATCH 064/137] add different timezone to buildkite script --- .buildkite/scripts/run_models.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh index a0fa78d..f83477d 100644 --- a/.buildkite/scripts/run_models.sh +++ b/.buildkite/scripts/run_models.sh @@ -19,5 +19,5 @@ dbt deps dbt seed --target "$db" --full-refresh dbt run --target "$db" --full-refresh dbt test --target "$db" -dbt run --vars '{shopify__using_order_adjustment: false, shopify__using_order_line_refund: false, shopify__using_refund: false}' --target "$db" --full-refresh +dbt run --vars '{shopify__using_order_adjustment: false, shopify_timezone: "America/New_York", shopify__using_order_line_refund: false, shopify__using_refund: false}' --target "$db" --full-refresh dbt test --target "$db" \ No newline at end of file From a795ee8b078b56982c726b3d7f157c4fdf787fcf Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 16 Dec 2022 15:03:50 -0800 Subject: [PATCH 065/137] changelg --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 904cf16..3dafb0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,10 +54,13 @@ - TODO more stuff - new tables, fields, passthrough columns, timezone etc. [PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38) includes the following changes: -- Esnured Postgres compatibility. +- Ensured Postgres compatibility. - README updated for easier package use and navigation. - `shopify__identifier` variables added if an individual source table has a different name than the package expects. +[PR #41](https://github.com/fivetran/dbt_shopify_source/pull/41) includes the following change: +- Addition of the `shopify_timezone` variable, which converts ALL timestamps included in the package (including `_fivetran_synced`) to a single target timezone (in IANA Database format, ie "America/Los_Angeles"). + # dbt_shopify_source v0.6.0 🎉 dbt v1.0.0 Compatibility 🎉 ## 🚨 Breaking Changes 🚨 From 389355bba6065657ef349bb3bf0e1a6fc69cf88a Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 19 Dec 2022 09:25:45 -0800 Subject: [PATCH 066/137] add dbt date to dependcy matrix --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b086147..6d7f321 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,9 @@ packages: - package: dbt-labs/dbt_utils version: [">=1.0.0", "<2.0.0"] + + - package: calogica/dbt_date + version: [">=0.7.0", "<0.8.0"] ``` # 🙌 How is this package maintained and can I contribute? From 2647cb1b7ba2bd1b10ee2056fb109668cbdfd3c1 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 19 Dec 2022 16:59:38 -0800 Subject: [PATCH 067/137] Update CHANGELOG.md Co-authored-by: Avinash Kunnath <108772760+fivetran-avinash@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dafb0e..bf7b2f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,7 +40,7 @@ - `dbt.current_timestamp_in_utc_backcompat` - Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. -[PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following breaking changes: +[PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following breaking changes: - In the following tables, `*_timestamp` columns have been renamed to `*_at` for consistency: - `stg_shopify__customer` - `stg_shopify__order` From 6d86cd505baf2c7e3b60ed0d1a83bea4c264bc91 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 27 Dec 2022 16:08:51 -0800 Subject: [PATCH 068/137] reverting due to too many downstream consequences --- CHANGELOG.md | 6 ------ models/stg_shopify.yml | 28 ++++++++++++------------- models/stg_shopify__customer.sql | 6 +++--- models/stg_shopify__order.sql | 10 ++++----- models/stg_shopify__product.sql | 6 +++--- models/stg_shopify__product_variant.sql | 4 ++-- models/stg_shopify__transaction.sql | 4 ++-- 7 files changed, 29 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf7b2f6..117727f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,12 +41,6 @@ - Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following breaking changes: -- In the following tables, `*_timestamp` columns have been renamed to `*_at` for consistency: - - `stg_shopify__customer` - - `stg_shopify__order` - - `stg_shopify__product_variant` - - `stg_shopify__product` - - `stg_shopify__transaction` - The `is_requiring_shipping` field in `stg_shopify__order_line` has been renamed to `is_shipping_required`, just because it sounds better :) ## Updates: [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following changes: diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 5e6357a..b56b749 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -13,7 +13,7 @@ models: description: "{{ doc('_fivetran_synced') }}" - name: has_accepted_marketing description: Whether the customer has consented to receive marketing material via email. - - name: created_at + - name: created_timestamp description: The date and time when the customer was created. - name: default_address_id description: The default address for the customer. @@ -35,7 +35,7 @@ models: description: Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout. - name: total_spent description: The total amount of money that the customer has spent across their order history. - - name: updated_at + - name: updated_timestamp description: The date and time when the customer information was last updated. - name: is_verified_email description: Whether the customer has verified their email address. @@ -162,13 +162,13 @@ models: description: Whether the customer consented to receive email updates from the shop. - name: cancel_reason description: The reason why the order was canceled. - - name: cancelled_at + - name: cancelled_timestamp description: The date and time when the order was canceled. - name: cart_token description: The ID of the cart that's associated with the order. - - name: closed_at + - name: closed_timestamp description: The date and time when the order was closed. - - name: created_at + - name: created_timestamp description: The autogenerated date and time when the order was created in Shopify. - name: currency description: The three-letter code for the shop currency. @@ -194,7 +194,7 @@ models: description: The order's position in the shop's count of orders. Numbers are sequential and start at 1. - name: order_number description: The order 's position in the shop's count of orders starting at 1001. Order numbers are sequential and start at 1001. - - name: processed_at + - name: processed_timestamp description: The date and time when an order was processed. This value is the date that appears on your orders and that's used in the analytic reports. - name: processing_method description: How the payment was processed. @@ -250,7 +250,7 @@ models: description: The sum of all the taxes applied to the order in th shop currency. Must be positive). - name: total_weight description: The sum of all line item weights in grams. - - name: updated_at + - name: updated_timestamp description: The date and time (ISO 8601 format) when the order was last modified. - name: user_id description: The ID of the user logged into Shopify POS who processed the order, if applicable. @@ -273,7 +273,7 @@ models: description: Whether the record has been deleted in the source system. - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - - name: created_at + - name: created_timestamp description: The date and time when the product was created. - name: handle description: A unique human-friendly string for the product. Automatically generated from the product's title. @@ -281,13 +281,13 @@ models: description: An unsigned 64-bit integer that's used as a unique identifier for the product. Each id is unique across the Shopify system. No two products will have the same id, even if they're from different shops. - name: product_type description: A categorization for the product used for filtering and searching products. - - name: published_at + - name: published_timestamp description: The date and time (ISO 8601 format) when the product was published. Can be set to null to unpublish the product from the Online Store channel. - name: published_scope description: Whether the product is published to the Point of Sale channel. - name: title description: The name of the product. - - name: updated_at + - name: updated_timestamp description: The date and time when the product was last modified. - name: vendor description: The name of the product's vendor. @@ -304,7 +304,7 @@ models: description: The barcode, UPC, or ISBN number for the product. - name: compare_at_price description: The original price of the item before an adjustment or a sale. - - name: created_at + - name: created_timestamp description: The date and time (ISO 8601 format) when the product variant was created. - name: fulfillment_service description: The fulfillment service associated with the product variant. @@ -344,7 +344,7 @@ models: description: This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant. - name: title description: The title of the product variant. The title field is a concatenation of the option1, option2, and option3 fields. You can only update title indirectly using the option fields. - - name: updated_at + - name: updated_timestamp description: The date and time when the product variant was last modified. Gets returned in ISO 8601 format. - name: weight description: The weight of the product variant in the unit system specified with weight_unit. @@ -371,9 +371,9 @@ models: description: The amount of money included in the transaction. - name: authorization_code description: The authorization code associated with the transaction. - - name: created_at + - name: created_timestamp description: The date and time when the transaction was created. - - name: processed_at + - name: processed_timestamp description: The date and time when a transaction was processed. - name: device_id description: The ID for the device. diff --git a/models/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index 62a43f9..d36b504 100644 --- a/models/stg_shopify__customer.sql +++ b/models/stg_shopify__customer.sql @@ -37,7 +37,7 @@ final as ( last_name, orders_count, phone, - state as account_state, + lower(state) as account_state, tax_exempt as is_tax_exempt, total_spent, verified_email as is_verified_email, @@ -45,9 +45,9 @@ final as ( coalesce(marketing_opt_in_level, email_marketing_consent_opt_in_level) as marketing_opt_in_level, lifetime_duration, currency, - {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_timestamp, {{ dbt_date.convert_timezone(column='cast(coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as accepts_marketing_updated_at, - {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_timestamp, {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index 78b9061..0c0293c 100644 --- a/models/stg_shopify__order.sql +++ b/models/stg_shopify__order.sql @@ -54,11 +54,11 @@ final as ( cancel_reason, cart_token, checkout_token, - {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, - {{ dbt_date.convert_timezone(column='cast(cancelled_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as cancelled_at, - {{ dbt_date.convert_timezone(column='cast(closed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as closed_at, - {{ dbt_date.convert_timezone(column='cast(processed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as processed_at, - {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_timestamp, + {{ dbt_date.convert_timezone(column='cast(cancelled_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as cancelled_timestamp, + {{ dbt_date.convert_timezone(column='cast(closed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as closed_timestamp, + {{ dbt_date.convert_timezone(column='cast(processed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as processed_timestamp, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_timestamp, currency, customer_id, email, diff --git a/models/stg_shopify__product.sql b/models/stg_shopify__product.sql index 1f09947..4e22d95 100644 --- a/models/stg_shopify__product.sql +++ b/models/stg_shopify__product.sql @@ -36,9 +36,9 @@ final as ( vendor, status, _fivetran_deleted as is_deleted, - {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, - {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, - {{ dbt_date.convert_timezone(column='cast(published_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as published_at, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_timestamp, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_timestamp, + {{ dbt_date.convert_timezone(column='cast(published_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as published_timestamp, {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation diff --git a/models/stg_shopify__product_variant.sql b/models/stg_shopify__product_variant.sql index f37efd0..7143c24 100644 --- a/models/stg_shopify__product_variant.sql +++ b/models/stg_shopify__product_variant.sql @@ -50,8 +50,8 @@ final as ( option_2, option_3, tax_code, - {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, - {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_timestamp, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_timestamp, {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation diff --git a/models/stg_shopify__transaction.sql b/models/stg_shopify__transaction.sql index f57e778..4973051 100644 --- a/models/stg_shopify__transaction.sql +++ b/models/stg_shopify__transaction.sql @@ -54,8 +54,8 @@ final as ( status, user_id, authorization_code, - {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, - {{ dbt_date.convert_timezone(column='cast(processed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as processed_at, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_timestamp, + {{ dbt_date.convert_timezone(column='cast(processed_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as processed_timestamp, {{ dbt_date.convert_timezone(column='cast(authorization_expires_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as authorization_expires_at, {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation From 7d46536be1b0f9c610cdcb520c609bc2a5b63f41 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 28 Dec 2022 16:58:51 -0800 Subject: [PATCH 069/137] docs and style ipdates --- CHANGELOG.md | 37 +++++++++++++++ integration_tests/dbt_project.yml | 46 +++++++++---------- .../seeds/shopify_order_adjustment_data.csv | 10 ++-- .../seeds/shopify_order_data.csv | 6 +-- .../seeds/shopify_product_variant_data.csv | 10 ++-- .../seeds/shopify_refund_data.csv | 10 ++-- .../seeds/shopify_transaction_data.csv | 10 ++-- models/src_shopify.yml | 22 +++++++++ models/stg_shopify__order.sql | 8 ++-- models/stg_shopify__order_line.sql | 3 +- 10 files changed, 109 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01fb853..0fd0d82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,41 @@ ## 🎉 Documentation and Feature Updates - Updated README documentation updates for easier navigation and setup of the dbt package - Included `shopify_[source_table_name]_identifier` variable for additional flexibility within the package when source tables are named differently. +- The following fields have been added to their respective staging models: + - `stg_shopify__order`: + - `total_discounts_set` + - `total_line_items_price_set` + - `total_price_usd` + - `total_price_set` + - `total_tax_set` + - `total_tip_received` + - `is_deleted` + - `app_id` + - `checkout_id` + - `client_details_user_agent` + - `customer_locale` + - `order_status_url` + - `presentment_currency` + - `is_inventory_confirmed` + - `stg_shopify__customer`: + - `note` + - `lifetime_duration` + - `currency` + - `marketing_consent_state` (coalescing of `email_marketing_consent_state` and deprecated `accepts_marketing` field) + - `marketing_opt_in_level` (coalescing of `email_marketing_consent_opt_in_level` and deprecated `marketing_opt_in_level` field) + - `marketing_consent_updated_at` (coalescing of `email_marketing_consent_consent_updated_at` and deprecated `accepts_marketing_updated_at` field) + - `stg_shopify__order_line_refund`: + - `subtotal_set` + - `total_tax_set` + - `stg_shopify__order_line`: + - `pre_tax_price_set` + - `price_set` + - `tax_code` + - `total_discount_set` + - `variant_title` + - `variant_inventory_management` + - `vendor` + - `properties` ## 🚨 Breaking Changes 🚨: [PR #36](https://github.com/fivetran/dbt_shopify_source/pull/36) includes the following breaking changes: @@ -39,6 +74,8 @@ - `dbt.current_timestamp_backcompat` - `dbt.current_timestamp_in_utc_backcompat` - Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. +- The following fields have been removed as they have been deprecated: + - ## Updates: [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following changes: diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 22d0668..0106a2e 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -15,30 +15,28 @@ vars: shopify_product_variant_identifier: "shopify_product_variant_data" shopify_refund_identifier: "shopify_refund_data" shopify_transaction_identifier: "shopify_transaction_data" - shopify_schema: shopify_source_integration_tests_1 - - abandoned_checkout_source: "{{ ref('shopify_abandoned_checkout_data') }}" - collection_product_source: "{{ ref('shopify_collection_product_data') }}" - collection_source: "{{ ref('shopify_collection_data') }}" - customer_tag_source: "{{ ref('shopify_customer_tag_data') }}" - discount_code_source: "{{ ref('shopify_discount_code_data') }}" - fulfillment_source: "{{ ref('shopify_fulfillment_data') }}" - inventory_item_source: "{{ ref('shopify_inventory_item_data') }}" - inventory_level_source: "{{ ref('shopify_inventory_level_data') }}" - location_source: "{{ ref('shopify_location_data') }}" - metafield_source: "{{ ref('shopify_metafield_data') }}" - order_note_attribute_source: "{{ ref('shopify_order_note_attribute_data') }}" - order_shipping_line_source: "{{ ref('shopify_order_shipping_line_data') }}" - order_shipping_tax_line_source: "{{ ref('shopify_order_shipping_tax_line_data') }}" - order_tag_source: "{{ ref('shopify_order_tag_data') }}" - order_url_tag_source: "{{ ref('shopify_order_url_tag_data') }}" - price_rule_source: "{{ ref('shopify_price_rule_data') }}" - product_image_source: "{{ ref('shopify_product_image_data') }}" - product_tag_source: "{{ ref('shopify_product_tag_data') }}" - shop_source: "{{ ref('shopify_shop_data') }}" - tender_transaction_source: "{{ ref('shopify_tender_transaction_data') }}" - abandoned_checkout_discount_code_source: "{{ ref('shopify_abandoned_checkout_discount_code_data') }}" - order_discount_code_source: "{{ ref('shopify_order_discount_code_data') }}" + shopify_abandoned_checkout_identifier: "shopify_abandoned_checkout_data" + shopify_collection_product_identifier: "shopify_collection_product_data" + shopify_collection_identifier: "shopify_collection_data" + shopify_customer_tag_identifier: "shopify_customer_tag_data" + shopify_discount_code_identifier: "shopify_discount_code_data" + shopify_fulfillment_identifier: "shopify_fulfillment_data" + shopify_inventory_item_identifier: "shopify_inventory_item_data" + shopify_inventory_level_identifier: "shopify_inventory_level_data" + shopify_location_identifier: "shopify_location_data" + shopify_metafield_identifier: "shopify_metafield_data" + shopify_order_note_attribute_identifier: "shopify_order_note_attribute_data" + shopify_order_shipping_line_identifier: "shopify_order_shipping_line_data" + shopify_order_shipping_tax_line_identifier: "shopify_order_shipping_tax_line_data" + shopify_order_tag_identifier: "shopify_order_tag_data" + shopify_order_url_tag_identifier: "shopify_order_url_tag_data" + shopify_price_rule_identifier: "shopify_price_rule_data" + shopify_product_image_identifier: "shopify_product_image_data" + shopify_product_tag_identifier: "shopify_product_tag_data" + shopify_shop_identifier: "shopify_shop_data" + shopify_tender_transaction_identifier: "shopify_tender_transaction_data" + shopify_abandoned_checkout_discount_code_identifier: "shopify_abandoned_checkout_discount_code_data" + shopify_order_discount_code_identifier: "shopify_order_discount_code_data" dispatch: - macro_namespace: dbt_utils diff --git a/integration_tests/seeds/shopify_order_adjustment_data.csv b/integration_tests/seeds/shopify_order_adjustment_data.csv index 8f6edd9..191f585 100644 --- a/integration_tests/seeds/shopify_order_adjustment_data.csv +++ b/integration_tests/seeds/shopify_order_adjustment_data.csv @@ -1,6 +1,6 @@ id,order_id,refund_id,amount,tax_amount,kind,reason,amount_set,tax_amount_set,_fivetran_synced -109271056455,2712175083591,675617407047,-465,0,shipping_refund,Shipping refund,,,2020-11-14 07:52:56.522 +0000 -109277085767,2773486501959,675634708551,-95,0,shipping_refund,Shipping refund,,,2020-11-14 07:54:41.682 +0000 -109245956167,2771757826119,675548168263,-27,-1.6,shipping_refund,Shipping refund,,,2020-11-14 07:44:24.602 +0000 -109248118855,2771329908807,675555016775,-35,0,shipping_refund,Shipping refund,,,2020-11-14 07:45:11.536 +0000 -109275742279,2773429682247,675632644167,-515,0,refund_discrepancy,Refund discrepancy,,,2020-11-14 07:54:31.054 +0000 \ No newline at end of file +109271056455,2712175083591,675617407047,-465,0,shipping_refund,Shipping refund,,,2020-11-14 07:52:56.522 +109277085767,2773486501959,675634708551,-95,0,shipping_refund,Shipping refund,,,2020-11-14 07:54:41.682 +109245956167,2771757826119,675548168263,-27,-1.6,shipping_refund,Shipping refund,,,2020-11-14 07:44:24.602 +109248118855,2771329908807,675555016775,-35,0,shipping_refund,Shipping refund,,,2020-11-14 07:45:11.536 +109275742279,2773429682247,675632644167,-515,0,refund_discrepancy,Refund discrepancy,,,2020-11-14 07:54:31.054 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_order_data.csv b/integration_tests/seeds/shopify_order_data.csv index 319131e..03d9320 100644 --- a/integration_tests/seeds/shopify_order_data.csv +++ b/integration_tests/seeds/shopify_order_data.csv @@ -1,4 +1,4 @@ id,note,email,taxes_included,currency,subtotal_price,total_tax,total_price,created_at,updated_at,name,shipping_address_name,shipping_address_first_name,shipping_address_last_name,shipping_address_company,shipping_address_phone,shipping_address_address_1,shipping_address_address_2,shipping_address_city,shipping_address_country,shipping_address_country_code,shipping_address_province,shipping_address_province_code,shipping_address_zip,shipping_address_latitude,shipping_address_longitude,billing_address_name,billing_address_first_name,billing_address_last_name,billing_address_company,billing_address_phone,billing_address_address_1,billing_address_address_2,billing_address_city,billing_address_country,billing_address_country_code,billing_address_province,billing_address_province_code,billing_address_zip,billing_address_latitude,billing_address_longitude,customer_id,location_id,user_id,number,order_number,financial_status,fulfillment_status,processed_at,processing_method,referring_site,cancel_reason,cancelled_at,closed_at,total_discounts,total_line_items_price,total_weight,source_name,browser_ip,buyer_accepts_marketing,token,cart_token,checkout_token,test,landing_site_base_url,_fivetran_synced,total_shipping_price_set -2674098602081,71509c29301d2cc14e37ecb53f735608,021cb20b5c78751fc7ddc091b6b69b3e,TRUE,GBP,2.8,0,2.8,2020-09-11 19:35:42.000 ,2020-09-11 19:35:46.000 ,d1743fc58a1e4d78769eaac49994a994,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,3589760876641,,,4135,5135,paid,,2020-09-11 19:35:42.000 ,,,,,,2.8,5.6,0,294517,,TRUE,0f9c2880de17f71511eee5542c29b999,,,FALSE,,2020-09-12 00:15:10.199,one -2669516488801,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,2.8,0,3.79,2020-09-09 23:01:54.000 ,2020-09-10 15:38:26.000 ,4fcb884b5b46413bae526a6e7e49d706,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4066,5066,paid,fulfilled,2020-09-09 23:01:53.000 ,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:26.000 ,0,2.8,0,web,109.249.185.68,FALSE,fb489b3ccc0ae36ce47744d7595e9746,b1ff04883dfeab658cd5211050476729,7bdb994e1196de3e4f34586e357613f9,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.536,one -2669509541985,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,4.4,0,5.39,2020-09-09 22:57:51.000 ,2020-09-10 15:38:25.000 ,9e346f2e912c60e16679f4a4c8d29422,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4065,5065,paid,fulfilled,2020-09-09 22:57:50.000 ,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:25.000 ,0,4.4,0,web,109.249.185.68,FALSE,e44b7f04610a8f4032530cc7f12663de,9600543f4d4613db59ac58a1009ecbb9,cf0a9fe2c7c606b86559007dbb890a62,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.037,one \ No newline at end of file +2674098602081,71509c29301d2cc14e37ecb53f735608,021cb20b5c78751fc7ddc091b6b69b3e,TRUE,GBP,2.8,0,2.8,2020-09-11 19:35:42.000,2020-09-11 19:35:46.000,d1743fc58a1e4d78769eaac49994a994,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,8b121314a4d97bc9dc15bfba8518ec88,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,d6f4a399883df85d9d4b3a02bf6e738a,bc9b8576178dcd886639ba718f1d45c8,ac08c606d455cde42980f980524a8038,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,d41d8cd98f00b204e9800998ecf8427e,,00079ce435afddc28205639142773870,d97319f64674c02595f2989019970fc8,c08dae474c5d4d3326fd6764d2a0ebe6,3589760876641,,,4135,5135,paid,,2020-09-11 19:35:42.000,,,,,,2.8,5.6,0,294517,,TRUE,0f9c2880de17f71511eee5542c29b999,,,FALSE,,2020-09-12 00:15:10.199,one +2669516488801,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,2.8,0,3.79,2020-09-09 23:01:54.000,2020-09-10 15:38:26.000,4fcb884b5b46413bae526a6e7e49d706,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4066,5066,paid,fulfilled,2020-09-09 23:01:53.000,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:26.000,0,2.8,0,web,109.249.185.68,FALSE,fb489b3ccc0ae36ce47744d7595e9746,b1ff04883dfeab658cd5211050476729,7bdb994e1196de3e4f34586e357613f9,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.536,one +2669509541985,,dce90c7b4e52e045e5975836aff49cf1,TRUE,GBP,4.4,0,5.39,2020-09-09 22:57:51.000,2020-09-10 15:38:25.000,9e346f2e912c60e16679f4a4c8d29422,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,c8189c7add9755e66391b58ecc12b3e2,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,d41d8cd98f00b204e9800998ecf8427e,d41d8cd98f00b204e9800998ecf8427e,1ff1de774005f8da13f42943881c655f,70111f8840ccbd8b1007cc3f387ced6b,1ac412baeba98370017c73df41c98a07,89f9c9f489be2a83cf57e53b9197d288,79cba1185463850dedba31f172f1dc5b,,,2357e65b582faa0a2da3603b16fa4a7f,75c29d6dd29594a652fcbd7c4c279a29,75468fbebc28e02ec5d4f54f4cbd4099,3584045351009,,,4065,5065,paid,fulfilled,2020-09-09 22:57:50.000,direct,2cc983716a820bc713b793a6e8e73f42,,,2020-09-10 15:38:25.000,0,4.4,0,web,109.249.185.68,FALSE,e44b7f04610a8f4032530cc7f12663de,9600543f4d4613db59ac58a1009ecbb9,cf0a9fe2c7c606b86559007dbb890a62,FALSE,8584e97b29b0802fb393fa453a8b6a7a,2020-09-11 00:14:33.037,one \ No newline at end of file diff --git a/integration_tests/seeds/shopify_product_variant_data.csv b/integration_tests/seeds/shopify_product_variant_data.csv index 18dcd0c..44dde0f 100644 --- a/integration_tests/seeds/shopify_product_variant_data.csv +++ b/integration_tests/seeds/shopify_product_variant_data.csv @@ -1,6 +1,6 @@ id,product_id,inventory_item_id,title,price,sku,position,inventory_policy,compare_at_price,fulfillment_service,inventory_management,created_at,updated_at,taxable,barcode,grams,image_id,inventory_quantity,weight,weight_unit,old_inventory_quantity,requires_shipping,_fivetran_synced,option_2,tax_code,option_3,option_1 -39262114414663,6540108431431,41356021661767,my title here,111,,1,deny,,manual,,2021-03-08 16:30:15.000 +0000,2021-04-12 19:49:43.000 +0000,FALSE,,0,,0,0,lb,0,FALSE,2021-04-16 07:50:32.995 +0000,,,,my title here -39273118957639,6544066379847,41367035936839,my title here,222,,1,deny,,manual,,2021-03-17 16:39:45.000 +0000,2021-04-12 19:46:59.000 +0000,FALSE,,0,,0,0,lb,0,FALSE,2021-04-16 07:50:29.241 +0000,,,,my title here -39290169262151,6548438188103,41384094924871,my title here,5,,1,deny,,manual,inventory manager,2021-03-30 19:48:15.000 +0000,2021-03-30 19:48:15.000 +0000,TRUE,,0,,0,0,lb,0,TRUE,2021-04-16 07:50:32.720 +0000,,,,my title here -39262115397703,6540109250631,41356022644807,my title here,333,,1,deny,,manual,,2021-03-08 16:31:31.000 +0000,2021-04-12 19:47:26.000 +0000,FALSE,,0,,-5,0,lb,-5,FALSE,2021-04-16 07:50:29.822 +0000,,,,my title here -29217058947142,3879735590982,30309980143686,my other title,444,,1,deny,,manual,inventory manager,2019-06-25 18:32:03.000 +0000,2019-10-01 23:40:09.000 +0000,TRUE,,222,,0,1,lb,0,TRUE,2021-04-16 07:50:25.006 +0000,,TR9999,,my other title \ No newline at end of file +39262114414663,6540108431431,41356021661767,my title here,111,,1,deny,,manual,,2021-03-08 16:30:15.000,2021-04-12 19:49:43.000,FALSE,,0,,0,0,lb,0,FALSE,2021-04-16 07:50:32.995,,,,my title here +39273118957639,6544066379847,41367035936839,my title here,222,,1,deny,,manual,,2021-03-17 16:39:45.000,2021-04-12 19:46:59.000,FALSE,,0,,0,0,lb,0,FALSE,2021-04-16 07:50:29.241,,,,my title here +39290169262151,6548438188103,41384094924871,my title here,5,,1,deny,,manual,inventory manager,2021-03-30 19:48:15.000,2021-03-30 19:48:15.000,TRUE,,0,,0,0,lb,0,TRUE,2021-04-16 07:50:32.720,,,,my title here +39262115397703,6540109250631,41356022644807,my title here,333,,1,deny,,manual,,2021-03-08 16:31:31.000,2021-04-12 19:47:26.000,FALSE,,0,,-5,0,lb,-5,FALSE,2021-04-16 07:50:29.822,,,,my title here +29217058947142,3879735590982,30309980143686,my other title,444,,1,deny,,manual,inventory manager,2019-06-25 18:32:03.000,2019-10-01 23:40:09.000,TRUE,,222,,0,1,lb,0,TRUE,2021-04-16 07:50:25.006,,TR9999,,my other title \ No newline at end of file diff --git a/integration_tests/seeds/shopify_refund_data.csv b/integration_tests/seeds/shopify_refund_data.csv index 3ed823d..7a7f50f 100644 --- a/integration_tests/seeds/shopify_refund_data.csv +++ b/integration_tests/seeds/shopify_refund_data.csv @@ -1,6 +1,6 @@ id,created_at,processed_at,note,restock,user_id,_fivetran_synced,total_duties_set,order_id -801704738887,2021-04-17 20:25:08.000 +0000,2021-04-17 20:25:08.000 +0000,,FALSE,40467791943,2021-04-18 08:05:22.056 +0000,,3726667481159 -801695039559,2021-04-17 15:45:21.000 +0000,2021-04-17 15:45:21.000 +0000,,FALSE,40467791943,2021-04-18 07:52:19.104 +0000,,3725521846343 -801704181831,2021-04-17 20:15:01.000 +0000,2021-04-17 20:15:01.000 +0000,,FALSE,40467791943,2021-04-18 08:05:22.522 +0000,,3726619476039 -801703428167,2021-04-17 19:56:51.000 +0000,2021-04-17 19:56:51.000 +0000,my refund note,FALSE,40467791943,2021-04-18 08:05:22.841 +0000,,3726370996295 -801707360327,2021-04-17 21:32:50.000 +0000,2021-04-17 21:32:50.000 +0000,,FALSE,40467791943,2021-04-18 08:02:24.256 +0000,,3726858289223 \ No newline at end of file +801704738887,2021-04-17 20:25:08.000,2021-04-17 20:25:08.000,,FALSE,40467791943,2021-04-18 08:05:22.056,,3726667481159 +801695039559,2021-04-17 15:45:21.000,2021-04-17 15:45:21.000,,FALSE,40467791943,2021-04-18 07:52:19.104,,3725521846343 +801704181831,2021-04-17 20:15:01.000,2021-04-17 20:15:01.000,,FALSE,40467791943,2021-04-18 08:05:22.522,,3726619476039 +801703428167,2021-04-17 19:56:51.000,2021-04-17 19:56:51.000,my refund note,FALSE,40467791943,2021-04-18 08:05:22.841,,3726370996295 +801707360327,2021-04-17 21:32:50.000,2021-04-17 21:32:50.000,,FALSE,40467791943,2021-04-18 08:02:24.256,,3726858289223 \ No newline at end of file diff --git a/integration_tests/seeds/shopify_transaction_data.csv b/integration_tests/seeds/shopify_transaction_data.csv index ed6dc8a..9bf0015 100644 --- a/integration_tests/seeds/shopify_transaction_data.csv +++ b/integration_tests/seeds/shopify_transaction_data.csv @@ -1,6 +1,6 @@ id,order_id,refund_id,amount,authorization,created_at,processed_at,device_id,gateway,source_name,message,currency,location_id,parent_id,payment_avs_result_code,kind,currency_exchange_id,currency_exchange_adjustment,currency_exchange_original_amount,currency_exchange_final_amount,currency_exchange_currency,error_code,status,test,user_id,_fivetran_synced,payment_credit_card_bin,payment_cvv_result_code,payment_credit_card_number,payment_credit_card_company,receipt -2667417567303,2181743870023,,415,abcd999999,2020-02-27 16:05:37.000 +0000,2020-02-27 16:05:37.000 +0000,,gateway_here,source_name,message_here,USD,,,Z,sale,,,,,,,success,FALSE,,2020-10-28 20:33:09.797 +0000,,,,, -2572210896967,2089104834631,,415,abcd888888,2020-01-12 20:06:37.000 +0000,2020-01-12 20:06:37.000 +0000,,gateway_here,source_name,message_here,USD,,,Y,sale,,,,,,,success,FALSE,,2020-10-28 17:05:27.756 +0000,,,,, -2664325611591,2179107356743,,415,abcd77777,2020-02-26 00:12:37.000 +0000,2020-02-26 00:12:37.000 +0000,,gateway_here,source_name,message_here,USD,,,,sale,,,,,,,success,FALSE,,2020-10-28 20:23:50.344 +0000,,,,, -2595729735751,2114590769223,,15.95,abcd66666,2020-01-26 11:04:41.000 +0000,2020-01-26 11:04:41.000 +0000,,gateway_here,source_name,message_here,USD,,,Y,sale,,,,,,,success,FALSE,,2020-10-28 18:10:27.604 +0000,,,,, -2705030512711,2214516916295,,212.12,abcd5555,2020-03-18 00:17:24.000 +0000,2020-03-18 00:17:24.000 +0000,,gateway_here,source_name,message_here,USD,,,,sale,,,,,,,success,FALSE,,2020-10-28 22:14:02.944 +0000,,,,, \ No newline at end of file +2667417567303,2181743870023,,415,abcd999999,2020-02-27 16:05:37.000,2020-02-27 16:05:37.000,,gateway_here,source_name,message_here,USD,,,Z,sale,,,,,,,success,FALSE,,2020-10-28 20:33:09.797,,,,, +2572210896967,2089104834631,,415,abcd888888,2020-01-12 20:06:37.000,2020-01-12 20:06:37.000,,gateway_here,source_name,message_here,USD,,,Y,sale,,,,,,,success,FALSE,,2020-10-28 17:05:27.756,,,,, +2664325611591,2179107356743,,415,abcd77777,2020-02-26 00:12:37.000,2020-02-26 00:12:37.000,,gateway_here,source_name,message_here,USD,,,,sale,,,,,,,success,FALSE,,2020-10-28 20:23:50.344,,,,, +2595729735751,2114590769223,,15.95,abcd66666,2020-01-26 11:04:41.000,2020-01-26 11:04:41.000,,gateway_here,source_name,message_here,USD,,,Y,sale,,,,,,,success,FALSE,,2020-10-28 18:10:27.604,,,,, +2705030512711,2214516916295,,212.12,abcd5555,2020-03-18 00:17:24.000,2020-03-18 00:17:24.000,,gateway_here,source_name,message_here,USD,,,,sale,,,,,,,success,FALSE,,2020-10-28 22:14:02.944,,,,, \ No newline at end of file diff --git a/models/src_shopify.yml b/models/src_shopify.yml index d00af69..aafd7c3 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -477,6 +477,7 @@ sources: - name: abandoned_checkout description: A checkout is considered abandoned after the customer has added contact information, but before the customer has completed their purchase. + identifier: "{{ var('shopify_abandoned_checkout_identifier', 'abandoned_checkout') }}" columns: - name: _fivetran_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -607,6 +608,7 @@ sources: - name: collection_product description: Table relating products to the collections they belong to. Use this instead of the deprecated `COLLECT` table. + identifier: "{{ var('shopify_collection_product_identifier', 'collection_product') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -619,6 +621,7 @@ sources: description: > A collection is a grouping of products that merchants can create to make their stores easier to browse. Merchants can create collections by selecting products individually or by defining rules that automatically determine whether products are included (aka a "smart collection"). + identifier: "{{ var('shopify_collection_identifier', 'collection') }}" columns: - name: _fivetran_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -661,6 +664,7 @@ sources: - name: customer_tag description: Tags that the shop owner has attached to the customer. A customer can have up to 250 tags. + identifier: "{{ var('shopify_customer_tag_identifier', 'customer_tag') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -675,6 +679,7 @@ sources: description: > Table storing discount codes that enable specific discounts to be redeemed. Merchants can distribute discount codes to their customers using a variety of means, such as an email or URL, and customers can apply these codes at checkout. Each discount code belongs to a price rule, which holds the logic for the discount. + identifier: "{{ var('shopify_discount_code_identifier', 'discount_code') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -695,6 +700,7 @@ sources: description: > A fulfillment order represents a group of one or more items in an order that will be fulfilled from the same location. A fulfillment represents work that is completed as part of a fulfillment order and can include one or more items. + identifier: "{{ var('shopify_fulfillment_identifier', 'fulfillment') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -750,6 +756,7 @@ sources: description: > An inventory item represents a physical good. It holds essential information about the physical good, including its SKU and whether its inventory is tracked. There is a 1:1 relationship between a product variant and an inventory item. + identifier: "{{ var('shopify_inventory_item_identifier', 'inventory_item') }}" columns: - name: _fivetran_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -780,6 +787,7 @@ sources: Each inventory level belongs to one inventory item and has one location. For every location where an inventory item can be stocked, there's an inventory level that represents the inventory item's quantities relating to that location. + identifier: "{{ var('shopify_inventory_level_identifier', 'inventory_level') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -794,6 +802,7 @@ sources: - name: location description: A location represents a geographical location where your stores, pop-up stores, headquarters, and warehouses exist. + identifier: "{{ var('shopify_location_identifier', 'location') }}" columns: - name: _fivetran_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -843,6 +852,7 @@ sources: description: > Metafields are a flexible way to attach additional information to a Shopify resource (e.g. Product, Collection, etc.). Some examples of data stored using metafields include specifications, size charts, downloadable documents, release dates, images, or part numbers. Metafields are identified by an owner resource, a namespace, and a key and they store a value along with type information for that context. + identifier: "{{ var('shopify_metafield_identifier', 'metafield') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -871,6 +881,7 @@ sources: - name: order_note_attribute description: Table storing custom attributes placed on orders. + identifier: "{{ var('shopify_order_note_attribute_identifier', 'order_note_attribute') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -883,6 +894,7 @@ sources: - name: order_shipping_line description: Represents the shipping details that the customer chose for their order. + identifier: "{{ var('shopify_order_shipping_line_identifier', 'order_shipping_line') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -915,6 +927,7 @@ sources: - name: order_shipping_tax_line description: Represents taxes associated with order shipping lines. + identifier: "{{ var('shopify_order_shipping_tax_line_identifier', 'order_shipping_tax_line') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -933,6 +946,7 @@ sources: - name: order_tag description: Tags that the shop owner has attached to the order. + identifier: "{{ var('shopify_order_tag_identifier', 'order_tag') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -945,6 +959,7 @@ sources: - name: order_url_tag description: Key-value tags that the shop owner has attached to the order url. + identifier: "{{ var('shopify_order_url_tag_identifier', 'order_url_tag') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -959,6 +974,7 @@ sources: description: > Table storing price rules. You can use price rules to create discounts dependent on conditions. Merchants can distribute the discount codes to their customers. Using price rules, you can create discounts that specify a discount as a percentage, a fixed amount, or free shipping. You use entitlements and prerequisites to dynamically build these discounts. + identifier: "{{ var('shopify_price_rule_identifier', 'price_rule') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1021,6 +1037,7 @@ sources: - name: product_image description: Table storing hosted images of products. + identifier: "{{ var('shopify_product_image_identifier', 'product_image') }}" columns: - name: _fivetran_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -1047,6 +1064,7 @@ sources: - name: product_tag description: Tags that the shop owner has attached to the product. + identifier: "{{ var('shopify_product_tag_identifier', 'product_tag') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1059,6 +1077,7 @@ sources: - name: shop description: The Shop resource is a collection of general business and store management settings and information about the store. + identifier: "{{ var('shopify_shop_identifier', 'shop') }}" columns: - name: _fivetran_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -1176,6 +1195,7 @@ sources: Each tender transaction represents money passing between the merchant and a customer. A tender transaction with a positive amount represents a transaction where the customer paid money to the merchant. A negative amount represents a transaction where the merchant refunded money back to the customer. Tender transactions represent transactions that modify the shop's balance. + identifier: "{{ var('shopify_tender_transaction_identifier', 'tender_transaction') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1213,6 +1233,7 @@ sources: - name: abandoned_checkout_discount_code description: Abandoned checkouts that applied a discount code. + identifier: "{{ var('shopify_abandoned_checkout_discount_code_identifier', 'abandoned_checkout_discount_code') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1235,6 +1256,7 @@ sources: - name: order_discount_code description: Discount codes placed on orders. + identifier: "{{ var('shopify_order_discount_code_identifier', 'order_discount_code') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index ee065df..9f49115 100644 --- a/models/stg_shopify__order.sql +++ b/models/stg_shopify__order.sql @@ -60,7 +60,7 @@ final as ( cast(created_at as {{ dbt.type_timestamp() }}) as created_at, currency, customer_id, - email, + lower(email) as email, financial_status, fulfillment_status, processing_method, @@ -98,7 +98,7 @@ final as ( shipping_address_province, shipping_address_province_code, shipping_address_zip, - {# test as is_test_order, #} + test as is_test_order, token, _fivetran_deleted as is_deleted, app_id, @@ -114,8 +114,8 @@ final as ( {{ fivetran_utils.fill_pass_through_columns('order_pass_through_columns') }} from fields - where not coalesce(test, false) ) select * -from final \ No newline at end of file +from final +where not coalesce(is_test_order, false) \ No newline at end of file diff --git a/models/stg_shopify__order_line.sql b/models/stg_shopify__order_line.sql index 6cbb244..39f3c8a 100644 --- a/models/stg_shopify__order_line.sql +++ b/models/stg_shopify__order_line.sql @@ -28,13 +28,12 @@ fields as ( final as ( select - + id as order_line_id, fulfillable_quantity, fulfillment_service, fulfillment_status, gift_card as is_gift_card, grams, - id as order_line_id, index, name, order_id, From 5c8ea4360287cc7b9d5494819993f88aacd5c430 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 4 Jan 2023 12:40:48 -0800 Subject: [PATCH 070/137] working branch for transform updates downstream --- models/stg_shopify.yml | 83 +++++++++++++++++++++++++++++------ models/stg_shopify__order.sql | 2 +- 2 files changed, 71 insertions(+), 14 deletions(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index b56b749..b44a482 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -482,6 +482,11 @@ models: - name: stg_shopify__abandoned_checkout description: A checkout is considered abandoned after the customer has added contact information, but before the customer has completed their purchase. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - checkout_id + - source_relation columns: - name: is_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -541,8 +546,6 @@ models: description: The payment gateway used by the checkout. - name: checkout_id description: The ID for the checkout. - tests: - - unique - not_null - name: landing_site_base_url description: The URL for the page where the customer entered the shop. @@ -620,6 +623,7 @@ models: combination_of_columns: - collection_id - product_id + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -636,6 +640,11 @@ models: description: > A collection is a grouping of products that merchants can create to make their stores easier to browse. Merchants can create collections by selecting products individually or by defining rules that automatically determine whether products are included (aka a "smart collection"). + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - collection_id + - source_relation columns: - name: is_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -649,7 +658,6 @@ models: description: The ID for the collection. tests: - not_null - - unique - name: published_at description: The time and date (ISO 8601 format) when the collection was made visible. Returns null for a hidden collection. - name: published_scope @@ -686,6 +694,7 @@ models: combination_of_columns: - customer_id - index + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -704,6 +713,11 @@ models: description: > Table storing discount codes that enable specific discounts to be redeemed. Merchants can distribute discount codes to their customers using a variety of means, such as an email or URL, and customers can apply these codes at checkout. Each discount code belongs to a price rule, which holds the logic for the discount. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - discount_code_id + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -714,7 +728,6 @@ models: - name: discount_code_id description: The ID for the discount code. tests: - - unique - not_null - name: price_rule_id description: The ID for the price rule that this discount code belongs to. @@ -727,6 +740,11 @@ models: description: > A fulfillment order represents a group of one or more items in an order that will be fulfilled from the same location. A fulfillment represents work that is completed as part of a fulfillment order and can include one or more items. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - fulfillment_id + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -736,7 +754,6 @@ models: description: The ID for the fulfillment. tests: - not_null - - unique - name: location_id description: The unique identifier of the location that the fulfillment was processed at. - name: name @@ -785,6 +802,11 @@ models: description: > An inventory item represents a physical good. It holds essential information about the physical good, including its SKU and whether its inventory is tracked. There is a 1:1 relationship between a product variant and an inventory item. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - inventory_item_id + - source_relation columns: - name: is_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -800,7 +822,6 @@ models: description: The ID of the inventory item. tests: - not_null - - unique - name: province_code_of_origin description: The province code (ISO 3166-2 alpha-2) of where the item came from. The province code is only used if the shipping provider for the inventory item is Canada Post. - name: is_shipping_required @@ -823,6 +844,7 @@ models: combination_of_columns: - inventory_item_id - location_id + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -841,6 +863,11 @@ models: - name: stg_shopify__location description: A location represents a geographical location where your stores, pop-up stores, headquarters, and warehouses exist. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - location_id + - source_relation columns: - name: _fivetran_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -866,7 +893,6 @@ models: - name: location_id description: The ID of the location. tests: - - unique - not_null - name: is_legacy description: > @@ -893,6 +919,11 @@ models: description: > Metafields are a flexible way to attach additional information to a Shopify resource (e.g. Product, Collection, etc.). Some examples of data stored using metafields include specifications, size charts, downloadable documents, release dates, images, or part numbers. Metafields are identified by an owner resource, a namespace, and a key and they store a value along with type information for that context. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - metafield_id + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -903,7 +934,6 @@ models: - name: metafield_id description: The unique ID of the metafield. tests: - - unique - not_null - name: key description: The key of the metafield. Keys can be up to 64 characters long and can contain alphanumeric characters, hyphens, underscores, and periods. @@ -927,6 +957,7 @@ models: combination_of_columns: - order_id - name + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -943,6 +974,11 @@ models: - name: stg_shopify__order_shipping_line description: Represents the shipping details that the customer chose for their order. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - order_shipping_line_id + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -959,7 +995,6 @@ models: - name: order_shipping_line_id description: A globally-unique identifier. tests: - - unique - not_null - name: order_id description: ID of the associated order. @@ -983,6 +1018,7 @@ models: combination_of_columns: - order_shipping_line_id - index + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1010,6 +1046,7 @@ models: combination_of_columns: - order_id - index + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1031,6 +1068,7 @@ models: combination_of_columns: - order_id - key + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1049,6 +1087,11 @@ models: description: > Table storing price rules. You can use price rules to create discounts dependent on conditions. Merchants can distribute the discount codes to their customers. Using price rules, you can create discounts that specify a discount as a percentage, a fixed amount, or free shipping. You use entitlements and prerequisites to dynamically build these discounts. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - price_rule_id + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1071,7 +1114,6 @@ models: - name: price_rule_id description: The ID for the price rule. tests: - - unique - not_null - name: is_once_per_customer description: Boolean representing whether the generated discount code will be valid only for a single use per customer. This is tracked using customer ID. @@ -1114,6 +1156,11 @@ models: - name: stg_shopify__product_image description: Table storing hosted images of products. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - product_image_id + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1124,7 +1171,6 @@ models: - name: product_image_id description: Unique numeric identifier of the product image. tests: - - unique - not_null - name: position description: The order of the product image in the list. The first product image is at position 1 and is the "main" image for the product. @@ -1146,6 +1192,7 @@ models: combination_of_columns: - product_id - index + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1162,6 +1209,11 @@ models: - name: stg_shopify__shop description: The Shop resource is a collection of general business and store management settings and information about the store. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - shop_id + - source_relation columns: - name: is_deleted description: "{{ doc('_fivetran_deleted') }}" @@ -1217,7 +1269,6 @@ models: description: The ID for the shop. A 64-bit unsigned integer. tests: - not_null - - unique - name: latitude description: The latitude of the shop's location. - name: longitude @@ -1276,6 +1327,11 @@ models: Each tender transaction represents money passing between the merchant and a customer. A tender transaction with a positive amount represents a transaction where the customer paid money to the merchant. A negative amount represents a transaction where the merchant refunded money back to the customer. Tender transactions represent transactions that modify the shop's balance. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - transaction_id + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1286,7 +1342,6 @@ models: - name: transaction_id description: The ID of the transaction. tests: - - unique - not_null - name: order_id description: The ID of the order that the tender transaction belongs to. @@ -1320,6 +1375,7 @@ models: - checkout_id - code - discount_id + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1347,6 +1403,7 @@ models: combination_of_columns: - order_id - code + - source_relation columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index 0c0293c..40f3e5d 100644 --- a/models/stg_shopify__order.sql +++ b/models/stg_shopify__order.sql @@ -61,7 +61,7 @@ final as ( {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_timestamp, currency, customer_id, - email, + lower(email) as email, financial_status, fulfillment_status, processing_method, From 8099bd1988d8f113f691c13192f9cf66793623f5 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 4 Jan 2023 12:50:45 -0800 Subject: [PATCH 071/137] more lowercasing --- models/stg_shopify__customer.sql | 2 +- models/stg_shopify__fulfillment.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index d36b504..5867f4b 100644 --- a/models/stg_shopify__customer.sql +++ b/models/stg_shopify__customer.sql @@ -31,7 +31,7 @@ final as ( accepts_marketing as has_accepted_marketing, email_marketing_consent_state, default_address_id, - email, + lower(email) as email, first_name, id as customer_id, last_name, diff --git a/models/stg_shopify__fulfillment.sql b/models/stg_shopify__fulfillment.sql index fd8ec61..eb2749a 100644 --- a/models/stg_shopify__fulfillment.sql +++ b/models/stg_shopify__fulfillment.sql @@ -32,7 +32,7 @@ final as ( name, service, shipment_status, - status, + lower(status) as status, tracking_company, tracking_number, tracking_numbers, From e2f5748f983ef210f3b27e89c874601c4b9d25a0 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 5 Jan 2023 16:00:28 -0800 Subject: [PATCH 072/137] order line refund work --- .../stg_shopify__order_line_refund_tmp.sql | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/models/tmp/stg_shopify__order_line_refund_tmp.sql b/models/tmp/stg_shopify__order_line_refund_tmp.sql index 3620920..6185ad6 100644 --- a/models/tmp/stg_shopify__order_line_refund_tmp.sql +++ b/models/tmp/stg_shopify__order_line_refund_tmp.sql @@ -1,6 +1,15 @@ --To disable this model, set the shopify__using_order_line_refund variable within your dbt_project.yml file to False. {{ config(enabled=var('shopify__using_order_line_refund', True)) }} +{%- set source_relation = adapter.get_relation( + database=source('shopify', 'order_line_refund').database, + schema=source('shopify', 'order_line_refund').schema, + identifier=source('shopify', 'order_line_refund').name) -%} + +{% set table_exists=source_relation is not none %} + +{% if table_exists %} + {{ fivetran_utils.union_data( table_identifier='order_line_refund', @@ -12,4 +21,22 @@ union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases' ) -}} \ No newline at end of file +}} + +{% else %} + +select + cast(null as {{ dbt.type_timestamp() }}) as _fivetran_synced, + cast(null as {{ dbt.type_numeric() }}) as id, + cast(null as {{ dbt.type_numeric() }}) as location_id, + cast(null as {{ dbt.type_numeric() }}) as order_line_id, + cast(null as {{ dbt.type_numeric() }}) as subtotal, + cast(null as {{ dbt.type_string() }}) as subtotal_set, + cast(null as {{ dbt.type_numeric() }}) as total_tax, + cast(null as {{ dbt.type_string() }}) as total_tax_set, + cast(null as {{ dbt.type_float() }}) as quantity, + cast(null as {{ dbt.type_numeric() }}) as refund_id, + cast(null as {{ dbt.type_string() }}) as restock_type, + cast(null as {{ dbt.type_string() }}) as _dbt_source_relation + +{% endif %} \ No newline at end of file From f2747185b2da8b4b41b17a24db84e17acec216b4 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 6 Jan 2023 13:57:35 -0800 Subject: [PATCH 073/137] joe feedback --- .buildkite/scripts/run_models.sh | 2 +- CHANGELOG.md | 2 ++ DECISIONLOG.md | 15 +++++++++ README.md | 16 ++-------- dbt_project.yml | 5 +-- models/stg_shopify__order_adjustment.sql | 3 +- models/stg_shopify__order_line_refund.sql | 3 +- models/stg_shopify__refund.sql | 3 +- .../tmp/stg_shopify__order_adjustment_tmp.sql | 31 +++++++++++++++++-- .../stg_shopify__order_line_refund_tmp.sql | 3 +- 10 files changed, 53 insertions(+), 30 deletions(-) create mode 100644 DECISIONLOG.md diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh index f83477d..3e08693 100644 --- a/.buildkite/scripts/run_models.sh +++ b/.buildkite/scripts/run_models.sh @@ -19,5 +19,5 @@ dbt deps dbt seed --target "$db" --full-refresh dbt run --target "$db" --full-refresh dbt test --target "$db" -dbt run --vars '{shopify__using_order_adjustment: false, shopify_timezone: "America/New_York", shopify__using_order_line_refund: false, shopify__using_refund: false}' --target "$db" --full-refresh +dbt run --vars '{shopify_timezone: "America/New_York"}' --target "$db" --full-refresh dbt test --target "$db" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 117727f..316d62f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,8 @@ [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following breaking changes: - The `is_requiring_shipping` field in `stg_shopify__order_line` has been renamed to `is_shipping_required`, just because it sounds better :) + +- TODO ## Updates: [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following changes: - By default, if the refunds table does not exist, the package will create an empty `stg_shopify__refunds` model. This can still be overwritten by setting `shopify__using_refund` to `false`. We did this because the refunds table is only created once your Shopify account has processed its first refund, and it is unnecessary overhead to have to monitor this and change your dbt_project accordingly. Thus, we took the approach of having this refund table be one that syncs as empty if it is not populated, then seamlessly switches to the source table once it exists. diff --git a/DECISIONLOG.md b/DECISIONLOG.md new file mode 100644 index 0000000..4d83a48 --- /dev/null +++ b/DECISIONLOG.md @@ -0,0 +1,15 @@ +# Decision Log + +In creating this package, which is meant for a wide range of use cases, we had to take opinionated stances on a few different questions we came across during development. We've consolidated significant choices we made here, and will continue to update as the package evolves. + +## Creating Empty Tables for Refunds, Order Line Refunds, and Order Adjustments + +Source tables related to `refunds`, `order_line_refunds`, and `order_adjustments` are created in the Shopify schema dyanmically. For example, if your shop has not incurred any refunds, you will not have a `refund` table yet until you do refund an order. + +Thus, the source package will create empty (1 row of all `NULL` fields) staging models if these source tables do not exist in your Shopify schema yet, and the transform package will work seamlessly with these empty models. Once `refund`, `order_line_refund`, or `order_adjustment` exists in your schema, the source and transform packages will automatically reference the new populated table(s). ([example](https://github.com/fivetran/dbt_shopify_source/blob/main/models/tmp/stg_shopify__refund_tmp.sql)). + +> In previous versions of the package, you had to manually enable or disable transforms of `refund`, `order_line_refund`, or `order_adjustment` through variables. Because this required you to monitor your Shopify account/schema and update the variable(s) accordingly, we decided to pursue a more automated solution. + +## Keeping Deleted Entities + +todo - not filtering out _fivetran_deleted in staging models. when joining these tables together in the transform package, bring in _fivetran_deleted as is__deleted \ No newline at end of file diff --git a/README.md b/README.md index dc60a23..0d3eb61 100644 --- a/README.md +++ b/README.md @@ -54,24 +54,12 @@ vars: shopify_union_databases: ['shopify_usa','shopify_canada'] # use this if the data is in different databases/projects but uses the same schema name ``` -## Step 4: Disable models for non-existent sources -This package was designed with the intention that users have all relevant Shopify tables being synced by Fivetran. However, if you are a Shopify user that does not operate on `returns` or `adjustments` then you will not have the related source tables. As such, you may use the below variable configurations to disable the respective downstream models. All variables are `true` by default. To disable those models, add the below configuration in your root `dbt_project.yml` file: - -```yml -# dbt_project.yml - -vars: - shopify__using_order_adjustment: false # true by default - shopify__using_order_line_refund: false # true by default - shopify__using_refund: false # true by default -``` - -> By default, if the refunds table does not exist, the package will create an empty `stg_shopify__refunds` model. This can still be overwritten by setting `shopify__using_refund` to `false`. We did this because the refunds table is only created once your Shopify account has processed its first refund, and it is unnecessary overhead to have to monitor this and change your dbt_project accordingly. Thus, we took the approach of having this refund table be one that syncs as empty if it is not populated, then seamlessly switches to the source table once it exists. +## Step 4: TODO - timezone converting, maybe should be optional ## (Optional) Step 5: Additional configurations
Expand to view configurations -### Add Passthrough Columns +### Add Passthrough Columns - todo, update with new syntax This package includes all source columns defined in the [staging_columns.sql](https://github.com/fivetran/dbt_shopify_source/blob/master/macros/staging_columns.sql) macro. To add additional columns to this package, do so using our pass-through column variables in your root `dbt_project.yml`. This is extremely useful if you'd like to include custom fields to the package. ```yml diff --git a/dbt_project.yml b/dbt_project.yml index b3876f6..4f27902 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -49,7 +49,4 @@ vars: order_pass_through_columns: [] product_pass_through_columns: [] product_variant_pass_through_columns: [] - transaction_pass_through_columns: [] - shopify__using_order_adjustment: true - shopify__using_order_line_refund: true - shopify__using_refund: true + transaction_pass_through_columns: [] \ No newline at end of file diff --git a/models/stg_shopify__order_adjustment.sql b/models/stg_shopify__order_adjustment.sql index 23ab848..e0c1fc7 100644 --- a/models/stg_shopify__order_adjustment.sql +++ b/models/stg_shopify__order_adjustment.sql @@ -1,5 +1,4 @@ ---To disable this model, set the shopify__using_order_adjustment variable within your dbt_project.yml file to False. -{{ config(enabled=var('shopify__using_order_adjustment', True)) }} +-- this model will be all NULL until you have made an order adjustment in Shopify with base as ( diff --git a/models/stg_shopify__order_line_refund.sql b/models/stg_shopify__order_line_refund.sql index 93a558b..7f5d43c 100644 --- a/models/stg_shopify__order_line_refund.sql +++ b/models/stg_shopify__order_line_refund.sql @@ -1,5 +1,4 @@ ---To disable this model, set the shopify__using_order_line_refund variable within your dbt_project.yml file to False. -{{ config(enabled=var('shopify__using_order_line_refund', True)) }} +-- this model will be all NULL until you have made an order line refund in Shopify with base as ( diff --git a/models/stg_shopify__refund.sql b/models/stg_shopify__refund.sql index 3e656da..8835a90 100644 --- a/models/stg_shopify__refund.sql +++ b/models/stg_shopify__refund.sql @@ -1,5 +1,4 @@ ---To disable this model, set the shopify__using_refund variable within your dbt_project.yml file to False. -{{ config(enabled=var('shopify__using_refund', True)) }} +-- this model will be all NULL until you have made a refund in Shopify with base as ( diff --git a/models/tmp/stg_shopify__order_adjustment_tmp.sql b/models/tmp/stg_shopify__order_adjustment_tmp.sql index bcd3782..6ac4801 100644 --- a/models/tmp/stg_shopify__order_adjustment_tmp.sql +++ b/models/tmp/stg_shopify__order_adjustment_tmp.sql @@ -1,5 +1,13 @@ ---To disable this model, set the shopify__using_order_adjustment variable within your dbt_project.yml file to False. -{{ config(enabled=var('shopify__using_order_adjustment', True)) }} +-- this model will be all NULL until you have made an order adjustment in Shopify + +{%- set source_relation = adapter.get_relation( + database=source('shopify', 'order_adjustment').database, + schema=source('shopify', 'order_adjustment').schema, + identifier=source('shopify', 'order_adjustment').name) -%} + +{% set table_exists=source_relation is not none %} + +{% if table_exists %} {{ fivetran_utils.union_data( @@ -12,4 +20,21 @@ union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases' ) -}} \ No newline at end of file +}} + +{% else %} + +select + cast(null as {{ dbt.type_timestamp() }}) as _fivetran_synced, + cast(null as {{ dbt.type_numeric() }}) as id, + cast(null as {{ dbt.type_numeric() }}) as order_id, + cast(null as {{ dbt.type_numeric() }}) as refund_id, + cast(null as {{ dbt.type_float() }}) as amount, + cast(null as {{ dbt.type_string() }}) as amount_set, + cast(null as {{ dbt.type_float() }}) as tax_amount, + cast(null as {{ dbt.type_string() }}) as tax_amount_set, + cast(null as {{ dbt.type_string() }}) as kind, + cast(null as {{ dbt.type_string() }}) as reason, + cast(null as {{ dbt.type_string() }}) as _dbt_source_relation + +{% endif %} \ No newline at end of file diff --git a/models/tmp/stg_shopify__order_line_refund_tmp.sql b/models/tmp/stg_shopify__order_line_refund_tmp.sql index 6185ad6..188bb1f 100644 --- a/models/tmp/stg_shopify__order_line_refund_tmp.sql +++ b/models/tmp/stg_shopify__order_line_refund_tmp.sql @@ -1,5 +1,4 @@ ---To disable this model, set the shopify__using_order_line_refund variable within your dbt_project.yml file to False. -{{ config(enabled=var('shopify__using_order_line_refund', True)) }} +-- this model will be all NULL until you have made an order line refund in Shopify {%- set source_relation = adapter.get_relation( database=source('shopify', 'order_line_refund').database, From be87671f477cddc43e1b038696c6f8d0c5f81778 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:06:03 -0800 Subject: [PATCH 074/137] adding new table and work from other branches --- dbt_project.yml | 1 + integration_tests/dbt_project.yml | 1 + ..._abandoned_checkout_shipping_line_data.csv | 6 ++ ...andoned_checkout_shipping_line_columns.sql | 32 +++++++++++ models/src_shopify.yml | 5 +- ...pify__abandoned_checkout_shipping_line.sql | 56 +++++++++++++++++++ models/stg_shopify__customer.sql | 18 ++++-- models/stg_shopify__order.sql | 6 +- models/stg_shopify__order_line.sql | 9 ++- ...__abandoned_checkout_shipping_line_tmp.sql | 12 ++++ 10 files changed, 131 insertions(+), 15 deletions(-) create mode 100644 integration_tests/seeds/shopify_abandoned_checkout_shipping_line_data.csv create mode 100644 macros/get_abandoned_checkout_shipping_line_columns.sql create mode 100644 models/stg_shopify__abandoned_checkout_shipping_line.sql create mode 100644 models/tmp/stg_shopify__abandoned_checkout_shipping_line_tmp.sql diff --git a/dbt_project.yml b/dbt_project.yml index 4f27902..54a3cf4 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -42,6 +42,7 @@ vars: tender_transaction_source: "{{ source('shopify','tender_transaction') }}" abandoned_checkout_discount_code_source: "{{ source('shopify','abandoned_checkout_discount_code') }}" order_discount_code_source: "{{ source('shopify','order_discount_code') }}" + abandoned_checkout_shipping_line_source: "{{ source('shopify', 'abandoned_checkout_shipping_line') }}" customer_pass_through_columns: [] order_line_refund_pass_through_columns: [] diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 4df4786..a61317a 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -38,6 +38,7 @@ vars: tender_transaction_source: "{{ ref('shopify_tender_transaction_data') }}" abandoned_checkout_discount_code_source: "{{ ref('shopify_abandoned_checkout_discount_code_data') }}" order_discount_code_source: "{{ ref('shopify_order_discount_code_data') }}" + abandoned_checkout_shipping_line_source: "{{ ref('shopify_abandoned_checkout_shipping_line_data') }}" dispatch: - macro_namespace: dbt_utils diff --git a/integration_tests/seeds/shopify_abandoned_checkout_shipping_line_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_shipping_line_data.csv new file mode 100644 index 0000000..2d83f40 --- /dev/null +++ b/integration_tests/seeds/shopify_abandoned_checkout_shipping_line_data.csv @@ -0,0 +1,6 @@ +checkout_id,index,_fivetran_synced,api_client_id,carrier_identifier,carrier_service_id,code,delivery_category,discounted_price,id,markup,phone,price,requested_fulfillment_service_id,source,title,validation_context,delivery_expectation_range,delivery_expectation_type,original_shop_markup,original_shop_price,presentment_title,delivery_expectation_range_min,delivery_expectation_range_max +24587125653675,1,2023-01-09 06:48:18.093000 UTC,,,,Standard,,,c3ce0972c2ed226895b730eaf7001bea,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, +24589347422379,1,2023-01-09 06:48:23.540000 UTC,,,,Standard,,,bf7c909533bdce55017ed4df44902c13,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, +24589643710635,1,2023-01-09 06:48:24.243000 UTC,,,,Standard,,,519ff4275cd972eb26229aaaa4e282db,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, +24586978263211,1,2023-01-09 06:48:18.068000 UTC,,,,Standard,,,8d18671d4862fe463de583f05e1ad46a,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, +24586830381227,1,2023-01-09 06:48:16.985000 UTC,,,,Standard,,,8f2fa35a848caf61a85b1b455ec9e597,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, \ No newline at end of file diff --git a/macros/get_abandoned_checkout_shipping_line_columns.sql b/macros/get_abandoned_checkout_shipping_line_columns.sql new file mode 100644 index 0000000..5b572a2 --- /dev/null +++ b/macros/get_abandoned_checkout_shipping_line_columns.sql @@ -0,0 +1,32 @@ +{% macro get_abandoned_checkout_shipping_line_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "api_client_id", "datatype": dbt.type_int()}, + {"name": "carrier_identifier", "datatype": dbt.type_string()}, + {"name": "carrier_service_id", "datatype": dbt.type_int()}, + {"name": "checkout_id", "datatype": dbt.type_int()}, + {"name": "code", "datatype": dbt.type_string()}, + {"name": "delivery_category", "datatype": dbt.type_string()}, + {"name": "delivery_expectation_range", "datatype": dbt.type_string()}, + {"name": "delivery_expectation_range_max", "datatype": dbt.type_int()}, + {"name": "delivery_expectation_range_min", "datatype": dbt.type_int()}, + {"name": "delivery_expectation_type", "datatype": dbt.type_string()}, + {"name": "discounted_price", "datatype": dbt.type_float()}, + {"name": "id", "datatype": dbt.type_string()}, + {"name": "index", "datatype": dbt.type_int()}, + {"name": "markup", "datatype": dbt.type_float()}, + {"name": "original_shop_markup", "datatype": dbt.type_string()}, + {"name": "original_shop_price", "datatype": dbt.type_string()}, + {"name": "phone", "datatype": dbt.type_string()}, + {"name": "presentment_title", "datatype": dbt.type_string()}, + {"name": "price", "datatype": dbt.type_float()}, + {"name": "requested_fulfillment_service_id", "datatype": dbt.type_string()}, + {"name": "source", "datatype": dbt.type_string()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "validation_context", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 7ab0171..a84c78b 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -1214,4 +1214,7 @@ sources: - name: order_id description: Associated order ID. - name: type - description: The type of discount - `fixed_amount`, `percentage`, or `shipping`. \ No newline at end of file + description: The type of discount - `fixed_amount`, `percentage`, or `shipping`. + + - name: abandoned_checkout_shipping_line + description: Shipping lines associated with abandoned checkouts. \ No newline at end of file diff --git a/models/stg_shopify__abandoned_checkout_shipping_line.sql b/models/stg_shopify__abandoned_checkout_shipping_line.sql new file mode 100644 index 0000000..e748cfe --- /dev/null +++ b/models/stg_shopify__abandoned_checkout_shipping_line.sql @@ -0,0 +1,56 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__abandoned_checkout_shipping_line_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__abandoned_checkout_shipping_line_tmp')), + staging_columns=get_abandoned_checkout_shipping_line_columns() + ) + }} + from base +), + +final as ( + + select +20:31:45 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 2 unused configuration paths: +- models.netsuite +- models.ad_reporting + +20:31:48 _fivetran_synced, + api_client_id, + carrier_identifier, + carrier_service_id, + checkout_id, + code, + delivery_category, + delivery_expectation_range, + delivery_expectation_range_max, + delivery_expectation_range_min, + delivery_expectation_type, + discounted_price, + id, + index, + markup, + original_shop_markup, + original_shop_price, + phone, + presentment_title, + price, + requested_fulfillment_service_id, + source, + title, + validation_context + from fields +) + +select * +from final diff --git a/models/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index 5867f4b..4253723 100644 --- a/models/stg_shopify__customer.sql +++ b/models/stg_shopify__customer.sql @@ -28,12 +28,10 @@ fields as ( final as ( select - accepts_marketing as has_accepted_marketing, - email_marketing_consent_state, - default_address_id, + id as customer_id, lower(email) as email, + default_address_id, first_name, - id as customer_id, last_name, orders_count, phone, @@ -42,11 +40,19 @@ final as ( total_spent, verified_email as is_verified_email, note, - coalesce(marketing_opt_in_level, email_marketing_consent_opt_in_level) as marketing_opt_in_level, lifetime_duration, currency, + case + when email_marketing_consent_state is null then + case + when accepts_marketing is null then null + when accepts_marketing then 'subscribed (legacy)' + else 'not_subscribed (legacy)' end + else lower(email_marketing_consent_state) end as marketing_consent_state, + lower(coalesce(email_marketing_consent_opt_in_level, marketing_opt_in_level)) as marketing_opt_in_level, + + {{ dbt_date.convert_timezone(column='cast(coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as marketing_consent_updated_at, {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_timestamp, - {{ dbt_date.convert_timezone(column='cast(coalesce(accepts_marketing_updated_at, email_marketing_consent_consent_updated_at) as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as accepts_marketing_updated_at, {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_timestamp, {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index 40f3e5d..c9f48ca 100644 --- a/models/stg_shopify__order.sql +++ b/models/stg_shopify__order.sql @@ -106,7 +106,7 @@ final as ( device_id, order_status_url, presentment_currency, - {# test as is_test_order, #} + test as is_test_order, _fivetran_deleted as is_deleted, buyer_accepts_marketing as has_buyer_accepted_marketing, confirmed as is_confirmed, @@ -116,8 +116,8 @@ final as ( {{ fivetran_utils.fill_pass_through_columns('order_pass_through_columns') }} from fields - where not coalesce(test, false) ) select * -from final \ No newline at end of file +from final +where not coalesce(is_test_order, false) \ No newline at end of file diff --git a/models/stg_shopify__order_line.sql b/models/stg_shopify__order_line.sql index 3c56784..18642e3 100644 --- a/models/stg_shopify__order_line.sql +++ b/models/stg_shopify__order_line.sql @@ -28,16 +28,15 @@ fields as ( final as ( select - + id as order_line_id, + index, + name, + order_id, fulfillable_quantity, fulfillment_service, fulfillment_status, gift_card as is_gift_card, grams, - id as order_line_id, - index, - name, - order_id, pre_tax_price, pre_tax_price_set, price, diff --git a/models/tmp/stg_shopify__abandoned_checkout_shipping_line_tmp.sql b/models/tmp/stg_shopify__abandoned_checkout_shipping_line_tmp.sql new file mode 100644 index 0000000..b7b7e7b --- /dev/null +++ b/models/tmp/stg_shopify__abandoned_checkout_shipping_line_tmp.sql @@ -0,0 +1,12 @@ +{{ + fivetran_utils.union_data( + table_identifier='abandoned_checkout_shipping_line', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='abandoned_checkout_shipping_line_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file From 2e026972112f32faf00469e578e15eb76a92dfdc Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:14:02 -0800 Subject: [PATCH 075/137] buildkite --- .../shopify_abandoned_checkout_shipping_line_data.csv | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/integration_tests/seeds/shopify_abandoned_checkout_shipping_line_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_shipping_line_data.csv index 2d83f40..62181c4 100644 --- a/integration_tests/seeds/shopify_abandoned_checkout_shipping_line_data.csv +++ b/integration_tests/seeds/shopify_abandoned_checkout_shipping_line_data.csv @@ -1,6 +1,6 @@ checkout_id,index,_fivetran_synced,api_client_id,carrier_identifier,carrier_service_id,code,delivery_category,discounted_price,id,markup,phone,price,requested_fulfillment_service_id,source,title,validation_context,delivery_expectation_range,delivery_expectation_type,original_shop_markup,original_shop_price,presentment_title,delivery_expectation_range_min,delivery_expectation_range_max -24587125653675,1,2023-01-09 06:48:18.093000 UTC,,,,Standard,,,c3ce0972c2ed226895b730eaf7001bea,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, -24589347422379,1,2023-01-09 06:48:23.540000 UTC,,,,Standard,,,bf7c909533bdce55017ed4df44902c13,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, -24589643710635,1,2023-01-09 06:48:24.243000 UTC,,,,Standard,,,519ff4275cd972eb26229aaaa4e282db,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, -24586978263211,1,2023-01-09 06:48:18.068000 UTC,,,,Standard,,,8d18671d4862fe463de583f05e1ad46a,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, -24586830381227,1,2023-01-09 06:48:16.985000 UTC,,,,Standard,,,8f2fa35a848caf61a85b1b455ec9e597,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, \ No newline at end of file +653675,1,2023-01-09 06:48:18.093000,,,,Standard,,,c3ce0972c2e30eaf7001bea,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, +379,1,2023-01-09 06:48:23.540000,,,,Standard,,,bf7c90953344902c13,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, +635,1,2023-01-09 06:48:24.243000,,,,Standard,,,519ff4275cd972e282db,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, +3211,1,2023-01-09 06:48:18.068000,,,,Standard,,,8d18671d481ad46a,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, +381227,1,2023-01-09 06:48:16.985000,,,,Standard,,,8f2fab1b455ec9e597,0.0,,0.0,,shopify,Standard,,,,0.0,0.0,Standard,, \ No newline at end of file From 17ac3b64b3ed4bd3f15d646ec6942b13246ea73c Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:25:25 -0800 Subject: [PATCH 076/137] buildkite try 2 --- integration_tests/dbt_project.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 06f5873..c920f44 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,6 +4,7 @@ profile: 'integration_tests' config-version: 2 vars: + shopify_schema: shopify_source_integration_tests_2 shopify_source: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" From 4b70ff08b6094787283a6d35b323a671d188eddf Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:35:05 -0800 Subject: [PATCH 077/137] buildkite' --- ...g_shopify__abandoned_checkout_shipping_line.sql | 14 ++++++++------ models/stg_shopify__customer.sql | 5 ----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/models/stg_shopify__abandoned_checkout_shipping_line.sql b/models/stg_shopify__abandoned_checkout_shipping_line.sql index 98804f6..6ce0d25 100644 --- a/models/stg_shopify__abandoned_checkout_shipping_line.sql +++ b/models/stg_shopify__abandoned_checkout_shipping_line.sql @@ -20,20 +20,19 @@ fields as ( final as ( select - _fivetran_synced, + id as abandoned_checkout_shipping_line_id, + checkout_id, + index, api_client_id, carrier_identifier, carrier_service_id, - checkout_id, - code, + code as shipping_code, delivery_category, delivery_expectation_range, delivery_expectation_range_max, delivery_expectation_range_min, delivery_expectation_type, discounted_price, - id, - index, markup, original_shop_markup, original_shop_price, @@ -43,7 +42,10 @@ final as ( requested_fulfillment_service_id, source, title, - validation_context + validation_context, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, + source_relation + from fields ) diff --git a/models/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index 9b713bc..a5d169d 100644 --- a/models/stg_shopify__customer.sql +++ b/models/stg_shopify__customer.sql @@ -29,12 +29,7 @@ final as ( select id as customer_id, -<<<<<<< HEAD lower(email) as email, - default_address_id, -======= - email, ->>>>>>> d1c1f494e9fe77be75bdaf29bde38582d57302c3 first_name, last_name, orders_count, From 7a7f60ad48918db2722811d3bd8fe9e3f20b90fa Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 9 Jan 2023 15:52:05 -0800 Subject: [PATCH 078/137] working --- models/src_shopify.yml | 2 +- models/stg_shopify__abandoned_checkout_discount_code.sql | 2 +- models/stg_shopify__abandoned_checkout_shipping_line.sql | 6 ++++++ models/stg_shopify__discount_code.sql | 2 +- models/stg_shopify__order_discount_code.sql | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 50979c9..96531f4 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -1270,5 +1270,5 @@ sources: description: The type of discount - `fixed_amount`, `percentage`, or `shipping`. - name: abandoned_checkout_shipping_line - description: Shipping lines associated with abandoned checkouts. + description: Shipping lines associated with abandoned checkouts. TODO identifier: "{{ var('shopify_abandoned_checkout_shipping_line_identifier', 'abandoned_checkout_shipping_line') }}" \ No newline at end of file diff --git a/models/stg_shopify__abandoned_checkout_discount_code.sql b/models/stg_shopify__abandoned_checkout_discount_code.sql index 7eb4482..8b32827 100644 --- a/models/stg_shopify__abandoned_checkout_discount_code.sql +++ b/models/stg_shopify__abandoned_checkout_discount_code.sql @@ -28,7 +28,7 @@ final as ( select checkout_id, - code, + upper(code) as code, discount_id, amount, type, diff --git a/models/stg_shopify__abandoned_checkout_shipping_line.sql b/models/stg_shopify__abandoned_checkout_shipping_line.sql index 6ce0d25..dd559db 100644 --- a/models/stg_shopify__abandoned_checkout_shipping_line.sql +++ b/models/stg_shopify__abandoned_checkout_shipping_line.sql @@ -14,6 +14,12 @@ fields as ( staging_columns=get_abandoned_checkout_shipping_line_columns() ) }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + from base ), diff --git a/models/stg_shopify__discount_code.sql b/models/stg_shopify__discount_code.sql index af2205b..fa33d0f 100644 --- a/models/stg_shopify__discount_code.sql +++ b/models/stg_shopify__discount_code.sql @@ -27,7 +27,7 @@ final as ( select id as discount_code_id, - code, + upper(code) as code, price_rule_id, usage_count, {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, diff --git a/models/stg_shopify__order_discount_code.sql b/models/stg_shopify__order_discount_code.sql index 325e79f..851f3ba 100644 --- a/models/stg_shopify__order_discount_code.sql +++ b/models/stg_shopify__order_discount_code.sql @@ -27,7 +27,7 @@ final as ( select order_id, - code, + upper(code) as code, type, amount, {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, From 4f403a3f3a0a909e02b0083561f786468392e64b Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 10 Jan 2023 13:50:03 -0800 Subject: [PATCH 079/137] buildkite seeds --- integration_tests/dbt_project.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index c920f44..e42b44b 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -155,4 +155,10 @@ seeds: shopify_inventory_item_data: +column_types: updated_at: timestamp - created_at: timestamp \ No newline at end of file + created_at: timestamp + shopify_abandoned_checkout_shipping_line_data: + +column_types: + markup: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" + price: float + original_shop_markup: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" + original_shop_price: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" \ No newline at end of file From 1752768efe575f0bb49e4af4e9a8ecfd1ee502fa Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 11 Jan 2023 11:36:10 -0800 Subject: [PATCH 080/137] addeded discount code does_table_exist logic --- ...pify__abandoned_checkout_discount_code.sql | 1 - models/stg_shopify__discount_code.sql | 1 + models/tmp/stg_shopify__discount_code_tmp.sql | 27 ++++++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/models/stg_shopify__abandoned_checkout_discount_code.sql b/models/stg_shopify__abandoned_checkout_discount_code.sql index 8b32827..38aff52 100644 --- a/models/stg_shopify__abandoned_checkout_discount_code.sql +++ b/models/stg_shopify__abandoned_checkout_discount_code.sql @@ -1,4 +1,3 @@ - with base as ( select * diff --git a/models/stg_shopify__discount_code.sql b/models/stg_shopify__discount_code.sql index fa33d0f..f464046 100644 --- a/models/stg_shopify__discount_code.sql +++ b/models/stg_shopify__discount_code.sql @@ -1,3 +1,4 @@ +-- this model will be all NULL until you create a discount code in Shopify with base as ( diff --git a/models/tmp/stg_shopify__discount_code_tmp.sql b/models/tmp/stg_shopify__discount_code_tmp.sql index d59b6af..eba47d3 100644 --- a/models/tmp/stg_shopify__discount_code_tmp.sql +++ b/models/tmp/stg_shopify__discount_code_tmp.sql @@ -1,3 +1,14 @@ +-- this model will be all NULL until you create a discount code in Shopify + +{%- set source_relation = adapter.get_relation( + database=source('shopify', 'discount_code').database, + schema=source('shopify', 'discount_code').schema, + identifier=source('shopify', 'discount_code').name) -%} + +{% set table_exists=source_relation is not none %} + +{% if table_exists %} + {{ fivetran_utils.union_data( table_identifier='discount_code', @@ -9,4 +20,18 @@ union_schema_variable='shopify_union_schemas', union_database_variable='shopify_union_databases' ) -}} \ No newline at end of file +}} + +{% else %} + +select + cast(null as {{ dbt.type_timestamp() }}) as _fivetran_synced, + cast(null as {{ dbt.type_string() }}) as code, + cast(null as {{ dbt.type_timestamp() }}) as created_at, + cast(null as {{ dbt.type_int() }}) as id, + cast(null as {{ dbt.type_int() }}) as price_rule_id, + cast(null as {{ dbt.type_timestamp() }}) as updated_at, + cast(null as {{ dbt.type_float() }}) as usage_count, + cast(null as {{ dbt.type_string() }}) as _dbt_source_relation + +{% endif %} \ No newline at end of file From 5c636903701af64aabbde06a435798f39da2e9e3 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 11 Jan 2023 12:14:30 -0800 Subject: [PATCH 081/137] updated passthrough column docs --- README.md | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0d3eb61..e2705a2 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,15 @@ To use this dbt package, you must have the following: - At least one Fivetran Shopify connector syncing data into your destination. - A **BigQuery**, **Snowflake**, **Redshift**, **Databricks**, or **PostgreSQL** destination. -## Step 2: Install the package -Include the following shopify_source package version in your `packages.yml` file. +## Step 2: Install the package (skip if also using the `dbt_shopify` package) +If you are **not** using the [Shopify transformation package](https://github.com/fivetran/dbt_shopify), include the following package version in your `packages.yml` file. If you are installing the transform package, the source package is automatically installed as a dependency. > TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages. ```yml packages: - package: fivetran/shopify_source version: [">=0.7.0", "<0.8.0"] ``` + ## Step 3: Define database and schema variables ### Single connector By default, this package runs using your destination and the `shopify` schema. If this is not where your Shopify data is (for example, if your Shopify schema is named `shopify_fivetran` and your `issue` table is named `usa_issue`), add the following configuration to your root `dbt_project.yml` file: @@ -59,20 +60,31 @@ vars: ## (Optional) Step 5: Additional configurations
Expand to view configurations -### Add Passthrough Columns - todo, update with new syntax -This package includes all source columns defined in the [staging_columns.sql](https://github.com/fivetran/dbt_shopify_source/blob/master/macros/staging_columns.sql) macro. To add additional columns to this package, do so using our pass-through column variables in your root `dbt_project.yml`. This is extremely useful if you'd like to include custom fields to the package. +### Passing Through Additional Fields +This package includes all source columns defined in the macros folder. You can add more columns using our pass-through column variables. These variables allow for the pass-through fields to be aliased (`alias`) and casted (`transform_sql`) if desired, but not required. Datatype casting is configured via a sql snippet within the `transform_sql` key. You may add the desired sql while omitting the `as field_name` at the end and your custom pass-though fields will be casted accordingly. Use the below format for declaring the respective pass-through variables: ```yml # dbt_project.yml vars: shopify_source: - customer_pass_through_columns: [] - order_line_refund_pass_through_columns: [] - order_line_pass_through_columns: [] - order_pass_through_columns: [] - product_pass_through_columns: [] - product_variant_pass_through_columns: [] + customer_pass_through_columns: + - name: "customer_custom_field" + alias: "customer_field" + order_line_refund_pass_through_columns: + - name: "unique_string_field" + alias: "field_id" + transform_sql: "cast(field_id as string)" + order_line_pass_through_columns: + - name: "that_field" + order_pass_through_columns: + - name: "sub_field" + alias: "subsidiary_field" + product_pass_through_columns: + - name: "this_field" + product_variant_pass_through_columns: + - name: "new_custom_field" + alias: "custom_field" ``` ### Changing the Build Schema From bd3e29a7accbd02bb2225b6f82997198bbb5a7bd Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 11 Jan 2023 14:17:00 -0800 Subject: [PATCH 082/137] joe feedback --- models/stg_shopify.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index a7f537c..981fd36 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -818,6 +818,9 @@ models: - cancelled: The fulfillment was cancelled. - error: There was an error with the fulfillment request. - failure: The fulfillment request failed. + tests: + - accepted_values: + values: ['pending', 'open', 'success', 'cancelled', 'error', 'failure'] - name: tracking_company description: The name of the tracking company. - name: tracking_number @@ -1168,6 +1171,9 @@ models: `entitled` (the price rule applies the discount to selected entitlements only). - name: target_type description: The target type that the price rule applies to. Valid values include `line_item` (the price rule applies to the cart's line items) and `shipping_line` (the price rule applies to the cart's shipping lines). + tests: + - accepted_values: + values: ['line_item', 'shipping_line'] - name: title description: > The title of the price rule. This is used by the Shopify admin search to retrieve discounts. It is also displayed on the Discounts page of the Shopify admin for bulk discounts. @@ -1184,6 +1190,9 @@ models: and `percentage` (applies a percentage discount of value. For example, if value is -30, then 30% will be deducted when the discount is applied). If `target_type` is `shipping_line`, then only `percentage` is accepted. + tests: + - accepted_values: + values: ['percentage', 'fixed_amount'] - name: stg_shopify__product_image description: Table storing hosted images of products. From 6279e4991cc6a06d9615bad759777f36dfc4947e Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 11 Jan 2023 14:51:27 -0800 Subject: [PATCH 083/137] test severtiy --- models/stg_shopify.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 981fd36..6ec39c1 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -821,6 +821,8 @@ models: tests: - accepted_values: values: ['pending', 'open', 'success', 'cancelled', 'error', 'failure'] + config: + severity: warn # we pivot these out in shopify__inventory_levels - name: tracking_company description: The name of the tracking company. - name: tracking_number @@ -1174,6 +1176,8 @@ models: tests: - accepted_values: values: ['line_item', 'shipping_line'] + config: + severity: warn # we use these in a JOIN condition in shopify__discounts - name: title description: > The title of the price rule. This is used by the Shopify admin search to retrieve discounts. It is also displayed on the Discounts page of the Shopify admin for bulk discounts. From 7d548c9c1d0ad132f84e4d00978d69f4bf2cef71 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 11 Jan 2023 15:02:11 -0800 Subject: [PATCH 084/137] test severity and note --- DECISIONLOG.md | 11 ++++++++++- models/stg_shopify.yml | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/DECISIONLOG.md b/DECISIONLOG.md index 4d83a48..dc9257c 100644 --- a/DECISIONLOG.md +++ b/DECISIONLOG.md @@ -12,4 +12,13 @@ Thus, the source package will create empty (1 row of all `NULL` fields) staging ## Keeping Deleted Entities -todo - not filtering out _fivetran_deleted in staging models. when joining these tables together in the transform package, bring in _fivetran_deleted as is__deleted \ No newline at end of file +todo - not filtering out _fivetran_deleted in staging models. when joining these tables together in the transform package, bring in _fivetran_deleted as is__deleted + +## Accepted Value Test Severity + +We test the following columns for accepted values because their values are hard-coded to be pivoted out into columns and/or used as `JOIN` conditions in downstream models. +- `stg_shopify__price_rule.target_type`: accepted values are `line_item`, `shipping_line` +- `stg_shopify__price_rule.value_type`: accepted values are `percentage`, `fixed_amount` +- `stg_shopify__fulfillment.status`: accepted values are `pending`, `open`, `success`, `cancelled`, `error`, `failure` + +We have chosen to make the severity of these tests `warn`, as non-accepted values will be filtered out in the transformation models. They will not introduce erroneous data. \ No newline at end of file diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 6ec39c1..0a05364 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -1197,6 +1197,8 @@ models: tests: - accepted_values: values: ['percentage', 'fixed_amount'] + config: + severity: warn # we use these in a JOIN condition in shopify__discounts - name: stg_shopify__product_image description: Table storing hosted images of products. From 0159616b8c5c9180f99a16bb54ffe0b65789ec66 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 11 Jan 2023 16:35:26 -0800 Subject: [PATCH 085/137] docs --- CHANGELOG.md | 68 ++++++++++--------- ...andoned_checkout_shipping_line_columns.sql | 9 +-- models/src_shopify.yml | 41 ++++++++++- models/stg_shopify.yml | 47 ++++++++++++- ...pify__abandoned_checkout_shipping_line.sql | 7 -- 5 files changed, 123 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 535ff32..b789600 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,41 +2,47 @@ ## 🎉 Documentation and Feature Updates - Updated README documentation updates for easier navigation and setup of the dbt package - Included `shopify_[source_table_name]_identifier` variable for additional flexibility within the package when source tables are named differently. -- The following fields have been added to their respective staging models: +- The following fields have been added to (➕) or removed from (➖) their respective staging models: - `stg_shopify__order`: - - `total_discounts_set` - - `total_line_items_price_set` - - `total_price_usd` - - `total_price_set` - - `total_tax_set` - - `total_tip_received` - - `is_deleted` - - `app_id` - - `checkout_id` - - `client_details_user_agent` - - `customer_locale` - - `order_status_url` - - `presentment_currency` - - `is_inventory_confirmed` + - ➕ `total_discounts_set` + - ➕ `total_line_items_price_set` + - ➕ `total_price_usd` + - ➕ `total_price_set` + - ➕ `total_tax_set` + - ➕ `total_tip_received` + - ➕ `is_deleted` + - ➕ `app_id` + - ➕ `checkout_id` + - ➕ `client_details_user_agent` + - ➕ `customer_locale` + - ➕ `order_status_url` + - ➕ `presentment_currency` + - ➕ `is_inventory_confirmed` - `stg_shopify__customer`: - - `note` - - `lifetime_duration` - - `currency` - - `marketing_consent_state` (coalescing of `email_marketing_consent_state` and deprecated `accepts_marketing` field) - - `marketing_opt_in_level` (coalescing of `email_marketing_consent_opt_in_level` and deprecated `marketing_opt_in_level` field) - - `marketing_consent_updated_at` (coalescing of `email_marketing_consent_consent_updated_at` and deprecated `accepts_marketing_updated_at` field) + - ➕ `note` + - ➕ `lifetime_duration` + - ➕ `currency` + - ➕ `marketing_consent_state` (coalescing of `email_marketing_consent_state` and deprecated `accepts_marketing` field) + - ➕ `marketing_opt_in_level` (coalescing of `email_marketing_consent_opt_in_level` and deprecated `marketing_opt_in_level` field) + - ➕ `marketing_consent_updated_at` (coalescing of `email_marketing_consent_consent_updated_at` and deprecated `accepts_marketing_updated_at` field) + - ➖ `accepts_marketing`/`has_accepted_marketing` + - ➖ `accepts_marketing_updated_at` + - ➖ `marketing_opt_in_level` - `stg_shopify__order_line_refund`: - - `subtotal_set` - - `total_tax_set` + - ➕ `subtotal_set` + - ➕ `total_tax_set` - `stg_shopify__order_line`: - - `pre_tax_price_set` - - `price_set` - - `tax_code` - - `total_discount_set` - - `variant_title` - - `variant_inventory_management` - - `vendor` - - `properties` + - ➕ `pre_tax_price_set` + - ➕ `price_set` + - ➕ `tax_code` + - ➕ `total_discount_set` + - ➕ `variant_title` + - ➕ `variant_inventory_management` + - ➕ `properties` + - `stg_shopify__product`: + - ➕ `status` + - `stg_shopify__product_variant` + - ➖ `old_inventory_quantity` ## 🚨 Breaking Changes 🚨: [PR #36](https://github.com/fivetran/dbt_shopify_source/pull/36) includes the following breaking changes: diff --git a/macros/get_abandoned_checkout_shipping_line_columns.sql b/macros/get_abandoned_checkout_shipping_line_columns.sql index 5b572a2..25764d2 100644 --- a/macros/get_abandoned_checkout_shipping_line_columns.sql +++ b/macros/get_abandoned_checkout_shipping_line_columns.sql @@ -2,9 +2,7 @@ {% set columns = [ {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, - {"name": "api_client_id", "datatype": dbt.type_int()}, {"name": "carrier_identifier", "datatype": dbt.type_string()}, - {"name": "carrier_service_id", "datatype": dbt.type_int()}, {"name": "checkout_id", "datatype": dbt.type_int()}, {"name": "code", "datatype": dbt.type_string()}, {"name": "delivery_category", "datatype": dbt.type_string()}, @@ -15,16 +13,11 @@ {"name": "discounted_price", "datatype": dbt.type_float()}, {"name": "id", "datatype": dbt.type_string()}, {"name": "index", "datatype": dbt.type_int()}, - {"name": "markup", "datatype": dbt.type_float()}, - {"name": "original_shop_markup", "datatype": dbt.type_string()}, - {"name": "original_shop_price", "datatype": dbt.type_string()}, {"name": "phone", "datatype": dbt.type_string()}, - {"name": "presentment_title", "datatype": dbt.type_string()}, {"name": "price", "datatype": dbt.type_float()}, {"name": "requested_fulfillment_service_id", "datatype": dbt.type_string()}, {"name": "source", "datatype": dbt.type_string()}, - {"name": "title", "datatype": dbt.type_string()}, - {"name": "validation_context", "datatype": dbt.type_string()} + {"name": "title", "datatype": dbt.type_string()} ] %} {{ return(columns) }} diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 96531f4..ab86aac 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -1270,5 +1270,42 @@ sources: description: The type of discount - `fixed_amount`, `percentage`, or `shipping`. - name: abandoned_checkout_shipping_line - description: Shipping lines associated with abandoned checkouts. TODO - identifier: "{{ var('shopify_abandoned_checkout_shipping_line_identifier', 'abandoned_checkout_shipping_line') }}" \ No newline at end of file + description: Shipping lines associated with abandoned checkouts. + identifier: "{{ var('shopify_abandoned_checkout_shipping_line_identifier', 'abandoned_checkout_shipping_line') }}" + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: carrier_identifier + description: A reference to the carrier service that provided the rate. Present when the rate was computed by a third-party carrier service. + - name: checkout_id + description: ID of the checkout that was abandoned. + - name: code + description: A reference to the shipping method. + - name: delivery_category + description: The general classification of the delivery method. + - name: delivery_expectation_range + description: Expected delivery date range. + - name: delivery_expectation_range_max + description: Latest expected delivery date. + - name: delivery_expectation_range_min + description: Earliest possible expected delivery date. + - name: delivery_expectation_type + description: Type of expected delivery. + - name: discounted_price + description: The pre-tax shipping price with discounts applied. + - name: id + description: Unique ID of the abandoned checkout shipping line. + - name: index + description: Index of the line amongst shipping lines for this checkout. + - name: original_shop_price + description: The pre-tax shipping price without any discounts applied. + - name: phone + description: The phone number at the shipping address. + - name: price + description: The price of the shipping method in presentment currency. + - name: requested_fulfillment_service_id + description: The fulfillment service requested for the shipping method. Present if the shipping method requires processing by a third party fulfillment service. + - name: source + description: The channel where the checkout originated. Example value - shopify. + - name: title + description: The title of the shipping method. Example value - International Shipping. \ No newline at end of file diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 0a05364..71d7c18 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -1464,4 +1464,49 @@ models: tests: - not_null - name: type - description: The type of discount - `fixed_amount`, `percentage`, or `shipping`. \ No newline at end of file + description: The type of discount - `fixed_amount`, `percentage`, or `shipping`. + + - name: stg_shopify__abandoned_checkout_shipping_line + description: Shipping lines associated with abandoned checkouts. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - abandoned_checkout_shipping_line_id + - source_relation + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: carrier_identifier + description: A reference to the carrier service that provided the rate. Present when the rate was computed by a third-party carrier service. + - name: checkout_id + description: ID of the checkout that was abandoned. + - name: shipping_code + description: A reference to the shipping method. + - name: delivery_category + description: The general classification of the delivery method. + - name: delivery_expectation_range + description: Expected delivery date range. + - name: delivery_expectation_range_max + description: Latest expected delivery date. + - name: delivery_expectation_range_min + description: Earliest possible expected delivery date. + - name: delivery_expectation_type + description: Type of expected delivery. + - name: discounted_price + description: The pre-tax shipping price with discounts applied. + - name: abandoned_checkout_shipping_line_id + description: Unique ID of the abandoned checkout shipping line. + - name: index + description: Index of the line amongst shipping lines for this checkout. + - name: original_shop_price + description: The pre-tax shipping price without any discounts applied. + - name: phone + description: The phone number at the shipping address. + - name: price + description: The price of the shipping method in presentment currency. + - name: requested_fulfillment_service_id + description: The fulfillment service requested for the shipping method. Present if the shipping method requires processing by a third party fulfillment service. + - name: source + description: The channel where the checkout originated. Example value - shopify. + - name: title + description: The title of the shipping method. Example value - International Shipping. \ No newline at end of file diff --git a/models/stg_shopify__abandoned_checkout_shipping_line.sql b/models/stg_shopify__abandoned_checkout_shipping_line.sql index dd559db..fe60ade 100644 --- a/models/stg_shopify__abandoned_checkout_shipping_line.sql +++ b/models/stg_shopify__abandoned_checkout_shipping_line.sql @@ -29,9 +29,7 @@ final as ( id as abandoned_checkout_shipping_line_id, checkout_id, index, - api_client_id, carrier_identifier, - carrier_service_id, code as shipping_code, delivery_category, delivery_expectation_range, @@ -39,16 +37,11 @@ final as ( delivery_expectation_range_min, delivery_expectation_type, discounted_price, - markup, - original_shop_markup, - original_shop_price, phone, - presentment_title, price, requested_fulfillment_service_id, source, title, - validation_context, {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation From 1df74dadfd3b82c11261c8f65d8e8ce5d1f44022 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 13 Jan 2023 16:40:58 -0800 Subject: [PATCH 086/137] fulfillment event table added --- dbt_project.yml | 1 + integration_tests/dbt_project.yml | 1 + .../seeds/shopify_fulfillment_event_data.csv | 6 ++ macros/get_fulfillment_event_columns.sql | 28 ++++++++++ models/src_shopify.yml | 8 ++- models/stg_shopify.yml | 2 +- models/stg_shopify__fulfillment_event.sql | 56 +++++++++++++++++++ models/stg_shopify__order.sql | 3 +- .../stg_shopify__fulfillment_event_tmp.sql | 14 +++++ 9 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 integration_tests/seeds/shopify_fulfillment_event_data.csv create mode 100644 macros/get_fulfillment_event_columns.sql create mode 100644 models/stg_shopify__fulfillment_event.sql create mode 100644 models/tmp/stg_shopify__fulfillment_event_tmp.sql diff --git a/dbt_project.yml b/dbt_project.yml index 54a3cf4..2ba07b4 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -43,6 +43,7 @@ vars: abandoned_checkout_discount_code_source: "{{ source('shopify','abandoned_checkout_discount_code') }}" order_discount_code_source: "{{ source('shopify','order_discount_code') }}" abandoned_checkout_shipping_line_source: "{{ source('shopify', 'abandoned_checkout_shipping_line') }}" + fulfillment_event_source: "{{ source('shopify', 'fulfillment_event') }}" customer_pass_through_columns: [] order_line_refund_pass_through_columns: [] diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index e42b44b..6dc0a16 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -38,6 +38,7 @@ vars: shopify_abandoned_checkout_discount_code_identifier: "shopify_abandoned_checkout_discount_code_data" shopify_order_discount_code_identifier: "shopify_order_discount_code_data" shopify_abandoned_checkout_shipping_line_identifier: "shopify_abandoned_checkout_shipping_line_data" + shopify_fulfillment_event_identifier: "shopify_fulfillment_event_data" dispatch: - macro_namespace: dbt_utils diff --git a/integration_tests/seeds/shopify_fulfillment_event_data.csv b/integration_tests/seeds/shopify_fulfillment_event_data.csv new file mode 100644 index 0000000..a1ac66f --- /dev/null +++ b/integration_tests/seeds/shopify_fulfillment_event_data.csv @@ -0,0 +1,6 @@ +id,_fivetran_synced,address_1,city,country,created_at,estimated_delivery_at,fulfillment_id,happened_at,latitude,longitude,message,order_id,province,shop_id,status,updated_at,zip,_fivetran_deleted +451435,2022-11-18 04:39:07.945000,,,,2022-08-29 20:52:39.000000,,40495,2022-08-29 20:52:39.000000,,,,4502987,,8944320612,delivered,2022-08-29 20:52:39.000000,,false +48779,2022-11-18 05:48:01.773000,,LONDON,GB,2022-09-13 08:07:57.000000,,4064737,2022-08-15 12:41:00.000000,101.349998474121094,-14.0333000011742115,Delay,4588203,,89320612,out_for_delivery,2022-09-13 08:07:57.000000,CR0,false +1481515,2022-11-18 05:41:00.745000,,ECHO PARK,AU,2022-09-14 14:16:52.000000,2022-09-14 08:00:00.000000,4019339,2022-09-14 01:26:00.000000,-3.797698974609375,190.78399658203125,Delay,451915,,89320612,out_for_delivery,2022-09-14 14:16:52.000000,2759,false +558955,2022-11-18 10:51:24.286000,,LAZYTOWN,US,2022-08-13 12:40:26.000000,,402947,2022-03-01 10:36:39.000000,22.337699890136719,-71.731002807617188,Delay,429188587,MA,89420612,in_transit,2022-08-13 12:40:26.000000,01505,false +6904235,2022-11-18 08:58:00.458000,,LA,US,2022-08-24 06:29:21.000000,2022-08-24 23:59:59.000000,4060491,2022-08-24 05:30:57.000000,12.287498474121094,-21.3573989868164,Delay,4537242667,MA,89420612,in_transit,2022-08-24 06:29:21.000000,01760,false \ No newline at end of file diff --git a/macros/get_fulfillment_event_columns.sql b/macros/get_fulfillment_event_columns.sql new file mode 100644 index 0000000..0ab1cd3 --- /dev/null +++ b/macros/get_fulfillment_event_columns.sql @@ -0,0 +1,28 @@ +23:36:24 Partial parse save file not found. Starting full parse. +23:36:29 {% macro get_fulfillment_event_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "address_1", "datatype": dbt.type_string()}, + {"name": "city", "datatype": dbt.type_string()}, + {"name": "country", "datatype": dbt.type_string()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "estimated_delivery_at", "datatype": dbt.type_timestamp()}, + {"name": "fulfillment_id", "datatype": dbt.type_int()}, + {"name": "happened_at", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "latitude", "datatype": dbt.type_float()}, + {"name": "longitude", "datatype": dbt.type_float()}, + {"name": "message", "datatype": dbt.type_string()}, + {"name": "order_id", "datatype": dbt.type_int()}, + {"name": "province", "datatype": dbt.type_string()}, + {"name": "shop_id", "datatype": dbt.type_int()}, + {"name": "status", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()}, + {"name": "zip", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 96531f4..f323dc6 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -56,7 +56,7 @@ sources: - name: cart_token description: The ID of the cart that's associated with the order. - name: closed_at - description: The date and time when the order was closed. + description: The date and time when the order was closed (archived). - name: created_at description: The autogenerated date and time when the order was created in Shopify. - name: currency @@ -1271,4 +1271,8 @@ sources: - name: abandoned_checkout_shipping_line description: Shipping lines associated with abandoned checkouts. TODO - identifier: "{{ var('shopify_abandoned_checkout_shipping_line_identifier', 'abandoned_checkout_shipping_line') }}" \ No newline at end of file + identifier: "{{ var('shopify_abandoned_checkout_shipping_line_identifier', 'abandoned_checkout_shipping_line') }}" + + - name: fulfillment_event + description: TODO + identifier: "{{ var('shopify_fulfillment_event_identifier', 'fulfillment_event') }}" diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 0a05364..8c37a27 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -181,7 +181,7 @@ models: - name: cart_token description: The ID of the cart that's associated with the order. - name: closed_timestamp - description: The date and time when the order was closed. + description: The date and time when the order was closed (archived). - name: created_timestamp description: The autogenerated date and time when the order was created in Shopify. - name: currency diff --git a/models/stg_shopify__fulfillment_event.sql b/models/stg_shopify__fulfillment_event.sql new file mode 100644 index 0000000..5e4a0be --- /dev/null +++ b/models/stg_shopify__fulfillment_event.sql @@ -0,0 +1,56 @@ +{{ config(enabled=var('shopify__using_fulfillment_event', True)) }} + +with base as ( + + select * + from {{ ref('stg_shopify__fulfillment_event_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__fulfillment_event_tmp')), + staging_columns=get_fulfillment_event_columns() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as fulfillment_event_id, + fulfillment_id, + shop_id, + order_id, + status, + message, + {{ dbt_date.convert_timezone(column='cast(estimated_delivery_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as estimated_delivery_at, + {{ dbt_date.convert_timezone(column='cast(happened_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as happened_at, + address_1, + city, + province, + country, + zip, + latitude, + longitude, + {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, + {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, + source_relation + + from fields + + where not coalesce(_fivetran_deleted, false) +) + +select * +from final diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index dd84e78..19c5587 100644 --- a/models/stg_shopify__order.sql +++ b/models/stg_shopify__order.sql @@ -118,4 +118,5 @@ final as ( select * from final -where not coalesce(is_test_order, false) \ No newline at end of file +where not coalesce(is_test_order, false) +and not coalesce(is_deleted, false) \ No newline at end of file diff --git a/models/tmp/stg_shopify__fulfillment_event_tmp.sql b/models/tmp/stg_shopify__fulfillment_event_tmp.sql new file mode 100644 index 0000000..97158b7 --- /dev/null +++ b/models/tmp/stg_shopify__fulfillment_event_tmp.sql @@ -0,0 +1,14 @@ +{{ config(enabled=var('shopify__using_fulfillment_event', True)) }} + +{{ + fivetran_utils.union_data( + table_identifier='fulfillment_event', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='fulfillment_event_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file From c2ddd5be234ef01147d5640aaa61f22fe1b07adb Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Mon, 23 Jan 2023 15:30:11 -0600 Subject: [PATCH 087/137] feature/metafields --- models/stg_shopify.yml | 4 ++++ models/stg_shopify__metafield.sql | 2 ++ packages.yml | 7 ++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 0a05364..eea86ee 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -985,6 +985,10 @@ models: description: The date and time (ISO 8601 format) when the metafield was last updated. - name: value description: The data to store in the metafield. The value is always stored as a string, regardless of the metafield's type. + - name: metafield_reference + description: Combination of the namespace and key columns. This field is key for metafield mapping in downstream models. + - name: is_most_recent_record + description: Boolean indicating the most up to date record identified by the most recent updated_at field. - name: stg_shopify__order_note_attribute description: Table storing custom attributes placed on orders. diff --git a/models/stg_shopify__metafield.sql b/models/stg_shopify__metafield.sql index 766ee81..19d032e 100644 --- a/models/stg_shopify__metafield.sql +++ b/models/stg_shopify__metafield.sql @@ -37,6 +37,8 @@ final as ( {{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at, {{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at, {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, + {{ dbt.concat(["namespace","'_'","key"]) }} as metafield_reference, + row_number() over (partition by id order by updated_at desc) = 1 as is_most_recent_record, source_relation from fields diff --git a/packages.yml b/packages.yml index 7dee2ce..5dd3249 100644 --- a/packages.yml +++ b/packages.yml @@ -1,9 +1,6 @@ packages: -# - package: fivetran/fivetran_utils -# version: [">=0.4.0", "<0.5.0"] -- git: https://github.com/fivetran/dbt_fivetran_utils.git - revision: releases/v0.4.latest - warn-unpinned: false +- package: fivetran/fivetran_utils + version: [">=0.4.0", "<0.5.0"] - package: dbt-labs/spark_utils version: [">=0.3.0", "<0.4.0"] - package: calogica/dbt_date From ce0957decab2c1dd5a32bcaa527b76f1ee0cb5d5 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 23 Jan 2023 14:59:19 -0800 Subject: [PATCH 088/137] macro typo --- macros/get_fulfillment_event_columns.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/macros/get_fulfillment_event_columns.sql b/macros/get_fulfillment_event_columns.sql index 0ab1cd3..935a740 100644 --- a/macros/get_fulfillment_event_columns.sql +++ b/macros/get_fulfillment_event_columns.sql @@ -1,5 +1,4 @@ -23:36:24 Partial parse save file not found. Starting full parse. -23:36:29 {% macro get_fulfillment_event_columns() %} +{% macro get_fulfillment_event_columns() %} {% set columns = [ {"name": "_fivetran_deleted", "datatype": "boolean"}, From 41d2bb4da8e916f4f9af8dc23afd6a793094c4f7 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 23 Jan 2023 15:44:48 -0800 Subject: [PATCH 089/137] Seeds --- .../seeds/shopify_fulfillment_event_data.csv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration_tests/seeds/shopify_fulfillment_event_data.csv b/integration_tests/seeds/shopify_fulfillment_event_data.csv index a1ac66f..b4d8120 100644 --- a/integration_tests/seeds/shopify_fulfillment_event_data.csv +++ b/integration_tests/seeds/shopify_fulfillment_event_data.csv @@ -1,6 +1,6 @@ id,_fivetran_synced,address_1,city,country,created_at,estimated_delivery_at,fulfillment_id,happened_at,latitude,longitude,message,order_id,province,shop_id,status,updated_at,zip,_fivetran_deleted -451435,2022-11-18 04:39:07.945000,,,,2022-08-29 20:52:39.000000,,40495,2022-08-29 20:52:39.000000,,,,4502987,,8944320612,delivered,2022-08-29 20:52:39.000000,,false -48779,2022-11-18 05:48:01.773000,,LONDON,GB,2022-09-13 08:07:57.000000,,4064737,2022-08-15 12:41:00.000000,101.349998474121094,-14.0333000011742115,Delay,4588203,,89320612,out_for_delivery,2022-09-13 08:07:57.000000,CR0,false -1481515,2022-11-18 05:41:00.745000,,ECHO PARK,AU,2022-09-14 14:16:52.000000,2022-09-14 08:00:00.000000,4019339,2022-09-14 01:26:00.000000,-3.797698974609375,190.78399658203125,Delay,451915,,89320612,out_for_delivery,2022-09-14 14:16:52.000000,2759,false +451435,2022-11-18 04:39:07.945000,,,,2022-08-29 20:52:39.000000,,40495,2022-08-29 20:52:39.000000,,,,4502987,,89440612,delivered,2022-08-29 20:52:39.000000,,false +48779,2022-11-18 05:48:01.773000,,LONDON,GB,2022-09-13 08:07:57.000000,,4064737,2022-08-15 12:41:00.000000,101.349998474121094,-14.0333000011742115,Delay,4588203,,320612,out_for_delivery,2022-09-13 08:07:57.000000,CR0,false +1481515,2022-11-18 05:41:00.745000,,ECHO PARK,AU,2022-09-14 14:16:52.000000,2022-09-14 08:00:00.000000,4019339,2022-09-14 01:26:00.000000,-3.797698974609375,190.783958203125,Delay,451915,,89320612,out_for_delivery,2022-09-14 14:16:52.000000,2759,false 558955,2022-11-18 10:51:24.286000,,LAZYTOWN,US,2022-08-13 12:40:26.000000,,402947,2022-03-01 10:36:39.000000,22.337699890136719,-71.731002807617188,Delay,429188587,MA,89420612,in_transit,2022-08-13 12:40:26.000000,01505,false -6904235,2022-11-18 08:58:00.458000,,LA,US,2022-08-24 06:29:21.000000,2022-08-24 23:59:59.000000,4060491,2022-08-24 05:30:57.000000,12.287498474121094,-21.3573989868164,Delay,4537242667,MA,89420612,in_transit,2022-08-24 06:29:21.000000,01760,false \ No newline at end of file +6904235,2022-11-18 08:58:00.458000,,LA,US,2022-08-24 06:29:21.000000,2022-08-24 23:59:59.000000,4060491,2022-08-24 05:30:57.000000,12.287498474121094,-21.3573989868164,Delay,4242667,MA,89420612,in_transit,2022-08-24 06:29:21.000000,01760,false \ No newline at end of file From b7865d3ef496471cf1c70d31ef9729c6bb4be867 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 23 Jan 2023 16:29:32 -0800 Subject: [PATCH 090/137] make variable names consisgtent --- .buildkite/scripts/run_models.sh | 2 +- models/stg_shopify__fulfillment_event.sql | 2 +- models/tmp/stg_shopify__fulfillment_event_tmp.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh index 3e08693..1237b21 100644 --- a/.buildkite/scripts/run_models.sh +++ b/.buildkite/scripts/run_models.sh @@ -19,5 +19,5 @@ dbt deps dbt seed --target "$db" --full-refresh dbt run --target "$db" --full-refresh dbt test --target "$db" -dbt run --vars '{shopify_timezone: "America/New_York"}' --target "$db" --full-refresh +dbt run --vars '{shopify_timezone: "America/New_York", shopify_using_fulfillment_event: true}' --target "$db" --full-refresh dbt test --target "$db" \ No newline at end of file diff --git a/models/stg_shopify__fulfillment_event.sql b/models/stg_shopify__fulfillment_event.sql index 5e4a0be..08cc683 100644 --- a/models/stg_shopify__fulfillment_event.sql +++ b/models/stg_shopify__fulfillment_event.sql @@ -1,4 +1,4 @@ -{{ config(enabled=var('shopify__using_fulfillment_event', True)) }} +{{ config(enabled=var('shopify_using_fulfillment_event', false)) }} with base as ( diff --git a/models/tmp/stg_shopify__fulfillment_event_tmp.sql b/models/tmp/stg_shopify__fulfillment_event_tmp.sql index 97158b7..085d9ba 100644 --- a/models/tmp/stg_shopify__fulfillment_event_tmp.sql +++ b/models/tmp/stg_shopify__fulfillment_event_tmp.sql @@ -1,4 +1,4 @@ -{{ config(enabled=var('shopify__using_fulfillment_event', True)) }} +{{ config(enabled=var('shopify_using_fulfillment_event', false)) }} {{ fivetran_utils.union_data( From 8fda519a6b43e0f8cb73ecd93babb7416ec83a0a Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Tue, 24 Jan 2023 10:35:11 -0600 Subject: [PATCH 091/137] dbt-expectations addition --- README.md | 3 +++ packages.yml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e2705a2..5e0f250 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,9 @@ packages: - package: dbt-labs/dbt_utils version: [">=1.0.0", "<2.0.0"] + - package: calogica/dbt_expectations + version: [">=0.8.0", "<0.9.0"] + - package: calogica/dbt_date version: [">=0.7.0", "<0.8.0"] ``` diff --git a/packages.yml b/packages.yml index 5dd3249..c2758dd 100644 --- a/packages.yml +++ b/packages.yml @@ -3,5 +3,5 @@ packages: version: [">=0.4.0", "<0.5.0"] - package: dbt-labs/spark_utils version: [">=0.3.0", "<0.4.0"] -- package: calogica/dbt_date - version: [">=0.7.0", "<0.8.0"] \ No newline at end of file +- package: calogica/dbt_expectations + version: [">=0.8.0", "<0.9.0"] \ No newline at end of file From 3809824b37ab38f21fd5a639f1c480630efeb840 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 24 Jan 2023 13:29:22 -0800 Subject: [PATCH 092/137] add tax line and new columns --- dbt_project.yml | 1 + integration_tests/dbt_project.yml | 1 + .../seeds/shopify_tax_line_data.csv | 6 +++ macros/get_order_line_columns.sql | 18 +++++++- macros/get_tax_line_columns.sql | 15 +++++++ models/src_shopify.yml | 6 ++- models/stg_shopify__order_line.sql | 16 +++++++ models/stg_shopify__tax_line.sql | 42 +++++++++++++++++++ models/tmp/stg_shopify__tax_line_tmp.sql | 12 ++++++ 9 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 integration_tests/seeds/shopify_tax_line_data.csv create mode 100644 macros/get_tax_line_columns.sql create mode 100644 models/stg_shopify__tax_line.sql create mode 100644 models/tmp/stg_shopify__tax_line_tmp.sql diff --git a/dbt_project.yml b/dbt_project.yml index 54a3cf4..f3287c6 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -43,6 +43,7 @@ vars: abandoned_checkout_discount_code_source: "{{ source('shopify','abandoned_checkout_discount_code') }}" order_discount_code_source: "{{ source('shopify','order_discount_code') }}" abandoned_checkout_shipping_line_source: "{{ source('shopify', 'abandoned_checkout_shipping_line') }}" + tax_line_source: "{{ source('shopify', 'tax_line') }}" customer_pass_through_columns: [] order_line_refund_pass_through_columns: [] diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index e42b44b..ed0db5b 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -38,6 +38,7 @@ vars: shopify_abandoned_checkout_discount_code_identifier: "shopify_abandoned_checkout_discount_code_data" shopify_order_discount_code_identifier: "shopify_order_discount_code_data" shopify_abandoned_checkout_shipping_line_identifier: "shopify_abandoned_checkout_shipping_line_data" + shopify_tax_line_identifier: "shopify_tax_line_data" dispatch: - macro_namespace: dbt_utils diff --git a/integration_tests/seeds/shopify_tax_line_data.csv b/integration_tests/seeds/shopify_tax_line_data.csv new file mode 100644 index 0000000..cfcbfb2 --- /dev/null +++ b/integration_tests/seeds/shopify_tax_line_data.csv @@ -0,0 +1,6 @@ +index,order_line_id,_fivetran_synced,price,rate,title,price_set +1,29227,2022-11-19 05:30:34.023000,0.0,0.0,VAT,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +1,1839083,2022-11-19 07:14:05.023000,0.0,0.0,VAT,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +1,11995,2022-11-19 05:30:34.023000,0.0,0.0,VAT,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +1,10751,2022-11-19 07:14:05.024000,0.0,0.0,VAT,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" +1,194763,2022-11-19 05:30:34.023000,0.0,0.0,VAT,"{""shop_money"":{""amount"":""0.00"",""currency_code"":""USD""},""presentment_money"":{""amount"":""0.00"",""currency_code"":""USD""}}" \ No newline at end of file diff --git a/macros/get_order_line_columns.sql b/macros/get_order_line_columns.sql index 574cc72..e70aed6 100644 --- a/macros/get_order_line_columns.sql +++ b/macros/get_order_line_columns.sql @@ -33,7 +33,23 @@ {"name": "variant_title", "datatype": dbt.type_string()}, {"name": "variant_inventory_management", "datatype": dbt.type_string()}, {"name": "vendor", "datatype": dbt.type_string()}, - {"name": "properties", "datatype": dbt.type_string()} + {"name": "properties", "datatype": dbt.type_string()}, + {"name": "destination_location_address_1", "datatype": dbt.type_string()}, + {"name": "destination_location_address_2", "datatype": dbt.type_string()}, + {"name": "destination_location_city", "datatype": dbt.type_string()}, + {"name": "destination_location_country_code", "datatype": dbt.type_string()}, + {"name": "destination_location_id", "datatype": dbt.type_int()}, + {"name": "destination_location_name", "datatype": dbt.type_string()}, + {"name": "destination_location_province_code", "datatype": dbt.type_string()}, + {"name": "destination_location_zip", "datatype": dbt.type_string()}, + {"name": "origin_location_address_1", "datatype": dbt.type_string()}, + {"name": "origin_location_address_2", "datatype": dbt.type_string()}, + {"name": "origin_location_city", "datatype": dbt.type_string()}, + {"name": "origin_location_country_code", "datatype": dbt.type_string()}, + {"name": "origin_location_id", "datatype": dbt.type_int()}, + {"name": "origin_location_name", "datatype": dbt.type_string()}, + {"name": "origin_location_province_code", "datatype": dbt.type_string()}, + {"name": "origin_location_zip", "datatype": dbt.type_string()} ] %} {{ fivetran_utils.add_pass_through_columns(columns, var('order_line_pass_through_columns')) }} diff --git a/macros/get_tax_line_columns.sql b/macros/get_tax_line_columns.sql new file mode 100644 index 0000000..e91267e --- /dev/null +++ b/macros/get_tax_line_columns.sql @@ -0,0 +1,15 @@ +{% macro get_tax_line_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "index", "datatype": dbt.type_int()}, + {"name": "order_line_id", "datatype": dbt.type_int()}, + {"name": "price", "datatype": dbt.type_float()}, + {"name": "price_set", "datatype": dbt.type_string()}, + {"name": "rate", "datatype": dbt.type_float()}, + {"name": "title", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 96531f4..44b5722 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -1271,4 +1271,8 @@ sources: - name: abandoned_checkout_shipping_line description: Shipping lines associated with abandoned checkouts. TODO - identifier: "{{ var('shopify_abandoned_checkout_shipping_line_identifier', 'abandoned_checkout_shipping_line') }}" \ No newline at end of file + identifier: "{{ var('shopify_abandoned_checkout_shipping_line_identifier', 'abandoned_checkout_shipping_line') }}" + + - name: tax_line + description: TODO + identifier: "{{ var('shopify_tax_line_identifier', 'tax_line') }}" \ No newline at end of file diff --git a/models/stg_shopify__order_line.sql b/models/stg_shopify__order_line.sql index 18642e3..fded740 100644 --- a/models/stg_shopify__order_line.sql +++ b/models/stg_shopify__order_line.sql @@ -60,6 +60,22 @@ final as ( variant_inventory_management, vendor, properties, + destination_location_address_1, + destination_location_address_2, + destination_location_city, + destination_location_country_code, + destination_location_id, + destination_location_name, + destination_location_province_code, + destination_location_zip, + origin_location_address_1, + origin_location_address_2, + origin_location_city, + origin_location_country_code, + origin_location_id, + origin_location_name, + origin_location_province_code, + origin_location_zip, {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, source_relation diff --git a/models/stg_shopify__tax_line.sql b/models/stg_shopify__tax_line.sql new file mode 100644 index 0000000..33c477c --- /dev/null +++ b/models/stg_shopify__tax_line.sql @@ -0,0 +1,42 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__tax_line_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__tax_line_tmp')), + staging_columns=get_tax_line_columns() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + index, + order_line_id, + price, + price_set, + rate, + title, + {{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced, + source_relation + + from fields +) + +select * +from final diff --git a/models/tmp/stg_shopify__tax_line_tmp.sql b/models/tmp/stg_shopify__tax_line_tmp.sql new file mode 100644 index 0000000..7e31459 --- /dev/null +++ b/models/tmp/stg_shopify__tax_line_tmp.sql @@ -0,0 +1,12 @@ +{{ + fivetran_utils.union_data( + table_identifier='tax_line', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='tax_line_source', + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases' + ) +}} \ No newline at end of file From 10e50fc613643f0c3932c7d252b796796078faa3 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 25 Jan 2023 16:11:14 -0800 Subject: [PATCH 093/137] docs and other tweaks --- CHANGELOG.md | 68 +++++++++---------- models/src_shopify.yml | 73 ++++++++++++++++++++- models/stg_shopify.yml | 144 +++++++++++++++++++++++++++++++++++++++-- 3 files changed, 245 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b789600..20453f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,45 +4,45 @@ - Included `shopify_[source_table_name]_identifier` variable for additional flexibility within the package when source tables are named differently. - The following fields have been added to (➕) or removed from (➖) their respective staging models: - `stg_shopify__order`: - - ➕ `total_discounts_set` - - ➕ `total_line_items_price_set` - - ➕ `total_price_usd` - - ➕ `total_price_set` - - ➕ `total_tax_set` - - ➕ `total_tip_received` - - ➕ `is_deleted` - - ➕ `app_id` - - ➕ `checkout_id` - - ➕ `client_details_user_agent` - - ➕ `customer_locale` - - ➕ `order_status_url` - - ➕ `presentment_currency` - - ➕ `is_inventory_confirmed` + ➕ `total_discounts_set` + ➕ `total_line_items_price_set` + ➕ `total_price_usd` + ➕ `total_price_set` + ➕ `total_tax_set` + ➕ `total_tip_received` + ➕ `is_deleted` + ➕ `app_id` + ➕ `checkout_id` + ➕ `client_details_user_agent` + ➕ `customer_locale` + ➕ `order_status_url` + ➕ `presentment_currency` + ➕ `is_inventory_confirmed` - `stg_shopify__customer`: - - ➕ `note` - - ➕ `lifetime_duration` - - ➕ `currency` - - ➕ `marketing_consent_state` (coalescing of `email_marketing_consent_state` and deprecated `accepts_marketing` field) - - ➕ `marketing_opt_in_level` (coalescing of `email_marketing_consent_opt_in_level` and deprecated `marketing_opt_in_level` field) - - ➕ `marketing_consent_updated_at` (coalescing of `email_marketing_consent_consent_updated_at` and deprecated `accepts_marketing_updated_at` field) - - ➖ `accepts_marketing`/`has_accepted_marketing` - - ➖ `accepts_marketing_updated_at` - - ➖ `marketing_opt_in_level` + ➕ `note` + ➕ `lifetime_duration` + ➕ `currency` + ➕ `marketing_consent_state` (coalescing of `email_marketing_consent_state` and deprecated `accepts_marketing` field) + ➕ `marketing_opt_in_level` (coalescing of `email_marketing_consent_opt_in_level` and deprecated `marketing_opt_in_level` field) + ➕ `marketing_consent_updated_at` (coalescing of `email_marketing_consent_consent_updated_at` and deprecated `accepts_marketing_updated_at` field) + ➖ `accepts_marketing`/`has_accepted_marketing` + ➖ `accepts_marketing_updated_at` + ➖ `marketing_opt_in_level` - `stg_shopify__order_line_refund`: - - ➕ `subtotal_set` - - ➕ `total_tax_set` + ➕ `subtotal_set` + ➕ `total_tax_set` - `stg_shopify__order_line`: - - ➕ `pre_tax_price_set` - - ➕ `price_set` - - ➕ `tax_code` - - ➕ `total_discount_set` - - ➕ `variant_title` - - ➕ `variant_inventory_management` - - ➕ `properties` + ➕ `pre_tax_price_set` + ➕ `price_set` + ➕ `tax_code` + ➕ `total_discount_set` + ➕ `variant_title` + ➕ `variant_inventory_management` + ➕ `properties` - `stg_shopify__product`: - - ➕ `status` + ➕ `status` - `stg_shopify__product_variant` - - ➖ `old_inventory_quantity` + ➖ `old_inventory_quantity` ## 🚨 Breaking Changes 🚨: [PR #36](https://github.com/fivetran/dbt_shopify_source/pull/36) includes the following breaking changes: diff --git a/models/src_shopify.yml b/models/src_shopify.yml index e6d56a3..b1cb0a8 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -1311,5 +1311,76 @@ sources: description: The title of the shipping method. Example value - International Shipping. - name: fulfillment_event - description: TODO + description: > + The FulfillmentEvent resource represents tracking events that belong to a fulfillment of one or more items in an order. + Fulfillment events are displayed on the order status page to update customers on the status of their shipment. identifier: "{{ var('shopify_fulfillment_event_identifier', 'fulfillment_event') }}" + columns: + - name: _fivetran_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: address_1 + description: The street address where the fulfillment event occurred. + - name: city + description: The city where the fulfillment event occurred. + - name: country + description: The country where the fulfillment event occurred. + - name: created_at + description: The date and time (ISO 8601 format) when the fulfillment event was created. + - name: estimated_delivery_at + description: > + The estimated delivery date based on the fulfillment's tracking number, as long as it's provided by one of the following carriers: USPS, FedEx, UPS, or Canada Post (Canada only). + Value is `null` if no tracking number is available or if the tracking number is from an unsupported carrier. This property is available only when carrier calculated rates are in use. + - name: fulfillment_id + description: An ID for the fulfillment that's associated with the fulfillment event. + - name: happened_at + description: The date and time (ISO 8601 format) when the fulfillment event occurred. + - name: id + description: An ID for the fulfillment event. + - name: latitude + description: A geographic coordinate specifying the latitude of the fulfillment event. + - name: longitude + description: A geographic coordinate specifying the longitude of the fulfillment event. + - name: message + description: An arbitrary message describing the status. Can be provided by a shipping carrier. + - name: order_id + description: The ID of the order that's associated with the fulfillment event. + - name: province + description: The province where the fulfillment event occurred. + - name: shop_id + description: An ID for the shop that's associated with the fulfillment event. + - name: status + description: > + The status of the fulfillment event. Valid values: + - label_printed: A label for the shipment was purchased and printed. + - label_purchased: A label for the shipment was purchased, but not printed. + - attempted_delivery: Delivery of the shipment was attempted, but unable to be completed. + - ready_for_pickup: The shipment is ready for pickup at a shipping depot. + - picked_up: The fulfillment was successfully picked up. + - confirmed: The carrier is aware of the shipment, but hasn't received it yet. + - in_transit: The shipment is being transported between shipping facilities on the way to its destination. + - out_for_delivery: The shipment is being delivered to its final destination. + - delivered: The shipment was successfully delivered. + - failure: Something went wrong when pulling tracking information for the shipment, such as the tracking number was invalid or the shipment was canceled. + - name: updated_at + description: The date and time (ISO 8601 format) when the fulfillment event was updated. + - name: zip + description: The zip code of the location where the fulfillment event occurred. + + - name: tax_line + description: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: The index of the tax line. + - name: order_line_id + description: The order line that this tax line is associated with. + - name: price + description: The amount of tax, in shop currency, after discounts and before returns. + - name: price_set + description: The amount of tax, in shop and presentment currencies, after discounts and before returns. + - name: rate + description: The proportion of the line item price that the tax represents as a decimal. + - name: title + description: The name of the tax. \ No newline at end of file diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 1c902d0..9eb7cb5 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -49,6 +49,8 @@ models: description: The amount of time since the customer was first added to the store. - name: currency description: The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order. Defaults to the shop currency. Returns the shop currency for test orders. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__order_line_refund description: Each record represents a line item from an order in Shopify. @@ -76,6 +78,8 @@ models: description: Subtotal amount of the order line refund - name: total_tax description: The total tax applied to the refund. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__order_line description: Each record represents a line item from an order in Shopify. @@ -123,6 +127,8 @@ models: description: The ID of the product variant. - name: vendor description: The name of the item's supplier. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__order description: Each record represents an order in Shopify. @@ -291,6 +297,8 @@ models: - name: total_discounts_set - name: subtotal_price_set - name: presentment_currency + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__product description: Each record represents a product in Shopify. @@ -322,6 +330,8 @@ models: description: The date and time when the product was last modified. - name: vendor description: The name of the product's vendor. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__product_variant description: Each record represents a product variant in Shopify @@ -383,6 +393,8 @@ models: description: "The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb." - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__transaction description: Each record represents a transaction in Shopify. @@ -454,6 +466,8 @@ models: description: The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable. - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__refund description: Each record represents a refund within Shopify. @@ -481,6 +495,8 @@ models: description: Record representing total duties set for the refund. - name: order_id description: Reference to the order which the refund is associated. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__order_adjustment description: Each record represents and adjustment to and order within Shopify. @@ -510,6 +526,8 @@ models: description: Tax amount set towards the order adjustment. - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__abandoned_checkout description: A checkout is considered abandoned after the customer has added contact information, but before the customer has completed their purchase. @@ -646,7 +664,9 @@ models: description: The date and time (ISO 8601 format) when the checkout was last modified. - name: user_id description: The ID of the user who created the checkout. - + - name: source_relation + description: "{{ doc('source_relation') }}" + - name: stg_shopify__collection_product description: Table relating products to the collections they belong to. Use this instead of the deprecated `COLLECT` table. tests: @@ -666,6 +686,8 @@ models: description: ID referencing the `product`. tests: - not_null + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__collection description: > @@ -717,6 +739,8 @@ models: description: The name of the collection - name: updated_at description: The date and time (ISO 8601 format) when the collection was last modified. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__customer_tag description: Tags that the shop owner has attached to the customer. A customer can have up to 250 tags. @@ -739,7 +763,9 @@ models: - not_null - name: value description: Value of the tag. - + - name: source_relation + description: "{{ doc('source_relation') }}" + - name: stg_shopify__discount_code description: > Table storing discount codes that enable specific discounts to be redeemed. Merchants can distribute discount codes to their customers using a variety of means, such as an email or URL, @@ -766,6 +792,8 @@ models: description: The date and time (ISO 8601 format) when the discount code was updated. - name: usage_count description: The number of times that the discount code has been redeemed. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__fulfillment description: > @@ -833,6 +861,8 @@ models: description: The URLs of tracking pages for the fulfillment. - name: updated_at description: The date and time (ISO 8601 format) when the fulfillment was last modified. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__inventory_item description: > @@ -868,6 +898,8 @@ models: description: Boolean representing whether inventory levels are tracked for the item. If true, then the inventory quantity changes are tracked by Shopify. - name: updated_at description: The date and time (ISO 8601 format) when the inventory item was last modified. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__inventory_level description: > @@ -896,6 +928,8 @@ models: - not_null - name: updated_at description: The date and time (ISO 8601 format) when the inventory level was last modified. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__location description: A location represents a geographical location where your stores, pop-up stores, headquarters, and warehouses exist. @@ -950,6 +984,8 @@ models: description: The date and time (ISO 8601 format) when the location was last updated. - name: zip description: The zip or postal code. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__metafield description: > @@ -989,6 +1025,8 @@ models: description: Combination of the namespace and key columns. This field is key for metafield mapping in downstream models. - name: is_most_recent_record description: Boolean indicating the most up to date record identified by the most recent updated_at field. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__order_note_attribute description: Table storing custom attributes placed on orders. @@ -1011,6 +1049,8 @@ models: - not_null - name: value description: Value of the attribute. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__order_shipping_line description: Represents the shipping details that the customer chose for their order. @@ -1050,6 +1090,8 @@ models: description: Returns the rate source for the shipping line. - name: title description: Returns the title of the shipping line. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__order_shipping_tax_line description: Represents taxes associated with order shipping lines. @@ -1078,6 +1120,8 @@ models: description: The proportion of the line item price that the tax represents as a decimal. - name: title description: The name of the tax. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__order_tag description: Tags that the shop owner has attached to the order. @@ -1100,6 +1144,8 @@ models: - not_null - name: value description: Value of the tag. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__order_url_tag description: Key-value tags that the shop owner has attached to the order url. @@ -1122,6 +1168,8 @@ models: - not_null - name: value description: Value of the tag. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__price_rule description: > @@ -1203,6 +1251,8 @@ models: values: ['percentage', 'fixed_amount'] config: severity: warn # we use these in a JOIN condition in shopify__discounts + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__product_image description: Table storing hosted images of products. @@ -1234,6 +1284,8 @@ models: description: An array of variant ids associated with the image. - name: width description: Width dimension of the image which is determined on upload. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__product_tag description: Tags that the shop owner has attached to the product. @@ -1256,6 +1308,10 @@ models: - not_null - name: value description: Value of the tag. + - name: source_relation + description: "{{ doc('source_relation') }}" + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__shop description: The Shop resource is a collection of general business and store management settings and information about the store. @@ -1371,6 +1427,8 @@ models: description: The default unit of weight measurement for the shop. - name: zip description: The shop's zip or postal code. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__tender_transaction description: > @@ -1416,6 +1474,8 @@ models: description: The remote (gateway) reference associated with the tender. - name: user_id description: The ID of the user logged into the Shopify POS device that processed the tender transaction, if applicable. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__abandoned_checkout_discount_code description: Abandoned checkouts that applied a discount code. @@ -1445,7 +1505,9 @@ models: description: The type of discount. Valid values - percentage, shipping, fixed_amount. (default - fixed_amount) - name: updated_at description: When the checkout's discount was last updated - + - name: source_relation + description: "{{ doc('source_relation') }}" + - name: stg_shopify__order_discount_code description: Discount codes placed on orders. tests: @@ -1469,13 +1531,16 @@ models: - not_null - name: type description: The type of discount - `fixed_amount`, `percentage`, or `shipping`. + - name: source_relation + description: "{{ doc('source_relation') }}" - name: stg_shopify__abandoned_checkout_shipping_line description: Shipping lines associated with abandoned checkouts. tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - abandoned_checkout_shipping_line_id + - checkout_id + - index - source_relation columns: - name: _fivetran_synced @@ -1513,4 +1578,73 @@ models: - name: source description: The channel where the checkout originated. Example value - shopify. - name: title - description: The title of the shipping method. Example value - International Shipping. \ No newline at end of file + description: The title of the shipping method. Example value - International Shipping. + - name: source_relation + description: "{{ doc('source_relation') }}" + + - name: stg_shopify__fulfillment_event + description: > + The FulfillmentEvent resource represents tracking events that belong to a fulfillment of one or more items in an order. + Fulfillment events are displayed on the order status page to update customers on the status of their shipment. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - fulfillment_event_id + - source_relation + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: address_1 + description: The street address where the fulfillment event occurred. + - name: city + description: The city where the fulfillment event occurred. + - name: country + description: The country where the fulfillment event occurred. + - name: created_at + description: The date and time (ISO 8601 format) when the fulfillment event was created. + - name: estimated_delivery_at + description: > + The estimated delivery date based on the fulfillment's tracking number, as long as it's provided by one of the following carriers: USPS, FedEx, UPS, or Canada Post (Canada only). + Value is `null` if no tracking number is available or if the tracking number is from an unsupported carrier. This property is available only when carrier calculated rates are in use. + - name: fulfillment_id + description: An ID for the fulfillment that's associated with the fulfillment event. + - name: happened_at + description: The date and time (ISO 8601 format) when the fulfillment event occurred. + - name: fulfillment_event_id + description: An ID for the fulfillment event. + - name: latitude + description: A geographic coordinate specifying the latitude of the fulfillment event. + - name: longitude + description: A geographic coordinate specifying the longitude of the fulfillment event. + - name: message + description: An arbitrary message describing the status. Can be provided by a shipping carrier. + - name: order_id + description: The ID of the order that's associated with the fulfillment event. + - name: province + description: The province where the fulfillment event occurred. + - name: shop_id + description: An ID for the shop that's associated with the fulfillment event. + - name: status + description: > + The status of the fulfillment event. Valid values: + - label_printed: A label for the shipment was purchased and printed. + - label_purchased: A label for the shipment was purchased, but not printed. + - attempted_delivery: Delivery of the shipment was attempted, but unable to be completed. + - ready_for_pickup: The shipment is ready for pickup at a shipping depot. + - picked_up: The fulfillment was successfully picked up. + - confirmed: The carrier is aware of the shipment, but hasn't received it yet. + - in_transit: The shipment is being transported between shipping facilities on the way to its destination. + - out_for_delivery: The shipment is being delivered to its final destination. + - delivered: The shipment was successfully delivered. + - failure: Something went wrong when pulling tracking information for the shipment, such as the tracking number was invalid or the shipment was canceled. + tests: + - accepted_values: + values: ['attempted_delivery', 'delivered', 'failure', 'in_transit', 'out_for_delivery', 'ready_for_pickup', 'picked_up', 'label_printed', 'label_purchased', 'confirmed'] + config: + severity: warn # we pivot these out in shopify__daily_shop + - name: updated_at + description: The date and time (ISO 8601 format) when the fulfillment event was updated. + - name: zip + description: The zip code of the location where the fulfillment event occurred. + - name: source_relation + description: "{{ doc('source_relation') }}" \ No newline at end of file From 09e0a75e19fbbab1eba9d3dcecfd1a2cc335bb8f Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Wed, 25 Jan 2023 16:12:20 -0800 Subject: [PATCH 094/137] put source_relation in docs.md here for now" --- models/docs.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/models/docs.md b/models/docs.md index be0366c..733463e 100644 --- a/models/docs.md +++ b/models/docs.md @@ -8,4 +8,10 @@ The time when a record was last updated by Fivetran. Boolean representing whether the record was soft-deleted in Shopify. +{% enddocs %} + +{% docs source_relation %} + +The schema or database this record came from if you are making use of the `shopify_union_schemas` or `shopify_union_databases` variables, respectively. Empty string if you are not using either of these variables to union together multiple Shopify connectors. + {% enddocs %} \ No newline at end of file From 2b2a5278d05aeb782b9ea94ab51b04e97bdea218 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Thu, 26 Jan 2023 09:35:07 -0600 Subject: [PATCH 095/137] update yml --- models/src_shopify.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 44b5722..8e31b9b 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -7,7 +7,9 @@ sources: tables: - name: order description: Each record represents an order in Shopify. - identifier: "{%- if target.type == 'snowflake' -%} ORDER {%- else -%} order {%- endif -%}" + identifier: > + {% if target.type == 'snowflake' %}{{ var('shopify_order_identifier', '"ORDER"') }} + {% else %}{{ var('shopify_order_identifier', 'order') }}{% endif %} quoting: identifier: true columns: From cbbd82af08e76e304c286195a8990e0d87a4b74e Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Thu, 26 Jan 2023 18:46:04 -0600 Subject: [PATCH 096/137] update yml --- integration_tests/dbt_project.yml | 3 +++ models/src_shopify.yml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index ed0db5b..890fd7d 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -132,6 +132,9 @@ seeds: +column_types: discounted_price: float price: float + shopify_tax_line_data: + +column_types: + price: float shopify_price_rule_data: +column_types: prerequisite_subtotal_range: float diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 8e31b9b..16a7c82 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -10,8 +10,8 @@ sources: identifier: > {% if target.type == 'snowflake' %}{{ var('shopify_order_identifier', '"ORDER"') }} {% else %}{{ var('shopify_order_identifier', 'order') }}{% endif %} - quoting: - identifier: true + # quoting: + # identifier: true columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" From 5c6b6553eeb840021aee7399a89ffd8e3a112391 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 26 Jan 2023 17:04:58 -0800 Subject: [PATCH 097/137] docs --- macros/get_order_line_columns.sql | 5 -- models/src_shopify.yml | 28 ++++++++- models/stg_shopify.yml | 82 ++++++++++++++++++++++--- models/stg_shopify__order_line.sql | 5 -- models/stg_shopify__product_variant.sql | 2 +- 5 files changed, 101 insertions(+), 21 deletions(-) diff --git a/macros/get_order_line_columns.sql b/macros/get_order_line_columns.sql index 574cc72..fcf6a3b 100644 --- a/macros/get_order_line_columns.sql +++ b/macros/get_order_line_columns.sql @@ -16,11 +16,6 @@ {"name": "price", "datatype": dbt.type_float()}, {"name": "price_set", "datatype": dbt.type_string()}, {"name": "product_id", "datatype": dbt.type_numeric()}, - {"name": "property_charge_interval_frequency", "datatype": dbt.type_numeric()}, - {"name": "property_for_shipping_jan_3_rd_2020", "datatype": dbt.type_string()}, - {"name": "property_shipping_interval_frequency", "datatype": dbt.type_numeric()}, - {"name": "property_shipping_interval_unit_type", "datatype": dbt.type_string()}, - {"name": "property_subscription_id", "datatype": dbt.type_numeric()}, {"name": "quantity", "datatype": dbt.type_numeric()}, {"name": "requires_shipping", "datatype": "boolean"}, {"name": "sku", "datatype": dbt.type_string()}, diff --git a/models/src_shopify.yml b/models/src_shopify.yml index b1cb0a8..27a0c7b 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -206,6 +206,8 @@ sources: description: The amount of time since the customer was first added to the store. - name: _fivetran_deleted description: "{{ doc('_fivetran_deleted') }}" + - name: note + description: A note about the customer. - name: currency description: The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order. Defaults to the shop currency. Returns the shop currency for test orders. - name: order_line @@ -250,6 +252,24 @@ sources: description: The ID of the product variant. - name: vendor description: The name of the item's supplier. + - name: index + description: Index of the order line. + - name: pre_tax_price + description: The pre tax preice of the line item in shop currency. + - name: pre_tax_price_set + description: he pre tax preice of the line item in shop currency and presentment currency. + - name: price_set + description: The price of the line item in shop and presentment currencies. + - name: tax_code + descripton: Tax code applied to the line item. As multiple taxes can apply to a line item, we recommend referring to `stg_shopify__tax_line`. + - name: total_discount_set + description: The total amount allocated to the line item in the presentment currency. + - name: variant_title + description: The title of the product variant. + - name: variant_inventory_management + description: The fulfillment service that tracks the number of items in stock for the product variant. + - name: properties + description: Line item properties. - name: order_line_refund identifier: "{{ var('shopify_order_line_refund_identifier', 'order_line_refund') }}" description: Each record represents a line item refund in Shopify. @@ -272,6 +292,11 @@ sources: description: Subtotal amount of the order line refund - name: total_tax description: The total tax applied to the refund. + - name: subtotal_set + description: The subtotal of the refund line item in shop and presentment currencies. + - name: total_tax_set + description: The total tax of the line item in shop and presentment currencies. + - name: product identifier: "{{ var('shopify_product_identifier', 'product') }}" description: Each record represents a product in Shopify. @@ -1369,7 +1394,8 @@ sources: description: The zip code of the location where the fulfillment event occurred. - name: tax_line - description: + description: Represents a single tax applied to the associated line item. + columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: index diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 9eb7cb5..c070b0e 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -19,7 +19,7 @@ models: description: The marketing subscription opt-in level, as described in the M3AAWG Sender Best Common Practices, that the customer gave when they consented to receive marketing material by email. - name: marketing_consent_updated_at description: The date and time when the customer consented to receive marketing material by email. If no date is provided, then the date and time when the consent information was sent is used. - - name: created_at + - name: created_timestamp description: The date and time when the customer was created. - name: default_address_id description: The default address for the customer. @@ -51,6 +51,8 @@ models: description: The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order. Defaults to the shop currency. Returns the shop currency for test orders. - name: source_relation description: "{{ doc('source_relation') }}" + - name: note + description: A note about the customer. - name: stg_shopify__order_line_refund description: Each record represents a line item from an order in Shopify. @@ -80,6 +82,10 @@ models: description: The total tax applied to the refund. - name: source_relation description: "{{ doc('source_relation') }}" + - name: subtotal_set + description: The subtotal of the refund line item in shop and presentment currencies. + - name: total_tax_set + description: The total tax of the line item in shop and presentment currencies. - name: stg_shopify__order_line description: Each record represents a line item from an order in Shopify. @@ -129,7 +135,25 @@ models: description: The name of the item's supplier. - name: source_relation description: "{{ doc('source_relation') }}" - + - name: index + description: Index of the order line. + - name: pre_tax_price + description: The pre tax preice of the line item in shop currency. + - name: pre_tax_price_set + description: he pre tax preice of the line item in shop currency and presentment currency. + - name: price_set + description: The price of the line item in shop and presentment currencies. + - name: tax_code + descripton: Tax code applied to the line item. As multiple taxes can apply to a line item, we recommend referring to `stg_shopify__tax_line`. + - name: total_discount_set + description: The total amount allocated to the line item in the presentment currency. + - name: variant_title + description: The title of the product variant. + - name: variant_inventory_management + description: The fulfillment service that tracks the number of items in stock for the product variant. + - name: properties + description: Line item properties. +## TODO add desintation location and origion location columns - name: stg_shopify__order description: Each record represents an order in Shopify. tests: @@ -293,12 +317,29 @@ models: - name: client_details_user_agent description: Details of the browsing client, including software and operating versions. - name: total_tax_set + description: The total tax applied to the order in shop and presentment currencies. - name: total_shipping_price_set + description: The total shipping price of the order, excluding discounts and returns, in shop and presentment currencies. If taxes_included is set to true, then total_shipping_price_set includes taxes. - name: total_discounts_set + description: The total discounts applied to the price of the order in shop and presentment currencies. - name: subtotal_price_set + description: The subtotal of the order in shop and presentment currencies after discounts but before shipping, duties, taxes, and tips. - name: presentment_currency + description: The presentment currency that was used to display prices to the customer. - name: source_relation description: "{{ doc('source_relation') }}" + - name: total_line_items_price_set + description: The total of all line item prices in shop and presentment currencies. + - name: total_price_set + description: The total price of the order in shop and presentment currencies. + - name: total_price_usd + description: The sum of all line item prices, discounts, shipping, taxes, and tips in USD. Must be positive. + - name: is_confirmed + description: Whether the order is confirmed. + - name: current_total_price + description: The current total price of the order in the shop currency. The value of this field reflects order edits, returns, and refunds. + - name: source_identifier + description: The ID of the order placed on the originating platform. This value doesn't correspond to the Shopify ID that's generated from a completed draft. - name: stg_shopify__product description: Each record represents a product in Shopify. @@ -308,7 +349,7 @@ models: - product_id - source_relation columns: - - name: _fivetran_deleted + - name: is_deleted description: Whether the record has been deleted in the source system. - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -332,6 +373,13 @@ models: description: The name of the product's vendor. - name: source_relation description: "{{ doc('source_relation') }}" + - name: status + description: > + The status of the product. Valid values: + - active: The product is ready to sell and is available to customers on the online store, sales channels, and apps. By default, existing products are set to active. + - archived: The product is no longer being sold and isn't available to customers on sales channels and apps. + - draft: The product isn't ready to sell and is unavailable to customers on sales channels and apps. By default, duplicated and unarchived products are set to draft. + - name: stg_shopify__product_variant description: Each record represents a product variant in Shopify @@ -363,8 +411,6 @@ models: description: Whether customers are allowed to place an order for the product variant when it's out of stock. - name: inventory_quantity description: An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource. - - name: old_inventory_quantity - description: This property is deprecated. Use the InventoryLevel resource instead. - name: option_1 description: "The custom properties that a shop owner uses to define product variants. You can define three options for a product variant: option1, option2, option3." - name: option_2 @@ -468,6 +514,8 @@ models: description: "{{ doc('_fivetran_synced') }}" - name: source_relation description: "{{ doc('source_relation') }}" + - name: authorization_expires_at + description: The date and time (ISO 8601 format) when the Shopify Payments authorization expires. - name: stg_shopify__refund description: Each record represents a refund within Shopify. @@ -821,8 +869,6 @@ models: The fulfillment number automatically increments depending on how many fulfillments are in an order (e.g. #1001.1, #1001.2). - name: order_id description: The unique numeric identifier for the order. - - name: receipt_authorization - description: The authorization code from the receipt. - name: service description: The fulfillment service associated with the fulfillment. - name: shipment_status @@ -939,7 +985,7 @@ models: - location_id - source_relation columns: - - name: _fivetran_deleted + - name: is_deleted description: "{{ doc('_fivetran_deleted') }}" - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -1647,4 +1693,22 @@ models: - name: zip description: The zip code of the location where the fulfillment event occurred. - name: source_relation - description: "{{ doc('source_relation') }}" \ No newline at end of file + description: "{{ doc('source_relation') }}" + + - name: stg_shopify__tax_line + description: Represents a single tax applied to the associated line item. + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: The index of the tax line. + - name: order_line_id + description: The order line that this tax line is associated with. + - name: price + description: The amount of tax, in shop currency, after discounts and before returns. + - name: price_set + description: The amount of tax, in shop and presentment currencies, after discounts and before returns. + - name: rate + description: The proportion of the line item price that the tax represents as a decimal. + - name: title + description: The name of the tax. \ No newline at end of file diff --git a/models/stg_shopify__order_line.sql b/models/stg_shopify__order_line.sql index 18642e3..812083f 100644 --- a/models/stg_shopify__order_line.sql +++ b/models/stg_shopify__order_line.sql @@ -42,11 +42,6 @@ final as ( price, price_set, product_id, - property_charge_interval_frequency, - property_for_shipping_jan_3_rd_2020, - property_shipping_interval_frequency, - property_shipping_interval_unit_type, - property_subscription_id, quantity, requires_shipping as is_shipping_required, sku, diff --git a/models/stg_shopify__product_variant.sql b/models/stg_shopify__product_variant.sql index 7143c24..5ef39ca 100644 --- a/models/stg_shopify__product_variant.sql +++ b/models/stg_shopify__product_variant.sql @@ -43,7 +43,7 @@ final as ( taxable as is_taxable, barcode, grams, - inventory_quantity, + coalesce(inventory_quantity, old_inventory_quantity) as inventory_quantity, weight, weight_unit, option_1, From 2b0b905c81938f4a39ac8a282bc93eaf94cdc717 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Thu, 26 Jan 2023 19:05:14 -0600 Subject: [PATCH 098/137] update ymls --- .buildkite/pipeline.yml | 2 +- integration_tests/dbt_project.yml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 4c799f0..6e76ea0 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -58,7 +58,7 @@ steps: commands: | bash .buildkite/scripts/run_models.sh redshift - - label: ":bricks: Run Tests - Databricks" + - label: ":databricks: Run Tests - Databricks" key: "run_dbt_databricks" plugins: - docker#v3.13.0: diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 890fd7d..9a6c9d4 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -165,4 +165,8 @@ seeds: markup: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" price: float original_shop_markup: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" - original_shop_price: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" \ No newline at end of file + original_shop_price: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" + shopify_tax_line_data: + +column_types: + price: float + rate: float \ No newline at end of file From 4c8c945a91f1def216d38aea3b4760932189f4b6 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 26 Jan 2023 17:11:13 -0800 Subject: [PATCH 099/137] columns and tables mostly documented --- models/src_shopify.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 27a0c7b..a522daa 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -270,6 +270,7 @@ sources: description: The fulfillment service that tracks the number of items in stock for the product variant. - name: properties description: Line item properties. +## TODO add desintation location and origion location columns - name: order_line_refund identifier: "{{ var('shopify_order_line_refund_identifier', 'order_line_refund') }}" description: Each record represents a line item refund in Shopify. @@ -296,6 +297,10 @@ sources: description: The subtotal of the refund line item in shop and presentment currencies. - name: total_tax_set description: The total tax of the line item in shop and presentment currencies. + - name: subtotal_set + description: The subtotal of the refund line item in shop and presentment currencies. + - name: total_tax_set + description: The total tax of the line item in shop and presentment currencies. - name: product identifier: "{{ var('shopify_product_identifier', 'product') }}" @@ -323,6 +328,13 @@ sources: description: The date and time when the product was last modified. - name: vendor description: The name of the product's vendor. + - name: status + description: > + The status of the product. Valid values: + - active: The product is ready to sell and is available to customers on the online store, sales channels, and apps. By default, existing products are set to active. + - archived: The product is no longer being sold and isn't available to customers on sales channels and apps. + - draft: The product isn't ready to sell and is unavailable to customers on sales channels and apps. By default, duplicated and unarchived products are set to draft. + - name: product_variant identifier: "{{ var('shopify_product_variant_identifier', 'product_variant') }}" description: Each record represents a product variant in Shopify @@ -379,19 +391,13 @@ sources: description: The weight of the product variant in the unit system specified with weight_unit. - name: weight_unit description: "The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb." - - name: total_shipping_price_set - description: The total shipping price set for the order. - - name: index - description: The index associated with the order. - - name: pre_tax_price - description: The total pre tax price of the order. - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: transaction identifier: "{{ var('shopify_transaction_identifier', 'transaction') }}" description: Each record represents a transaction in Shopify. columns: - - name: transaction_id + - name: id description: The ID for the transaction. - name: order_id description: The ID for the order that the transaction is associated with. @@ -401,9 +407,9 @@ sources: description: The amount of money included in the transaction. - name: authorization description: The authorization code associated with the transaction. - - name: created_timestamp + - name: created_at description: The date and time when the transaction was created. - - name: processed_timestamp + - name: processed_at description: The date and time when a transaction was processed. - name: device_id description: The ID for the device. @@ -453,6 +459,8 @@ sources: description: The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable. - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" + - name: authorization_expires_at + description: The date and time (ISO 8601 format) when the Shopify Payments authorization expires. - name: refund identifier: "{{ var('shopify_refund_identifier', 'refund') }}" description: Each record represents a refund within Shopify. From dc5b7a64ccb979bdf55ac29e0c8ac488058cd376 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Thu, 26 Jan 2023 19:17:51 -0600 Subject: [PATCH 100/137] update ymls --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 150e898..2f88bb2 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_tests_2 + schema: shopify_source_integration_tests_3 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_tests_2 + schema: shopify_source_integration_tests_3 threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_tests_2 + schema: shopify_source_integration_tests_3 threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_tests_2 + schema: shopify_source_integration_tests_3 threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_tests_2 + schema: shopify_source_integration_tests_3 threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 9a6c9d4..b01dc97 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,7 +4,7 @@ profile: 'integration_tests' config-version: 2 vars: - shopify_schema: shopify_source_integration_tests_2 + shopify_schema: shopify_source_integration_tests_3 shopify_source: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" From 7316949bf855fa4853f3d9e22f6f07e54df7061b Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Thu, 26 Jan 2023 17:19:43 -0800 Subject: [PATCH 101/137] columns and tables compete --- models/src_shopify.yml | 33 ++++++++++++++++++++++++++++++++- models/stg_shopify.yml | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/models/src_shopify.yml b/models/src_shopify.yml index a522daa..99cf1db 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -270,7 +270,38 @@ sources: description: The fulfillment service that tracks the number of items in stock for the product variant. - name: properties description: Line item properties. -## TODO add desintation location and origion location columns + - name: destination_location_address_1 + description: The street address of the assigned location. + - name: destination_location_address_2 + description: An optional additional field for the street address of the assigned location. + - name: destination_location_city + description: City of the destination where the items should be sent. + - name: destination_location_country_code + description: Two-letter country code (ISO 3166-1 format) of the destination where the items should be sent. + - name: destination_location_id + description: ID of the destination where the items should be sent. + - name: destination_location_name + description: Name of the destination where the items should be sent. + - name: destination_location_province_code + description: Two-letter province code of the destination where the items should be sent. + - name: destination_location_zip + description: Zip code of the destination where the items should be sent. + - name: origin_location_address_1 + description: The street address of the item's supplier. + - name: origin_location_address_2 + description: The suite number of the item's supplier. + - name: origin_location_city + description: The city of the item's supplier. + - name: origin_location_country_code + description: The two-letter code (ISO 3166-1 format) for the country of the item's supplier. + - name: origin_location_id + description: The location ID of the line item’s fulfillment origin. Used by Shopify to calculate applicable taxes. This is not the ID of the location where the order was placed. You can use the FulfillmentOrder resource to determine the location an item will be sourced from. + - name: origin_location_name + description: The name of the item's supplier. + - name: origin_location_province_code + description: The two-letter abbreviation for the region of the item's supplier. + - name: origin_location_zip + description: The zip of the item's supplier. - name: order_line_refund identifier: "{{ var('shopify_order_line_refund_identifier', 'order_line_refund') }}" description: Each record represents a line item refund in Shopify. diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index c070b0e..48d791e 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -153,7 +153,39 @@ models: description: The fulfillment service that tracks the number of items in stock for the product variant. - name: properties description: Line item properties. -## TODO add desintation location and origion location columns + - name: destination_location_address_1 + description: The street address of the assigned location. + - name: destination_location_address_2 + description: An optional additional field for the street address of the assigned location. + - name: destination_location_city + description: City of the destination where the items should be sent. + - name: destination_location_country_code + description: Two-letter country code (ISO 3166-1 format) of the destination where the items should be sent. + - name: destination_location_id + description: ID of the destination where the items should be sent. + - name: destination_location_name + description: Name of the destination where the items should be sent. + - name: destination_location_province_code + description: Two-letter province code of the destination where the items should be sent. + - name: destination_location_zip + description: Zip code of the destination where the items should be sent. + - name: origin_location_address_1 + description: The street address of the item's supplier. + - name: origin_location_address_2 + description: The suite number of the item's supplier. + - name: origin_location_city + description: The city of the item's supplier. + - name: origin_location_country_code + description: The two-letter code (ISO 3166-1 format) for the country of the item's supplier. + - name: origin_location_id + description: The location ID of the line item’s fulfillment origin. Used by Shopify to calculate applicable taxes. This is not the ID of the location where the order was placed. You can use the FulfillmentOrder resource to determine the location an item will be sourced from. + - name: origin_location_name + description: The name of the item's supplier. + - name: origin_location_province_code + description: The two-letter abbreviation for the region of the item's supplier. + - name: origin_location_zip + description: The zip of the item's supplier. + - name: stg_shopify__order description: Each record represents an order in Shopify. tests: From 167c33bca03f83f77fb38cc98f81ac1a4c65bdd5 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 27 Jan 2023 14:27:09 -0800 Subject: [PATCH 102/137] hcangelog --- CHANGELOG.md | 81 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20453f6..0169664 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,32 @@ -# dbt_shopify_source v0.7.0 +# dbt_shopify_source v0.8.0 + +Lots of new features ahead!! We've revamped the package to keep up-to-date with new additions to the Shopify connector and feedback from the community. + ## 🎉 Documentation and Feature Updates -- Updated README documentation updates for easier navigation and setup of the dbt package -- Included `shopify_[source_table_name]_identifier` variable for additional flexibility within the package when source tables are named differently. +[PR #41](https://github.com/fivetran/dbt_shopify_source/pull/41) includes the following change: +- Addition of the `shopify_timezone` variable, which converts ALL timestamps included in the package (including `_fivetran_synced`) to a single target timezone (in IANA Database format, ie "America/Los_Angeles"). + +[PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38) includes the following changes: +- Ensured Postgres compatibility. +- README updated for easier package use and navigation. +- `shopify__identifier` variables added if an individual source table has a different name than the package expects. + +[PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45) includes the following changes: +- Gets rid of the `shopify__using_order_adjustment`, `shopify__using_order_line_refund`, and `shopify__using_refund` variables. Instead, the package will automatically create empty versions of the related models until the source `refund`, `order_line_refund`, and `order_adjustment` tables exist in your schema. See DECISIONLOG for more. +- Creates the [DECISIONLOG](https://github.com/fivetran/dbt_shopify/blob/main/DECISIONLOG.md)! + +[PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following change: +- The declaration of passthrough variables within your root `dbt_project.yml` has changed. To allow for more flexibility and better tracking of passthrough columns, you will now want to define passthrough columns in the following format: +> This applies to all passthrough columns within the `dbt_shopify_source` package and not just the `customers_pass_through_columns` example. See the README for which models have passthrough columns. +```yml +vars: + customer_pass_through_columns: + - name: "my_field_to_include" # Required: Name of the field within the source. + alias: "field_alias" # Optional: If you wish to alias the field within the staging model. + transform_sql: "cast(field_alias as string)" # Optional: If you wish to define the datatype or apply a light transformation. +``` + +[PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39) and [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) include the following changes: - The following fields have been added to (➕) or removed from (➖) their respective staging models: - `stg_shopify__order`: ➕ `total_discounts_set` @@ -39,11 +64,40 @@ ➕ `variant_title` ➕ `variant_inventory_management` ➕ `properties` + ( ) `is_requiring_shipping` is renamed to `is_shipping_required` - `stg_shopify__product`: ➕ `status` - `stg_shopify__product_variant` - ➖ `old_inventory_quantity` + ➖ `old_inventory_quantity` -> coalesced with `inventory_quantity` + ➕ `inventory_quantity` -> coalesced with `old_inventory_quantity` +- The following source tables have been added to the package with respective staging models: + - `abandoned_checkout` + - `collection_product` + - `collection` + - `customer_tag` + - `discount_code` -> if the table does not exist in your schema, the package will create an empty staging model and reference that ([PR #47](https://github.com/fivetran/dbt_shopify_source/pull/47/files), see [DECISIONLOG](https://github.com/fivetran/dbt_shopify/blob/main/DECISIONLOG.md)) + - `fulfillment` + - `inventory_item` + - `inventory_level` + - `location` + - `metafield` ([#PR 49](https://github.com/fivetran/dbt_shopify_source/pull/49) as well) + - `order_note_attribute` + - `order_shipping_line` + - `order_shipping_tax_line` + - `order_tag` + - `order_url_tag` + - `price_rule` + - `product_image` + - `product_tag` + - `shop` + - `tender_transaction` + - `abandoned_checkout_discount_code` + - `order_discount_code` + - `abandoned_checkout_shipping_line` ([(PR #47)](https://github.com/fivetran/dbt_shopify_source/pull/47) as well) + - `fulfillment_event` -> This is NOT included by default. To include fulfillment events (used in the `shopify__daily_shop` model), set the `shopify_using_fulfillment_event` variable to `true` [(PR #48)](https://github.com/fivetran/dbt_shopify_source/pull/48) +- Adjusts the organization of the `get__columns()` macros. +# dbt_shopify_source v0.7.0 ## 🚨 Breaking Changes 🚨: [PR #36](https://github.com/fivetran/dbt_shopify_source/pull/36) includes the following breaking changes: - Dispatch update for dbt-utils to dbt-core cross-db macros migration. Specifically `{{ dbt_utils. }}` have been updated to `{{ dbt. }}` for the below macros: @@ -80,25 +134,6 @@ - `dbt.current_timestamp_backcompat` - `dbt.current_timestamp_in_utc_backcompat` - Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. -- The following fields have been removed as they have been deprecated: - - - -[PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following breaking changes: -- The `is_requiring_shipping` field in `stg_shopify__order_line` has been renamed to `is_shipping_required`, just because it sounds better :) - -- TODO -## Updates: -[PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following changes: -- By default, if the refunds table does not exist, the package will create an empty `stg_shopify__refunds` model. This can still be overwritten by setting `shopify__using_refund` to `false`. We did this because the refunds table is only created once your Shopify account has processed its first refund, and it is unnecessary overhead to have to monitor this and change your dbt_project accordingly. Thus, we took the approach of having this refund table be one that syncs as empty if it is not populated, then seamlessly switches to the source table once it exists. -- TODO more stuff - new tables, fields, passthrough columns, timezone etc. - -[PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38) includes the following changes: -- Ensured Postgres compatibility. -- README updated for easier package use and navigation. -- `shopify__identifier` variables added if an individual source table has a different name than the package expects. - -[PR #41](https://github.com/fivetran/dbt_shopify_source/pull/41) includes the following change: -- Addition of the `shopify_timezone` variable, which converts ALL timestamps included in the package (including `_fivetran_synced`) to a single target timezone (in IANA Database format, ie "America/Los_Angeles"). # dbt_shopify_source v0.6.0 🎉 dbt v1.0.0 Compatibility 🎉 From 1ba8a611fb546478de1f0cb1938f819666b571eb Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 27 Jan 2023 14:45:19 -0800 Subject: [PATCH 103/137] Readme --- README.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5e0f250..b145c4e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ To use this dbt package, you must have the following: - At least one Fivetran Shopify connector syncing data into your destination. - A **BigQuery**, **Snowflake**, **Redshift**, **Databricks**, or **PostgreSQL** destination. -## Step 2: Install the package (skip if also using the `dbt_shopify` package) +## Step 2: Install the package (skip if also using the `shopify` transformation package) If you are **not** using the [Shopify transformation package](https://github.com/fivetran/dbt_shopify), include the following package version in your `packages.yml` file. If you are installing the transform package, the source package is automatically installed as a dependency. > TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages. ```yml @@ -55,9 +55,28 @@ vars: shopify_union_databases: ['shopify_usa','shopify_canada'] # use this if the data is in different databases/projects but uses the same schema name ``` -## Step 4: TODO - timezone converting, maybe should be optional +## Step 4: Enable `fulfillment_event` data -## (Optional) Step 5: Additional configurations +The package takes into consideration that not every Shopify connector may have `fulfillment_event` data enabled. However, this table does hold valuable information that is leveraged in the `shopify__daily_shop` model in the transformation package. `fulfillment_event` data is **disabled by default**. Add the following variable to your `dbt_project.yml` file to enable modelling of fulfillment events: +```yml +# dbt_project.yml + +vars: + shopify_using_fulfillment_event: true # false by default +``` + +## Step 5: Setting your timezone +By default, the data in your Shopify schema is in UTC. However, you may want reporting to reflect a specific timezone for more realistic analysis or data validation. + +To convert the timezone of **all** timestamps in the package, update the `shopify_timezone` variable to your target zone in IANA Database format: +```yml +# dbt_project.yml + +vars: + shopify_timezone: "America/New_York" # Replace with your timezone +``` + +## (Optional) Step 6: Additional configurations
Expand to view configurations ### Passing Through Additional Fields @@ -110,7 +129,7 @@ vars:
-## (Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Core™ +## (Optional) Step 7: Orchestrate your models with Fivetran Transformations for dbt Core™
Expand to view details
From c00e482286895e52efcfef2d7669c85b495eaeeb Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 27 Jan 2023 14:48:07 -0800 Subject: [PATCH 104/137] udpate package version --- README.md | 2 +- dbt_project.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b145c4e..71760c4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ If you are **not** using the [Shopify transformation package](https://github.co ```yml packages: - package: fivetran/shopify_source - version: [">=0.7.0", "<0.8.0"] + version: [">=0.8.0", "<0.9.0"] ``` ## Step 3: Define database and schema variables diff --git a/dbt_project.yml b/dbt_project.yml index 2ba07b4..0785bee 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'shopify_source' -version: '0.7.0' +version: '0.8.0' config-version: 2 require-dbt-version: [">=1.3.0", "<2.0.0"] models: From 5991109c366dd4010327e4f08ada548e11bfe40d Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 27 Jan 2023 15:48:27 -0800 Subject: [PATCH 105/137] specificy currencies everywhere --- DECISIONLOG.md | 2 +- models/src_shopify.yml | 40 +++++++++++++++++++--------------------- models/stg_shopify.yml | 34 +++++++++++++++++----------------- 3 files changed, 37 insertions(+), 39 deletions(-) diff --git a/DECISIONLOG.md b/DECISIONLOG.md index dc9257c..d4653ab 100644 --- a/DECISIONLOG.md +++ b/DECISIONLOG.md @@ -12,7 +12,7 @@ Thus, the source package will create empty (1 row of all `NULL` fields) staging ## Keeping Deleted Entities -todo - not filtering out _fivetran_deleted in staging models. when joining these tables together in the transform package, bring in _fivetran_deleted as is__deleted +Instead of automatically filtering out records where `_fivetran_deleted` is `true`, the package keeps these soft-deleted records, as they may persist as foreign keys in other tables. The package merely renames the deleted-flag to `is_deleted`, which you can filter out if you choose. ## Accepted Value Test Severity diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 99cf1db..456c601 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -122,7 +122,7 @@ sources: - name: source_name description: Where the order originated. Can be set only during order creation, and is not writeable afterwards. - name: subtotal_price - description: The price of the order in the shop currency after discounts but before shipping, taxes, and tips. + description: The price of the order in the shop currency after discounts but before shipping, taxes, and tips in the shop currency. - name: taxes_included description: Whether taxes are included in the order subtotal. - name: test @@ -136,7 +136,7 @@ sources: - name: total_price description: The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive. - name: total_tax - description: The sum of all the taxes applied to the order in th shop currency. Must be positive). + description: The sum of all the taxes applied to the order in th shop currency. Must be positive. - name: total_weight description: The sum of all line item weights in grams. - name: updated_at @@ -321,17 +321,15 @@ sources: - name: restock_type description: How this refund line item affects inventory levels. - name: subtotal - description: Subtotal amount of the order line refund + description: Subtotal amount of the order line refund in shop currency. - name: total_tax - description: The total tax applied to the refund. + description: The total tax applied to the refund in shop currency. - name: subtotal_set description: The subtotal of the refund line item in shop and presentment currencies. - name: total_tax_set description: The total tax of the line item in shop and presentment currencies. - name: subtotal_set description: The subtotal of the refund line item in shop and presentment currencies. - - name: total_tax_set - description: The total tax of the line item in shop and presentment currencies. - name: product identifier: "{{ var('shopify_product_identifier', 'product') }}" @@ -373,7 +371,7 @@ sources: - name: barcode description: The barcode, UPC, or ISBN number for the product. - name: compare_at_price - description: The original price of the item before an adjustment or a sale. + description: The original price of the item before an adjustment or a sale in shop currency. - name: created_at description: The date and time (ISO 8601 format) when the product variant was created. - name: fulfillment_service @@ -403,7 +401,7 @@ sources: - name: position description: The order of the product variant in the list of product variants. The first position in the list is 1. The position of variants is indicated by the order in which they are listed. - name: price - description: The price of the product variant. + description: The price of the product variant in shop currency. - name: product_id description: The unique numeric identifier for the product. - name: requires_shipping @@ -527,15 +525,15 @@ sources: - name: amount description: Amount of the adjustment. - name: tax_amount - description: Tax amount applied to the order adjustment. + description: Tax amount applied to the order adjustment in shop currency. - name: kind description: The kind of order adjustment (eg. refund, restock, etc.). - name: reason description: The reason for the order adjustment. - name: amount_set - description: Amount set towards the order adjustment + description: Amount set towards the order adjustment in shop and presentment currencies. - name: tax_amount_set - description: Tax amount set towards the order adjustment. + description: Tax amount set towards the order adjustment in shop and presentment currencies. - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -648,7 +646,7 @@ sources: - name: source_name description: Where the checkout originated. Valid values include `web`, `pos`, `iphone`, `android`. - name: subtotal_price - description: The price of the checkout in presentment currency before shipping and taxes. + description: The price of the checkout in _presentment_ (customer) currency before shipping and taxes. - name: taxes_included description: Boolean representing whether taxes are included in the price. - name: token @@ -658,11 +656,11 @@ sources: - name: total_duties description: The total duties of the checkout in presentment currency. - name: total_line_items_price - description: The sum of the prices of all line items in the checkout in presentment currency. + description: The sum of the prices of all line items in the checkout in _presentment_ (customer) currency. - name: total_price - description: The sum of line item prices, all discounts, shipping costs, and taxes for the checkout in presentment currency. + description: The sum of line item prices, all discounts, shipping costs, and taxes for the checkout in _presentment_ (customer) currency. - name: total_tax - description: The sum of all the taxes applied to the checkout in presentment currency. + description: The sum of all the taxes applied to the checkout in _presentment_ (customer) currency. - name: total_weight description: The sum of all the weights in grams of the line items in the checkout. - name: updated_at @@ -969,9 +967,9 @@ sources: - name: delivery_category description: The general classification of the delivery method. - name: discounted_price - description: The pre-tax shipping price with discounts applied. + description: The pre-tax shipping price with discounts applied in the shop currency. - name: discounted_price_set - description: The pre-tax shipping price with discounts applied (JSON). + description: The pre-tax shipping price with discounts applied (JSON) in presentment and shop currencies. - name: id description: A globally-unique identifier. - name: order_id @@ -979,9 +977,9 @@ sources: - name: phone description: The phone number at the shipping address. - name: price - description: Returns the price of the shipping line. + description: Returns the price of the shipping line in shop currency. - name: price_set - description: Returns the price of the shipping line (JSON). + description: Returns the price of the shipping line (JSON) in presentment and shop currencies. - name: requested_fulfillment_service_id description: The fulfillment service requested for the shipping method. Present if the shipping method requires processing by a third party fulfillment service. - name: source @@ -1356,13 +1354,13 @@ sources: - name: delivery_expectation_type description: Type of expected delivery. - name: discounted_price - description: The pre-tax shipping price with discounts applied. + description: The pre-tax shipping price with discounts applied in _presentment_ (customer) currency. - name: id description: Unique ID of the abandoned checkout shipping line. - name: index description: Index of the line amongst shipping lines for this checkout. - name: original_shop_price - description: The pre-tax shipping price without any discounts applied. + description: The pre-tax shipping price without any discounts applied in _presentment_ (customer) currency. - name: phone description: The phone number at the shipping address. - name: price diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 48d791e..f816aad 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -77,9 +77,9 @@ models: - name: restock_type description: How this refund line item affects inventory levels. - name: subtotal - description: Subtotal amount of the order line refund + description: Subtotal amount of the order line refund in shop currency. - name: total_tax - description: The total tax applied to the refund. + description: The total tax applied to the refund in the shop currency. - name: source_relation description: "{{ doc('source_relation') }}" - name: subtotal_set @@ -331,11 +331,11 @@ models: - name: user_id description: The ID of the user logged into Shopify POS who processed the order, if applicable. - name: total_shipping_price_set - description: The total shipping price set for the order. + description: The total shipping price set for the order in presentment and shop currencies. - name: index description: The index associated with the order. - name: pre_tax_price - description: The total pre tax price of the order. + description: The total pre tax price of the order in shop currency. - name: checkout_token description: A unique value when referencing the checkout that's associated with the order. - name: is_inventory_confirmed @@ -424,7 +424,7 @@ models: - name: barcode description: The barcode, UPC, or ISBN number for the product. - name: compare_at_price - description: The original price of the item before an adjustment or a sale. + description: The original price of the item before an adjustment or a sale in shop currency - name: created_timestamp description: The date and time (ISO 8601 format) when the product variant was created. - name: fulfillment_service @@ -595,15 +595,15 @@ models: - name: amount description: Amount of the adjustment. - name: tax_amount - description: Tax amount applied to the order adjustment. + description: Tax amount applied to the order adjustment in the shop currency. - name: kind description: The kind of order adjustment (eg. refund, restock, etc.). - name: reason description: The reason for the order adjustment. - name: amount_set - description: Amount set towards the order adjustment + description: Amount set towards the order adjustment in presentment and shop currencies. - name: tax_amount_set - description: Tax amount set towards the order adjustment. + description: Tax amount set towards the order adjustment in the shop and presentment currencies. - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: source_relation @@ -723,7 +723,7 @@ models: - name: source_name description: Where the checkout originated. Valid values include `web`, `pos`, `iphone`, `android`. - name: subtotal_price - description: The price of the checkout in presentment currency before shipping and taxes. + description: The price of the checkout in _presentment_ (customer) currency before shipping and taxes. - name: has_taxes_included description: Boolean representing whether taxes are included in the price. - name: token @@ -733,11 +733,11 @@ models: - name: total_duties description: The total duties of the checkout in presentment currency. - name: total_line_items_price - description: The sum of the prices of all line items in the checkout in presentment currency. + description: The sum of the prices of all line items in the checkout in _presentment_ (customer) currency. - name: total_price - description: The sum of line item prices, all discounts, shipping costs, and taxes for the checkout in presentment currency. + description: The sum of line item prices, all discounts, shipping costs, and taxes for the checkout in _presentment_ (customer) currency. - name: total_tax - description: The sum of all the taxes applied to the checkout in presentment currency. + description: The sum of all the taxes applied to the checkout in _presentment_ (customer) currency. - name: total_weight description: The sum of all the weights in grams of the line items in the checkout. - name: updated_at @@ -1147,9 +1147,9 @@ models: - name: delivery_category description: The general classification of the delivery method. - name: discounted_price - description: The pre-tax shipping price with discounts applied. + description: The pre-tax shipping price with discounts applied in shop currency. - name: discounted_price_set - description: The pre-tax shipping price with discounts applied (JSON). + description: The pre-tax shipping price with discounts applied (JSON) in presentment and shop currencies. - name: order_shipping_line_id description: A globally-unique identifier. tests: @@ -1159,9 +1159,9 @@ models: - name: phone description: The phone number at the shipping address. - name: price - description: Returns the price of the shipping line. + description: Returns the price of the shipping line in shop currency. - name: price_set - description: Returns the price of the shipping line (JSON). + description: Returns the price of the shipping line (JSON) in shop and presentment currencies. - name: is_third_party_required description: The fulfillment service requested for the shipping method. Present if the shipping method requires processing by a third party fulfillment service. - name: source @@ -1640,7 +1640,7 @@ models: - name: delivery_expectation_type description: Type of expected delivery. - name: discounted_price - description: The pre-tax shipping price with discounts applied. + description: The pre-tax shipping price with discounts applied in _presentment_ (customer) currency. - name: abandoned_checkout_shipping_line_id description: Unique ID of the abandoned checkout shipping line. - name: index From 5533369cc12bd6c196c31d4463a521e8bcb6ba7d Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 27 Jan 2023 16:41:56 -0800 Subject: [PATCH 106/137] reformat changelog --- CHANGELOG.md | 29 ++++++++++------------------- README.md | 8 +++++--- integration_tests/dbt_project.yml | 2 +- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0169664..0550a91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,20 +3,13 @@ Lots of new features ahead!! We've revamped the package to keep up-to-date with new additions to the Shopify connector and feedback from the community. ## 🎉 Documentation and Feature Updates -[PR #41](https://github.com/fivetran/dbt_shopify_source/pull/41) includes the following change: -- Addition of the `shopify_timezone` variable, which converts ALL timestamps included in the package (including `_fivetran_synced`) to a single target timezone (in IANA Database format, ie "America/Los_Angeles"). - -[PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38) includes the following changes: -- Ensured Postgres compatibility. -- README updated for easier package use and navigation. -- `shopify__identifier` variables added if an individual source table has a different name than the package expects. - -[PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45) includes the following changes: -- Gets rid of the `shopify__using_order_adjustment`, `shopify__using_order_line_refund`, and `shopify__using_refund` variables. Instead, the package will automatically create empty versions of the related models until the source `refund`, `order_line_refund`, and `order_adjustment` tables exist in your schema. See DECISIONLOG for more. -- Creates the [DECISIONLOG](https://github.com/fivetran/dbt_shopify/blob/main/DECISIONLOG.md)! - -[PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) includes the following change: -- The declaration of passthrough variables within your root `dbt_project.yml` has changed. To allow for more flexibility and better tracking of passthrough columns, you will now want to define passthrough columns in the following format: +- Addition of the `shopify_timezone` variable, which converts ALL timestamps included in the package (including `_fivetran_synced`) to a single target timezone in IANA Database format, ie "America/Los_Angeles" ([PR #41](https://github.com/fivetran/dbt_shopify_source/pull/41)). +- Ensured Postgres compatibility ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)). +- `shopify__identifier` variables added if an individual source table has a different name than the package expects ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)). +- Gets rid of the `shopify__using_order_adjustment`, `shopify__using_order_line_refund`, and `shopify__using_refund` variables. Instead, the package will automatically create empty versions of the related models until the source `refund`, `order_line_refund`, and `order_adjustment` tables exist in your schema. See DECISIONLOG for more details ([PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45)). +- Creates the [DECISIONLOG](https://github.com/fivetran/dbt_shopify/blob/main/DECISIONLOG.md) ([PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45)). +- README updated for easier package use and navigation ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)). +- The declaration of passthrough variables within your root `dbt_project.yml` has changed (but is backwards compatible). To allow for more flexibility and better tracking of passthrough columns, you will now want to define passthrough columns in the following format ([PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40)): > This applies to all passthrough columns within the `dbt_shopify_source` package and not just the `customers_pass_through_columns` example. See the README for which models have passthrough columns. ```yml vars: @@ -25,9 +18,7 @@ vars: alias: "field_alias" # Optional: If you wish to alias the field within the staging model. transform_sql: "cast(field_alias as string)" # Optional: If you wish to define the datatype or apply a light transformation. ``` - -[PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39) and [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40) include the following changes: -- The following fields have been added to (➕) or removed from (➖) their respective staging models: +- The following fields have been added to (➕) or removed from (➖) their respective staging models ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39), [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40)): - `stg_shopify__order`: ➕ `total_discounts_set` ➕ `total_line_items_price_set` @@ -70,7 +61,7 @@ vars: - `stg_shopify__product_variant` ➖ `old_inventory_quantity` -> coalesced with `inventory_quantity` ➕ `inventory_quantity` -> coalesced with `old_inventory_quantity` -- The following source tables have been added to the package with respective staging models: +- The following source tables have been added to the package with respective staging models ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39)): - `abandoned_checkout` - `collection_product` - `collection` @@ -95,7 +86,7 @@ vars: - `order_discount_code` - `abandoned_checkout_shipping_line` ([(PR #47)](https://github.com/fivetran/dbt_shopify_source/pull/47) as well) - `fulfillment_event` -> This is NOT included by default. To include fulfillment events (used in the `shopify__daily_shop` model), set the `shopify_using_fulfillment_event` variable to `true` [(PR #48)](https://github.com/fivetran/dbt_shopify_source/pull/48) -- Adjusts the organization of the `get_
_columns()` macros. +- Adjusts the organization of the `get_
_columns()` macros ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39), [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40)). # dbt_shopify_source v0.7.0 ## 🚨 Breaking Changes 🚨: diff --git a/README.md b/README.md index 71760c4..2bdfb45 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ If you are **not** using the [Shopify transformation package](https://github.co ```yml packages: - package: fivetran/shopify_source - version: [">=0.8.0", "<0.9.0"] + version: [">=0.8.0", "<0.9.0"] # we recommend using ranges to capture non-breaking changes automatically ``` ## Step 3: Define database and schema variables @@ -57,7 +57,9 @@ vars: ## Step 4: Enable `fulfillment_event` data -The package takes into consideration that not every Shopify connector may have `fulfillment_event` data enabled. However, this table does hold valuable information that is leveraged in the `shopify__daily_shop` model in the transformation package. `fulfillment_event` data is **disabled by default**. Add the following variable to your `dbt_project.yml` file to enable modelling of fulfillment events: +The package takes into consideration that not every Shopify connector may have `fulfillment_event` data enabled. However, this table does hold valuable information that is leveraged in the `shopify__daily_shop` model in the transformation package. `fulfillment_event` data is **disabled by default**. + +Add the following variable to your `dbt_project.yml` file to enable the modeling of fulfillment events: ```yml # dbt_project.yml @@ -68,7 +70,7 @@ vars: ## Step 5: Setting your timezone By default, the data in your Shopify schema is in UTC. However, you may want reporting to reflect a specific timezone for more realistic analysis or data validation. -To convert the timezone of **all** timestamps in the package, update the `shopify_timezone` variable to your target zone in IANA Database format: +To convert the timezone of **all** timestamps in the package, update the `shopify_timezone` variable to your target zone in [IANA tz Database format](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones): ```yml # dbt_project.yml diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 6dc0a16..4fe7ace 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'shopify_source_integration_tests' -version: '0.7.0' +version: '0.8.0' profile: 'integration_tests' config-version: 2 From b35149012877c1dd70f9b618f0d605d9a97fa261 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 27 Jan 2023 17:32:21 -0800 Subject: [PATCH 107/137] Docs --- CHANGELOG.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0550a91..40e216c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,15 +2,20 @@ Lots of new features ahead!! We've revamped the package to keep up-to-date with new additions to the Shopify connector and feedback from the community. -## 🎉 Documentation and Feature Updates -- Addition of the `shopify_timezone` variable, which converts ALL timestamps included in the package (including `_fivetran_synced`) to a single target timezone in IANA Database format, ie "America/Los_Angeles" ([PR #41](https://github.com/fivetran/dbt_shopify_source/pull/41)). +## Documentation +- Created the [DECISIONLOG](https://github.com/fivetran/dbt_shopify_source/blob/main/DECISIONLOG.md) to log discussions and opinionated stances we took in designing the package ([PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45)). +- README updated for easier package use and navigation ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)). + +## Under the Hood - Ensured Postgres compatibility ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)). +- Got rid of the `shopify__using_order_adjustment`, `shopify__using_order_line_refund`, and `shopify__using_refund` variables. Instead, the package will automatically create empty versions of the related models until the source `refund`, `order_line_refund`, and `order_adjustment` tables exist in your schema. See DECISIONLOG for more details ([PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45)). +- Adjusts the organization of the `get_
_columns()` macros ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39), [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40)). + +## Feature Updates +- Addition of the `shopify_timezone` variable, which converts ALL timestamps included in the package (including `_fivetran_synced`) to a single target timezone in IANA Database format, ie "America/Los_Angeles" ([PR #41](https://github.com/fivetran/dbt_shopify_source/pull/41)). - `shopify__identifier` variables added if an individual source table has a different name than the package expects ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)). -- Gets rid of the `shopify__using_order_adjustment`, `shopify__using_order_line_refund`, and `shopify__using_refund` variables. Instead, the package will automatically create empty versions of the related models until the source `refund`, `order_line_refund`, and `order_adjustment` tables exist in your schema. See DECISIONLOG for more details ([PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45)). -- Creates the [DECISIONLOG](https://github.com/fivetran/dbt_shopify/blob/main/DECISIONLOG.md) ([PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45)). -- README updated for easier package use and navigation ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)). - The declaration of passthrough variables within your root `dbt_project.yml` has changed (but is backwards compatible). To allow for more flexibility and better tracking of passthrough columns, you will now want to define passthrough columns in the following format ([PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40)): -> This applies to all passthrough columns within the `dbt_shopify_source` package and not just the `customers_pass_through_columns` example. See the README for which models have passthrough columns. +> This applies to all passthrough columns within the `dbt_shopify_source` package and not just the `customer_pass_through_columns` example. See the README for which models have passthrough columns. ```yml vars: customer_pass_through_columns: @@ -86,7 +91,6 @@ vars: - `order_discount_code` - `abandoned_checkout_shipping_line` ([(PR #47)](https://github.com/fivetran/dbt_shopify_source/pull/47) as well) - `fulfillment_event` -> This is NOT included by default. To include fulfillment events (used in the `shopify__daily_shop` model), set the `shopify_using_fulfillment_event` variable to `true` [(PR #48)](https://github.com/fivetran/dbt_shopify_source/pull/48) -- Adjusts the organization of the `get_
_columns()` macros ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39), [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40)). # dbt_shopify_source v0.7.0 ## 🚨 Breaking Changes 🚨: From b5dec02cac08f06af0705e12eb315be2cbbb1156 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Fri, 27 Jan 2023 17:37:03 -0800 Subject: [PATCH 108/137] buildkite --- macros/get_product_variant_columns.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/macros/get_product_variant_columns.sql b/macros/get_product_variant_columns.sql index 5738745..f3fa664 100644 --- a/macros/get_product_variant_columns.sql +++ b/macros/get_product_variant_columns.sql @@ -19,6 +19,7 @@ {"name": "taxable", "datatype": "boolean"}, {"name": "barcode", "datatype": dbt.type_string()}, {"name": "grams", "datatype": dbt.type_float()}, + {"name": "old_inventory_quantity", "datatype": dbt.type_numeric()}, {"name": "inventory_quantity", "datatype": dbt.type_numeric()}, {"name": "weight", "datatype": dbt.type_float()}, {"name": "weight_unit", "datatype": dbt.type_string()}, From 7a84a20eab3a0b4761d680e38dcfe819996bb10a Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Fri, 27 Jan 2023 21:52:13 -0600 Subject: [PATCH 109/137] update ymls --- integration_tests/dbt_project.yml | 2 +- models/src_shopify.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 4fe7ace..1632c85 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -9,7 +9,7 @@ vars: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" shopify_order_line_identifier: "shopify_order_line_data" - order_source: "{{ ref('shopify_order_data') }}" + order_source: "shopify_order_data" shopify_product_identifier: "shopify_product_data" shopify_order_adjustment_identifier: "shopify_order_adjustment_data" shopify_product_variant_identifier: "shopify_product_variant_data" diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 456c601..8cacec5 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -7,9 +7,9 @@ sources: tables: - name: order description: Each record represents an order in Shopify. - identifier: "{%- if target.type == 'snowflake' -%} ORDER {%- else -%} order {%- endif -%}" - quoting: - identifier: true + identifier: > + {% if target.type == 'snowflake' %}{{ var('shopify_order_identifier', '"ORDER"') }} + {% else %}{{ var('shopify_order_identifier', 'order') }}{% endif %} columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" From 4748fd6746d505b4d6e5003cb3fb01963f75a0b1 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Fri, 27 Jan 2023 22:10:48 -0600 Subject: [PATCH 110/137] update yml --- models/src_shopify.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/models/src_shopify.yml b/models/src_shopify.yml index ac9ec9c..234e4d8 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -1432,6 +1432,7 @@ sources: - name: tax_line description: Represents a single tax applied to the associated line item. + identifier: "{{ var('shopify_tax_line_identifier', 'tax_line') }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" From 9b6056f51abe23fe4ac67a78b39770aa4a21aa49 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Fri, 27 Jan 2023 22:21:37 -0600 Subject: [PATCH 111/137] update yml --- integration_tests/dbt_project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index b73d4f5..10cc1a6 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -9,7 +9,7 @@ vars: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" shopify_order_line_identifier: "shopify_order_line_data" - order_source: "shopify_order_data" + shopify_order_identifier: "shopify_order_data" shopify_product_identifier: "shopify_product_data" shopify_order_adjustment_identifier: "shopify_order_adjustment_data" shopify_product_variant_identifier: "shopify_product_variant_data" From 61a60b7f3d29d9085669c5f52fe7fb9e2bc9f0ce Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 30 Jan 2023 14:53:04 -0600 Subject: [PATCH 112/137] update yml --- models/src_shopify.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 234e4d8..11b42b7 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -8,8 +8,10 @@ sources: - name: order description: Each record represents an order in Shopify. identifier: > - {% if target.type == 'snowflake' %}{{ var('shopify_order_identifier', '"ORDER"') }} - {% else %}{{ var('shopify_order_identifier', 'order') }}{% endif %} + {% if target.type == 'snowflake' %}{{ var('shopify_order_identifier', 'ORDER') }} + {%- else %}{{ var('shopify_order_identifier', 'order') }}{% endif %} + quoting: + identifier: true columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" From 458f3f2e9008a69134fab58687c1c35c050af712 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:04:39 -0600 Subject: [PATCH 113/137] update yml --- models/src_shopify.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 11b42b7..f49c2b8 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -8,10 +8,10 @@ sources: - name: order description: Each record represents an order in Shopify. identifier: > - {% if target.type == 'snowflake' %}{{ var('shopify_order_identifier', 'ORDER') }} + {% if target.type == 'snowflake' %}{{ var('shopify_order_identifier', '"ORDER"') }} {%- else %}{{ var('shopify_order_identifier', 'order') }}{% endif %} quoting: - identifier: true + identifier: "{% false if target.type == 'snowflake' else true %}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" From 48868f5f431ac9c04d497f161ca85681af07f5cf Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:20:59 -0600 Subject: [PATCH 114/137] update yml --- models/src_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/src_shopify.yml b/models/src_shopify.yml index f49c2b8..a3615a9 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -11,7 +11,7 @@ sources: {% if target.type == 'snowflake' %}{{ var('shopify_order_identifier', '"ORDER"') }} {%- else %}{{ var('shopify_order_identifier', 'order') }}{% endif %} quoting: - identifier: "{% false if target.type == 'snowflake' else true %}" + identifier: "{{ false if target.type == 'snowflake' else true }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" From 3b7d025f07be9834ac7925d570ae877c4f567933 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 30 Jan 2023 14:31:39 -0800 Subject: [PATCH 115/137] Typos --- CHANGELOG.md | 3 ++- README.md | 2 +- models/stg_shopify.yml | 12 +----------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40e216c..c54167a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,7 @@ vars: ➕ `customer_locale` ➕ `order_status_url` ➕ `presentment_currency` - ➕ `is_inventory_confirmed` + ➕ `is_confirmed` - `stg_shopify__customer`: ➕ `note` ➕ `lifetime_duration` @@ -89,6 +89,7 @@ vars: - `tender_transaction` - `abandoned_checkout_discount_code` - `order_discount_code` + - `tax_line` - `abandoned_checkout_shipping_line` ([(PR #47)](https://github.com/fivetran/dbt_shopify_source/pull/47) as well) - `fulfillment_event` -> This is NOT included by default. To include fulfillment events (used in the `shopify__daily_shop` model), set the `shopify_using_fulfillment_event` variable to `true` [(PR #48)](https://github.com/fivetran/dbt_shopify_source/pull/48) diff --git a/README.md b/README.md index 2bdfb45..a8b0aad 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

+ href="https://github.com/fivetran/dbt_shopify_source/blob/main/LICENSE"> diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index f816aad..d779111 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -140,7 +140,7 @@ models: - name: pre_tax_price description: The pre tax preice of the line item in shop currency. - name: pre_tax_price_set - description: he pre tax preice of the line item in shop currency and presentment currency. + description: The pre tax preice of the line item in shop currency and presentment currency. - name: price_set description: The price of the line item in shop and presentment currencies. - name: tax_code @@ -332,14 +332,8 @@ models: description: The ID of the user logged into Shopify POS who processed the order, if applicable. - name: total_shipping_price_set description: The total shipping price set for the order in presentment and shop currencies. - - name: index - description: The index associated with the order. - - name: pre_tax_price - description: The total pre tax price of the order in shop currency. - name: checkout_token description: A unique value when referencing the checkout that's associated with the order. - - name: is_inventory_confirmed - description: Whether inventory has been reserved for the order. - name: customer_locale description: A two-letter or three-letter language code, optionally followed by a region modifier. - name: is_deleted @@ -354,8 +348,6 @@ models: description: The total shipping price of the order, excluding discounts and returns, in shop and presentment currencies. If taxes_included is set to true, then total_shipping_price_set includes taxes. - name: total_discounts_set description: The total discounts applied to the price of the order in shop and presentment currencies. - - name: subtotal_price_set - description: The subtotal of the order in shop and presentment currencies after discounts but before shipping, duties, taxes, and tips. - name: presentment_currency description: The presentment currency that was used to display prices to the customer. - name: source_relation @@ -1645,8 +1637,6 @@ models: description: Unique ID of the abandoned checkout shipping line. - name: index description: Index of the line amongst shipping lines for this checkout. - - name: original_shop_price - description: The pre-tax shipping price without any discounts applied. - name: phone description: The phone number at the shipping address. - name: price From 3a67ab6d452e231130898967932de5ccb5dee8ce Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 30 Jan 2023 14:34:02 -0800 Subject: [PATCH 116/137] changelog formatting --- CHANGELOG.md | 70 ++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c54167a..1ff9538 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,47 +25,47 @@ vars: ``` - The following fields have been added to (➕) or removed from (➖) their respective staging models ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39), [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40)): - `stg_shopify__order`: - ➕ `total_discounts_set` - ➕ `total_line_items_price_set` - ➕ `total_price_usd` - ➕ `total_price_set` - ➕ `total_tax_set` - ➕ `total_tip_received` - ➕ `is_deleted` - ➕ `app_id` - ➕ `checkout_id` - ➕ `client_details_user_agent` - ➕ `customer_locale` - ➕ `order_status_url` - ➕ `presentment_currency` - ➕ `is_confirmed` + - ➕ `total_discounts_set` + - ➕ `total_line_items_price_set` + - ➕ `total_price_usd` + - ➕ `total_price_set` + - ➕ `total_tax_set` + - ➕ `total_tip_received` + - ➕ `is_deleted` + - ➕ `app_id` + - ➕ `checkout_id` + - ➕ `client_details_user_agent` + - ➕ `customer_locale` + - ➕ `order_status_url` + - ➕ `presentment_currency` + - ➕ `is_confirmed` - `stg_shopify__customer`: - ➕ `note` - ➕ `lifetime_duration` - ➕ `currency` - ➕ `marketing_consent_state` (coalescing of `email_marketing_consent_state` and deprecated `accepts_marketing` field) - ➕ `marketing_opt_in_level` (coalescing of `email_marketing_consent_opt_in_level` and deprecated `marketing_opt_in_level` field) - ➕ `marketing_consent_updated_at` (coalescing of `email_marketing_consent_consent_updated_at` and deprecated `accepts_marketing_updated_at` field) - ➖ `accepts_marketing`/`has_accepted_marketing` - ➖ `accepts_marketing_updated_at` - ➖ `marketing_opt_in_level` + - ➕ `note` + - ➕ `lifetime_duration` + - ➕ `currency` + - ➕ `marketing_consent_state` (coalescing of `email_marketing_consent_state` and deprecated `accepts_marketing` field) + - ➕ `marketing_opt_in_level` (coalescing of `email_marketing_consent_opt_in_level` and deprecated `marketing_opt_in_level` field) + - ➕ `marketing_consent_updated_at` (coalescing of `email_marketing_consent_consent_updated_at` and deprecated `accepts_marketing_updated_at` field) + - ➖ `accepts_marketing`/`has_accepted_marketing` + - ➖ `accepts_marketing_updated_at` + - ➖ `marketing_opt_in_level` - `stg_shopify__order_line_refund`: - ➕ `subtotal_set` - ➕ `total_tax_set` + - ➕ `subtotal_set` + - ➕ `total_tax_set` - `stg_shopify__order_line`: - ➕ `pre_tax_price_set` - ➕ `price_set` - ➕ `tax_code` - ➕ `total_discount_set` - ➕ `variant_title` - ➕ `variant_inventory_management` - ➕ `properties` + - ➕ `pre_tax_price_set` + - ➕ `price_set` + - ➕ `tax_code` + - ➕ `total_discount_set` + - ➕ `variant_title` + - ➕ `variant_inventory_management` + - ➕ `properties` ( ) `is_requiring_shipping` is renamed to `is_shipping_required` - `stg_shopify__product`: - ➕ `status` + - ➕ `status` - `stg_shopify__product_variant` - ➖ `old_inventory_quantity` -> coalesced with `inventory_quantity` - ➕ `inventory_quantity` -> coalesced with `old_inventory_quantity` + - ➖ `old_inventory_quantity` -> coalesced with `inventory_quantity` + - ➕ `inventory_quantity` -> coalesced with `old_inventory_quantity` - The following source tables have been added to the package with respective staging models ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39)): - `abandoned_checkout` - `collection_product` From 6f8307f3bddff8589a8397e92b8e4a488694e0b5 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 30 Jan 2023 14:35:48 -0800 Subject: [PATCH 117/137] changeloeg --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ff9538..01354fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,7 +60,7 @@ vars: - ➕ `variant_title` - ➕ `variant_inventory_management` - ➕ `properties` - ( ) `is_requiring_shipping` is renamed to `is_shipping_required` + - ( ) `is_requiring_shipping` is renamed to `is_shipping_required` - `stg_shopify__product`: - ➕ `status` - `stg_shopify__product_variant` @@ -91,7 +91,7 @@ vars: - `order_discount_code` - `tax_line` - `abandoned_checkout_shipping_line` ([(PR #47)](https://github.com/fivetran/dbt_shopify_source/pull/47) as well) - - `fulfillment_event` -> This is NOT included by default. To include fulfillment events (used in the `shopify__daily_shop` model), set the `shopify_using_fulfillment_event` variable to `true` [(PR #48)](https://github.com/fivetran/dbt_shopify_source/pull/48) + - `fulfillment_event` -> This is NOT included by default. To include fulfillment events (used in the `shopify__daily_shop` model), set the `shopify_using_fulfillment_event` variable to `true` ([PR #48](https://github.com/fivetran/dbt_shopify_source/pull/48)) # dbt_shopify_source v0.7.0 ## 🚨 Breaking Changes 🚨: From 68414f836a492dc2e66c3e8a483b825b531da19c Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 30 Jan 2023 14:54:28 -0800 Subject: [PATCH 118/137] soruces are docmented --- models/src_shopify.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/models/src_shopify.yml b/models/src_shopify.yml index a3615a9..d91abb9 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -159,7 +159,33 @@ sources: description: "{{ doc('_fivetran_deleted') }}" - name: total_tip_received description: The sum of all the tips in the order in the shop currency. - + - name: device_id + description: The ID for the device. + - name: presentment_currency + description: The presentment currency that was used to display prices to the customer. + - name: total_shipping_price_set + description: The total shipping price set for the order in presentment and shop currencies. + - name: client_details_user_agent + description: Details of the browsing client, including software and operating versions. + - name: total_tax_set + description: The total tax applied to the order in shop and presentment currencies. + - name: total_shipping_price_set + description: The total shipping price of the order, excluding discounts and returns, in shop and presentment currencies. If taxes_included is set to true, then total_shipping_price_set includes taxes. + - name: total_discounts_set + description: The total discounts applied to the price of the order in shop and presentment currencies. + - name: total_line_items_price_set + description: The total of all line item prices in shop and presentment currencies. + - name: total_price_set + description: The total price of the order in shop and presentment currencies. + - name: total_price_usd + description: The sum of all line item prices, discounts, shipping, taxes, and tips in USD. Must be positive. + - name: is_confirmed + description: Whether the order is confirmed. + - name: current_total_price + description: The current total price of the order in the shop currency. The value of this field reflects order edits, returns, and refunds. + - name: source_identifier + description: The ID of the order placed on the originating platform. This value doesn't correspond to the Shopify ID that's generated from a completed draft. + - name: customer identifier: "{{ var('shopify_customer_identifier', 'customer') }}" description: Each record represents a customer in Shopify. @@ -212,6 +238,7 @@ sources: description: A note about the customer. - name: currency description: The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order. Defaults to the shop currency. Returns the shop currency for test orders. + - name: order_line identifier: "{{ var('shopify_order_line_identifier', 'order_line') }}" description: Each record represents a line item for an order in Shopify. @@ -304,6 +331,9 @@ sources: description: The two-letter abbreviation for the region of the item's supplier. - name: origin_location_zip description: The zip of the item's supplier. + - name: tax_code + descripton: Tax code applied to the line item. As multiple taxes can apply to a line item, we recommend referring to `stg_shopify__tax_line`. + - name: order_line_refund identifier: "{{ var('shopify_order_line_refund_identifier', 'order_line_refund') }}" description: Each record represents a line item refund in Shopify. From b70523631d0e73d9f5f7a59566bf20fcfe169e04 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:01:57 -0800 Subject: [PATCH 119/137] databricks buildkite --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 2f88bb2..e48ad7c 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_tests_3 + schema: shopify_source_integration_tests_4 ➖ ➖ threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_tests_3 + schema: shopify_source_integration_tests_4 ➖ ➖ threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_tests_3 + schema: shopify_source_integration_tests_4 ➖ ➖ threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_tests_3 + schema: shopify_source_integration_tests_4 ➖ ➖ threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_tests_3 + schema: shopify_source_integration_tests_4 ➖ ➖ threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 10cc1a6..bac7737 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,7 +4,7 @@ profile: 'integration_tests' config-version: 2 vars: - shopify_schema: shopify_source_integration_tests_3 + shopify_schema: shopify_source_integration_tests_4 shopify_source: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" From b4fc767631a7325819df1bddd657b4816123e189 Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Mon, 30 Jan 2023 21:20:58 -0600 Subject: [PATCH 120/137] removal of minus signs in profiles --- integration_tests/ci/sample.profiles.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index e48ad7c..eab25b6 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_tests_4 ➖ ➖ + schema: shopify_source_integration_tests_4 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_tests_4 ➖ ➖ + schema: shopify_source_integration_tests_4 threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_tests_4 ➖ ➖ + schema: shopify_source_integration_tests_4 threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_tests_4 ➖ ➖ + schema: shopify_source_integration_tests_4 threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_tests_4 ➖ ➖ + schema: shopify_source_integration_tests_4 threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks From 9f935a5d65888e7ee98c240c7aa2b51d4827a5eb Mon Sep 17 00:00:00 2001 From: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> Date: Mon, 30 Jan 2023 21:45:46 -0600 Subject: [PATCH 121/137] Update integration_tests/dbt_project.yml --- integration_tests/dbt_project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 6dc0a16..ecbdcd6 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,7 +4,7 @@ profile: 'integration_tests' config-version: 2 vars: - shopify_schema: shopify_source_integration_tests_2 + shopify_schema: shopify_source_integration_tests_4 shopify_source: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data" From bb0099b3bee19e30a480ae6acb213f042c7be127 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 09:31:56 -0800 Subject: [PATCH 122/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index d779111..f7f53b8 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -144,7 +144,7 @@ models: - name: price_set description: The price of the line item in shop and presentment currencies. - name: tax_code - descripton: Tax code applied to the line item. As multiple taxes can apply to a line item, we recommend referring to `stg_shopify__tax_line`. + description: Tax code applied to the line item. As multiple taxes can apply to a line item, we recommend referring to `stg_shopify__tax_line`. - name: total_discount_set description: The total amount allocated to the line item in the presentment currency. - name: variant_title From cb60d200fb8e5a38b158bedd8832dbec00758b52 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 09:33:33 -0800 Subject: [PATCH 123/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index f7f53b8..f2a3847 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -138,7 +138,7 @@ models: - name: index description: Index of the order line. - name: pre_tax_price - description: The pre tax preice of the line item in shop currency. + description: The pre tax price of the line item in shop currency. - name: pre_tax_price_set description: The pre tax preice of the line item in shop currency and presentment currency. - name: price_set From 6eceeb28d49f92ead38ced7aadba006111634456 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 09:33:41 -0800 Subject: [PATCH 124/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index f2a3847..cc7afdb 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -140,7 +140,7 @@ models: - name: pre_tax_price description: The pre tax price of the line item in shop currency. - name: pre_tax_price_set - description: The pre tax preice of the line item in shop currency and presentment currency. + description: The pre tax price of the line item in shop currency and presentment currency. - name: price_set description: The price of the line item in shop and presentment currencies. - name: tax_code From 471be5ce74631b11208f86ae272bf97da07be058 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 09:39:00 -0800 Subject: [PATCH 125/137] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01354fa..8540d59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ Lots of new features ahead!! We've revamped the package to keep up-to-date with new additions to the Shopify connector and feedback from the community. +This release does include 🚨 **Breaking Changes** 🚨. + ## Documentation - Created the [DECISIONLOG](https://github.com/fivetran/dbt_shopify_source/blob/main/DECISIONLOG.md) to log discussions and opinionated stances we took in designing the package ([PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45)). - README updated for easier package use and navigation ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)). From b60215e273a11cb7c9002e3b09bab51933b5f769 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:13:28 -0800 Subject: [PATCH 126/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 7e119ac..04891a7 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -14,7 +14,7 @@ models: - name: marketing_consent_state description: > Field indicating if the customer has consented to receive marketing material via email. Coalescing of the new `email_marketing_consent_state` - field and the deprected `accepts_marketing` field. Records with the old field will be marked with '(legacy)'. + field and the deprecated `accepts_marketing` field. Records with the old field will be marked with '(legacy)'. - name: marketing_opt_in_level description: The marketing subscription opt-in level, as described in the M3AAWG Sender Best Common Practices, that the customer gave when they consented to receive marketing material by email. - name: marketing_consent_updated_at From f9b729e5501c294a04a883c3c242360bd90a2328 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:13:38 -0800 Subject: [PATCH 127/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 04891a7..653bd38 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -682,7 +682,7 @@ models: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: rule_logic - description: Whether the `rules` are disjuctive (logical `OR`) or conjunctive (logical `AND`) + description: Whether the `rules` are disjunctive (logical `OR`) or conjunctive (logical `AND`) - name: handle description: A unique, human-readable string for the collection automatically generated from its title. This is used in themes by the Liquid templating language to refer to the collection. - name: collection_id From 55dec39031f9b43633a0f7db0c05863a1794c936 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:14:27 -0800 Subject: [PATCH 128/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 653bd38..28aa205 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -1344,7 +1344,7 @@ models: - name: plan_name description: The name of the Shopify plan the shop is on. - name: is_pre_launch_enabled - description: Boolen representing whether the pre-launch page is enabled on the shop's online store. + description: Boolean representing whether the pre-launch page is enabled on the shop's online store. - name: primary_locale description: The shop's primary locale, as configured in the language settings of the shop's theme. - name: province From 484c20c46687fdb10920545ca9885bbca39125c2 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:14:54 -0800 Subject: [PATCH 129/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 28aa205..dc23c52 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -704,7 +704,7 @@ models: See the [Shopify docs](https://shopify.dev/api/admin-rest/2022-10/resources/smartcollection#resource-object) for more. - name: sort_order description: > - The order of the products in the collection. Valid values inclide + The order of the products in the collection. Valid values incline - `alpha-asc`: The products are sorted alphabetically from A to Z. - `alpha-des`: The products are sorted alphabetically from Z to A. - `best-selling`: The products are sorted by number of sales. From 3739d262f66644986796df29fd74ed561c25d7d2 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:18:21 -0800 Subject: [PATCH 130/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index dc23c52..3e0e5e7 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -807,7 +807,7 @@ models: - confirmed: The carrier is aware of the shipment, but hasn't received it yet. - in_transit: The shipment is being transported between shipping facilities on the way to its destination. - out_for_delivery: The shipment is being delivered to its final destination. - - delivered: The shipment was succesfully delivered. + - delivered: The shipment was successfully delivered. - failure: Something went wrong when pulling tracking information for the shipment, such as the tracking number was invalid or the shipment was canceled. - name: status description: > From d0e8aa3036041c541e53f8113bd5837d654842d0 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:18:28 -0800 Subject: [PATCH 131/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 3e0e5e7..01882b2 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -699,7 +699,7 @@ models: description: > An array of rules that define what products go into the smart collection. Each rule (`column` -- `relation` --> `condition`) has these properties: - `column`: the property of a product being used to populate the smart collection. Ex: 'tag', 'type', 'vendor', 'variant_price', etc. - - `relation`: The comparitive relationship between the column choice, and the condition ('equals', 'contains', 'greater_than', etc.) + - `relation`: The comparative relationship between the column choice, and the condition ('equals', 'contains', 'greater_than', etc.) - condition: Select products for a smart collection using a condition. Values are either strings or numbers, depending on the relation value. See the [Shopify docs](https://shopify.dev/api/admin-rest/2022-10/resources/smartcollection#resource-object) for more. - name: sort_order From 942a8a1778af74d7648c364faf9dbe25ab11ea1d Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:18:36 -0800 Subject: [PATCH 132/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 01882b2..6486311 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -1247,7 +1247,7 @@ models: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: index - description: Index (starting from 1) represnting when the tag was placed on the product. + description: Index (starting from 1) representing when the tag was placed on the product. tests: - not_null - name: product_id From 46a3c9baa1542ec6c4ce7be7ad3152a701417099 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:25:14 -0800 Subject: [PATCH 133/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index 6486311..fdb5caf 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -1067,7 +1067,7 @@ models: tests: - not_null - name: order_shipping_line_id - description: ID of the order shipping line this recod is associated with. + description: ID of the order shipping line this record is associated with. tests: - not_null - name: price From 2cadc2e968284aedd098e57c5a9c3a8f18c11333 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:25:22 -0800 Subject: [PATCH 134/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index fdb5caf..b3554be 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -730,7 +730,7 @@ models: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: index - description: Index (starting from 1) represnting when the tag was placed on the customer. + description: Index (starting from 1) representing when the tag was placed on the customer. tests: - not_null - name: customer_id From 428b2b1e3d3c77d3423efdc29c9678971d60d79e Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:25:35 -0800 Subject: [PATCH 135/137] Update models/stg_shopify.yml Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- models/stg_shopify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index b3554be..df09ebb 100644 --- a/models/stg_shopify.yml +++ b/models/stg_shopify.yml @@ -1091,7 +1091,7 @@ models: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" - name: index - description: Index (starting from 1) represnting when the tag was placed on the order. + description: Index (starting from 1) representing when the tag was placed on the order. tests: - not_null - name: order_id From 8e631b2f36a01dc534199135082936d689725269 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 11:21:37 -0800 Subject: [PATCH 136/137] kick off buildkite --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8540d59..18d5402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ Lots of new features ahead!! We've revamped the package to keep up-to-date with new additions to the Shopify connector and feedback from the community. -This release does include 🚨 **Breaking Changes** 🚨. +This release includes 🚨 **Breaking Changes** 🚨. ## Documentation - Created the [DECISIONLOG](https://github.com/fivetran/dbt_shopify_source/blob/main/DECISIONLOG.md) to log discussions and opinionated stances we took in designing the package ([PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45)). From b847ce9765b63fc985d952d0f454071ce0275477 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com> Date: Tue, 31 Jan 2023 11:48:28 -0800 Subject: [PATCH 137/137] buildkite needs new schema --- integration_tests/ci/sample.profiles.yml | 10 +++++----- integration_tests/dbt_project.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index eab25b6..5e5bbad 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: shopify_source_integration_tests_4 + schema: shopify_source_integration_tests_5 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integration_tests_4 + schema: shopify_source_integration_tests_5 threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: shopify_source_integration_tests_4 + schema: shopify_source_integration_tests_5 threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: shopify_source_integration_tests_4 + schema: shopify_source_integration_tests_5 threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: shopify_source_integration_tests_4 + schema: shopify_source_integration_tests_5 threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index bac7737..9de6bb3 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,7 +4,7 @@ profile: 'integration_tests' config-version: 2 vars: - shopify_schema: shopify_source_integration_tests_4 + shopify_schema: shopify_source_integration_tests_5 shopify_source: shopify_customer_identifier: "shopify_customer_data" shopify_order_line_refund_identifier: "shopify_order_line_refund_data"