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/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh index a0fa78d..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__using_order_adjustment: false, shopify__using_order_line_refund: false, shopify__using_refund: false}' --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/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 65a074b..4264c49 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,7 @@ 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ee4f1b..18d5402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,101 @@ -# 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. + +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)). +- 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)). +- 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 `customer_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. +``` +- 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` + - `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` + - `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` + - βž• `properties` + - ( ) `is_requiring_shipping` is renamed to `is_shipping_required` + - `stg_shopify__product`: + - βž• `status` + - `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 ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39)): + - `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` + - `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)) + +# 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: diff --git a/DECISIONLOG.md b/DECISIONLOG.md new file mode 100644 index 0000000..d4653ab --- /dev/null +++ b/DECISIONLOG.md @@ -0,0 +1,24 @@ +# 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 + +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 + +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/README.md b/README.md index 700a9e9..a8b0aad 100644 --- a/README.md +++ b/README.md @@ -10,92 +10,102 @@

-# 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` - -```yaml +# 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 (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 packages: - package: fivetran/shopify_source - version: [">=0.7.0", "<0.8.0"] + version: [">=0.8.0", "<0.9.0"] # we recommend using ranges to capture non-breaking changes automatically ``` -## 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: +## 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 -# dbt_project.yml - -... -config-version: 2 - vars: - shopify_database: your_database_name - shopify_schema: your_schema_name + shopify_database: your_destination_name + shopify_schema: your_schema_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: +### 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 -... -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 ``` -### 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. +## 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 the modeling of fulfillment events: ```yml # dbt_project.yml -... -config-version: 2 +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 tz Database format](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones): +```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: [] + shopify_timezone: "America/New_York" # Replace with your timezone ``` -### 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: +## (Optional) Step 6: Additional configurations +
Expand to view configurations + +### 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__using_order_adjustment: false # true by default - shopify__using_order_line_refund: false # true by default - shopify__using_refund: false # true by default + shopify_source: + 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 @@ -104,41 +114,58 @@ 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 ``` +### 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 [`src_shopify.yml`](https://github.com/fivetran/dbt_shopify_source/blob/main/models/src_shopify.yml) for the default names. + +```yml +# dbt_project.yml -## Contributions +vars: + shopify__identifier: your_table_name +``` -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. +
+ +## (Optional) Step 7: 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 +packages: + - package: fivetran/fivetran_utils + version: [">=0.4.0", "<0.5.0"] -## Database support -This package has been tested on BigQuery, Snowflake, Redshift, Postgres, and Databricks. + - package: dbt-labs/dbt_utils + version: [">=1.0.0", "<2.0.0"] -### 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 + - package: calogica/dbt_expectations + version: [">=0.8.0", "<0.9.0"] -dispatch: - - macro_namespace: dbt_utils - search_order: ['spark_utils', 'dbt_utils'] + - package: calogica/dbt_date + version: [">=0.7.0", "<0.8.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/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! + +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 your models with [Fivetran Transformations for dbt Coreβ„’](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_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. diff --git a/dbt_project.yml b/dbt_project.yml index 123f56d..ef4b91f 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: @@ -19,13 +19,37 @@ vars: transaction_source: "{{ source('shopify','transaction') }}" refund_source: "{{ source('shopify','refund') }}" order_adjustment_source: "{{ source('shopify','order_adjustment') }}" + + 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') }}" + 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') }}" + tax_line_source: "{{ source('shopify', 'tax_line') }}" + 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: [] - 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/docs/catalog.json b/docs/catalog.json index 294ef6b..3ed0bf2 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": "1.3.0", "generated_at": "2022-12-15T20:50:10.648914Z", "invocation_id": "56ee5110-9361-4962-b1b1-90ab0e8b3cef", "env": {}}, "nodes": {"seed.shopify_source_integration_tests.shopify_customer_data": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test", "name": "shopify_customer_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "text", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "text", "index": 3, "name": "last_name", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "phone": {"type": "integer", "index": 5, "name": "phone", "comment": null}, "state": {"type": "text", "index": 6, "name": "state", "comment": null}, "orders_count": {"type": "integer", "index": 7, "name": "orders_count", "comment": null}, "total_spent": {"type": "double precision", "index": 8, "name": "total_spent", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "accepts_marketing": {"type": "boolean", "index": 11, "name": "accepts_marketing", "comment": null}, "tax_exempt": {"type": "boolean", "index": 12, "name": "tax_exempt", "comment": null}, "verified_email": {"type": "boolean", "index": 13, "name": "verified_email", "comment": null}, "default_address_id": {"type": "bigint", "index": 14, "name": "default_address_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "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": "seed.shopify_source_integration_tests.shopify_customer_data"}, "seed.shopify_source_integration_tests.shopify_order_adjustment_data": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test", "name": "shopify_order_adjustment_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "bigint", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "bigint", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "integer", "index": 4, "name": "amount", "comment": null}, "tax_amount": {"type": "double precision", "index": 5, "name": "tax_amount", "comment": null}, "kind": {"type": "text", "index": 6, "name": "kind", "comment": null}, "reason": {"type": "text", "index": 7, "name": "reason", "comment": null}, "amount_set": {"type": "integer", "index": 8, "name": "amount_set", "comment": null}, "tax_amount_set": {"type": "integer", "index": 9, "name": "tax_amount_set", "comment": null}, "_fivetran_synced": {"type": "text", "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": "seed.shopify_source_integration_tests.shopify_order_adjustment_data"}, "seed.shopify_source_integration_tests.shopify_order_data": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test", "name": "shopify_order_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "note": {"type": "text", "index": 2, "name": "note", "comment": null}, "email": {"type": "text", "index": 3, "name": "email", "comment": null}, "taxes_included": {"type": "boolean", "index": 4, "name": "taxes_included", "comment": null}, "currency": {"type": "text", "index": 5, "name": "currency", "comment": null}, "subtotal_price": {"type": "double precision", "index": 6, "name": "subtotal_price", "comment": null}, "total_tax": {"type": "integer", "index": 7, "name": "total_tax", "comment": null}, "total_price": {"type": "double precision", "index": 8, "name": "total_price", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "name": {"type": "text", "index": 11, "name": "name", "comment": null}, "shipping_address_name": {"type": "text", "index": 12, "name": "shipping_address_name", "comment": null}, "shipping_address_first_name": {"type": "text", "index": 13, "name": "shipping_address_first_name", "comment": null}, "shipping_address_last_name": {"type": "text", "index": 14, "name": "shipping_address_last_name", "comment": null}, "shipping_address_company": {"type": "text", "index": 15, "name": "shipping_address_company", "comment": null}, "shipping_address_phone": {"type": "text", "index": 16, "name": "shipping_address_phone", "comment": null}, "shipping_address_address_1": {"type": "text", "index": 17, "name": "shipping_address_address_1", "comment": null}, "shipping_address_address_2": {"type": "text", "index": 18, "name": "shipping_address_address_2", "comment": null}, "shipping_address_city": {"type": "text", "index": 19, "name": "shipping_address_city", "comment": null}, "shipping_address_country": {"type": "text", "index": 20, "name": "shipping_address_country", "comment": null}, "shipping_address_country_code": {"type": "text", "index": 21, "name": "shipping_address_country_code", "comment": null}, "shipping_address_province": {"type": "text", "index": 22, "name": "shipping_address_province", "comment": null}, "shipping_address_province_code": {"type": "integer", "index": 23, "name": "shipping_address_province_code", "comment": null}, "shipping_address_zip": {"type": "text", "index": 24, "name": "shipping_address_zip", "comment": null}, "shipping_address_latitude": {"type": "text", "index": 25, "name": "shipping_address_latitude", "comment": null}, "shipping_address_longitude": {"type": "text", "index": 26, "name": "shipping_address_longitude", "comment": null}, "billing_address_name": {"type": "text", "index": 27, "name": "billing_address_name", "comment": null}, "billing_address_first_name": {"type": "text", "index": 28, "name": "billing_address_first_name", "comment": null}, "billing_address_last_name": {"type": "text", "index": 29, "name": "billing_address_last_name", "comment": null}, "billing_address_company": {"type": "text", "index": 30, "name": "billing_address_company", "comment": null}, "billing_address_phone": {"type": "text", "index": 31, "name": "billing_address_phone", "comment": null}, "billing_address_address_1": {"type": "text", "index": 32, "name": "billing_address_address_1", "comment": null}, "billing_address_address_2": {"type": "text", "index": 33, "name": "billing_address_address_2", "comment": null}, "billing_address_city": {"type": "text", "index": 34, "name": "billing_address_city", "comment": null}, "billing_address_country": {"type": "text", "index": 35, "name": "billing_address_country", "comment": null}, "billing_address_country_code": {"type": "text", "index": 36, "name": "billing_address_country_code", "comment": null}, "billing_address_province": {"type": "text", "index": 37, "name": "billing_address_province", "comment": null}, "billing_address_province_code": {"type": "integer", "index": 38, "name": "billing_address_province_code", "comment": null}, "billing_address_zip": {"type": "text", "index": 39, "name": "billing_address_zip", "comment": null}, "billing_address_latitude": {"type": "text", "index": 40, "name": "billing_address_latitude", "comment": null}, "billing_address_longitude": {"type": "text", "index": 41, "name": "billing_address_longitude", "comment": null}, "customer_id": {"type": "bigint", "index": 42, "name": "customer_id", "comment": null}, "location_id": {"type": "bigint", "index": 43, "name": "location_id", "comment": null}, "user_id": {"type": "bigint", "index": 44, "name": "user_id", "comment": null}, "number": {"type": "integer", "index": 45, "name": "number", "comment": null}, "order_number": {"type": "integer", "index": 46, "name": "order_number", "comment": null}, "financial_status": {"type": "text", "index": 47, "name": "financial_status", "comment": null}, "fulfillment_status": {"type": "text", "index": 48, "name": "fulfillment_status", "comment": null}, "processed_at": {"type": "timestamp without time zone", "index": 49, "name": "processed_at", "comment": null}, "processing_method": {"type": "text", "index": 50, "name": "processing_method", "comment": null}, "referring_site": {"type": "text", "index": 51, "name": "referring_site", "comment": null}, "cancel_reason": {"type": "integer", "index": 52, "name": "cancel_reason", "comment": null}, "cancelled_at": {"type": "timestamp without time zone", "index": 53, "name": "cancelled_at", "comment": null}, "closed_at": {"type": "text", "index": 54, "name": "closed_at", "comment": null}, "total_discounts": {"type": "double precision", "index": 55, "name": "total_discounts", "comment": null}, "total_line_items_price": {"type": "double precision", "index": 56, "name": "total_line_items_price", "comment": null}, "total_weight": {"type": "integer", "index": 57, "name": "total_weight", "comment": null}, "source_name": {"type": "text", "index": 58, "name": "source_name", "comment": null}, "browser_ip": {"type": "text", "index": 59, "name": "browser_ip", "comment": null}, "buyer_accepts_marketing": {"type": "boolean", "index": 60, "name": "buyer_accepts_marketing", "comment": null}, "token": {"type": "text", "index": 61, "name": "token", "comment": null}, "cart_token": {"type": "text", "index": 62, "name": "cart_token", "comment": null}, "checkout_token": {"type": "text", "index": 63, "name": "checkout_token", "comment": null}, "test": {"type": "boolean", "index": 64, "name": "test", "comment": null}, "landing_site_base_url": {"type": "text", "index": 65, "name": "landing_site_base_url", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "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": "seed.shopify_source_integration_tests.shopify_order_data"}, "seed.shopify_source_integration_tests.shopify_order_line_data": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test", "name": "shopify_order_line_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"order_id": {"type": "bigint", "index": 1, "name": "order_id", "comment": null}, "id": {"type": "bigint", "index": 2, "name": "id", "comment": null}, "product_id": {"type": "bigint", "index": 3, "name": "product_id", "comment": null}, "variant_id": {"type": "bigint", "index": 4, "name": "variant_id", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}, "title": {"type": "text", "index": 6, "name": "title", "comment": null}, "vendor": {"type": "text", "index": 7, "name": "vendor", "comment": null}, "price": {"type": "double precision", "index": 8, "name": "price", "comment": null}, "quantity": {"type": "integer", "index": 9, "name": "quantity", "comment": null}, "grams": {"type": "integer", "index": 10, "name": "grams", "comment": null}, "sku": {"type": "text", "index": 11, "name": "sku", "comment": null}, "fulfillable_quantity": {"type": "integer", "index": 12, "name": "fulfillable_quantity", "comment": null}, "fulfillment_service": {"type": "text", "index": 13, "name": "fulfillment_service", "comment": null}, "gift_card": {"type": "boolean", "index": 14, "name": "gift_card", "comment": null}, "requires_shipping": {"type": "boolean", "index": 15, "name": "requires_shipping", "comment": null}, "taxable": {"type": "boolean", "index": 16, "name": "taxable", "comment": null}, "index": {"type": "integer", "index": 17, "name": "index", "comment": null}, "total_discount": {"type": "integer", "index": 18, "name": "total_discount", "comment": null}, "pre_tax_price": {"type": "integer", "index": 19, "name": "pre_tax_price", "comment": null}, "fulfillment_status": {"type": "text", "index": 20, "name": "fulfillment_status", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "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": "seed.shopify_source_integration_tests.shopify_order_line_data"}, "seed.shopify_source_integration_tests.shopify_order_line_refund_data": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test", "name": "shopify_order_line_refund_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "location_id": {"type": "bigint", "index": 2, "name": "location_id", "comment": null}, "refund_id": {"type": "bigint", "index": 3, "name": "refund_id", "comment": null}, "restock_type": {"type": "text", "index": 4, "name": "restock_type", "comment": null}, "quantity": {"type": "integer", "index": 5, "name": "quantity", "comment": null}, "order_line_id": {"type": "bigint", "index": 6, "name": "order_line_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "subtotal": {"type": "integer", "index": 8, "name": "subtotal", "comment": null}, "total_tax_set": {"type": "integer", "index": 9, "name": "total_tax_set", "comment": null}, "subtotal_set": {"type": "integer", "index": 10, "name": "subtotal_set", "comment": null}, "total_tax": {"type": "double precision", "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": "seed.shopify_source_integration_tests.shopify_order_line_refund_data"}, "seed.shopify_source_integration_tests.shopify_product_data": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test", "name": "shopify_product_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "title": {"type": "text", "index": 2, "name": "title", "comment": null}, "handle": {"type": "text", "index": 3, "name": "handle", "comment": null}, "product_type": {"type": "text", "index": 4, "name": "product_type", "comment": null}, "vendor": {"type": "text", "index": 5, "name": "vendor", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": null}, "published_at": {"type": "timestamp without time zone", "index": 8, "name": "published_at", "comment": null}, "published_scope": {"type": "text", "index": 9, "name": "published_scope", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 10, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "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": "seed.shopify_source_integration_tests.shopify_product_data"}, "seed.shopify_source_integration_tests.shopify_product_variant_data": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test", "name": "shopify_product_variant_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "product_id": {"type": "bigint", "index": 2, "name": "product_id", "comment": null}, "inventory_item_id": {"type": "bigint", "index": 3, "name": "inventory_item_id", "comment": null}, "title": {"type": "text", "index": 4, "name": "title", "comment": null}, "price": {"type": "integer", "index": 5, "name": "price", "comment": null}, "sku": {"type": "integer", "index": 6, "name": "sku", "comment": null}, "position": {"type": "integer", "index": 7, "name": "position", "comment": null}, "inventory_policy": {"type": "text", "index": 8, "name": "inventory_policy", "comment": null}, "compare_at_price": {"type": "integer", "index": 9, "name": "compare_at_price", "comment": null}, "fulfillment_service": {"type": "text", "index": 10, "name": "fulfillment_service", "comment": null}, "inventory_management": {"type": "text", "index": 11, "name": "inventory_management", "comment": null}, "created_at": {"type": "text", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "text", "index": 13, "name": "updated_at", "comment": null}, "taxable": {"type": "boolean", "index": 14, "name": "taxable", "comment": null}, "barcode": {"type": "integer", "index": 15, "name": "barcode", "comment": null}, "grams": {"type": "integer", "index": 16, "name": "grams", "comment": null}, "image_id": {"type": "integer", "index": 17, "name": "image_id", "comment": null}, "inventory_quantity": {"type": "integer", "index": 18, "name": "inventory_quantity", "comment": null}, "weight": {"type": "integer", "index": 19, "name": "weight", "comment": null}, "weight_unit": {"type": "text", "index": 20, "name": "weight_unit", "comment": null}, "old_inventory_quantity": {"type": "integer", "index": 21, "name": "old_inventory_quantity", "comment": null}, "requires_shipping": {"type": "boolean", "index": 22, "name": "requires_shipping", "comment": null}, "_fivetran_synced": {"type": "text", "index": 23, "name": "_fivetran_synced", "comment": null}, "option_2": {"type": "integer", "index": 24, "name": "option_2", "comment": null}, "tax_code": {"type": "text", "index": 25, "name": "tax_code", "comment": null}, "option_3": {"type": "integer", "index": 26, "name": "option_3", "comment": null}, "option_1": {"type": "text", "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": "seed.shopify_source_integration_tests.shopify_product_variant_data"}, "seed.shopify_source_integration_tests.shopify_refund_data": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test", "name": "shopify_refund_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "text", "index": 2, "name": "created_at", "comment": null}, "processed_at": {"type": "text", "index": 3, "name": "processed_at", "comment": null}, "note": {"type": "text", "index": 4, "name": "note", "comment": null}, "restock": {"type": "boolean", "index": 5, "name": "restock", "comment": null}, "user_id": {"type": "bigint", "index": 6, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "text", "index": 7, "name": "_fivetran_synced", "comment": null}, "total_duties_set": {"type": "integer", "index": 8, "name": "total_duties_set", "comment": null}, "order_id": {"type": "bigint", "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": "seed.shopify_source_integration_tests.shopify_refund_data"}, "seed.shopify_source_integration_tests.shopify_transaction_data": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test", "name": "shopify_transaction_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "bigint", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "bigint", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "double precision", "index": 4, "name": "amount", "comment": null}, "authorization": {"type": "text", "index": 5, "name": "authorization", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "processed_at": {"type": "text", "index": 7, "name": "processed_at", "comment": null}, "device_id": {"type": "integer", "index": 8, "name": "device_id", "comment": null}, "gateway": {"type": "text", "index": 9, "name": "gateway", "comment": null}, "source_name": {"type": "text", "index": 10, "name": "source_name", "comment": null}, "message": {"type": "text", "index": 11, "name": "message", "comment": null}, "currency": {"type": "text", "index": 12, "name": "currency", "comment": null}, "location_id": {"type": "integer", "index": 13, "name": "location_id", "comment": null}, "parent_id": {"type": "integer", "index": 14, "name": "parent_id", "comment": null}, "payment_avs_result_code": {"type": "text", "index": 15, "name": "payment_avs_result_code", "comment": null}, "kind": {"type": "text", "index": 16, "name": "kind", "comment": null}, "currency_exchange_id": {"type": "integer", "index": 17, "name": "currency_exchange_id", "comment": null}, "currency_exchange_adjustment": {"type": "integer", "index": 18, "name": "currency_exchange_adjustment", "comment": null}, "currency_exchange_original_amount": {"type": "integer", "index": 19, "name": "currency_exchange_original_amount", "comment": null}, "currency_exchange_final_amount": {"type": "integer", "index": 20, "name": "currency_exchange_final_amount", "comment": null}, "currency_exchange_currency": {"type": "integer", "index": 21, "name": "currency_exchange_currency", "comment": null}, "error_code": {"type": "integer", "index": 22, "name": "error_code", "comment": null}, "status": {"type": "text", "index": 23, "name": "status", "comment": null}, "test": {"type": "boolean", "index": 24, "name": "test", "comment": null}, "user_id": {"type": "integer", "index": 25, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "text", "index": 26, "name": "_fivetran_synced", "comment": null}, "payment_credit_card_bin": {"type": "integer", "index": 27, "name": "payment_credit_card_bin", "comment": null}, "payment_cvv_result_code": {"type": "integer", "index": 28, "name": "payment_cvv_result_code", "comment": null}, "payment_credit_card_number": {"type": "integer", "index": 29, "name": "payment_credit_card_number", "comment": null}, "payment_credit_card_company": {"type": "integer", "index": 30, "name": "payment_credit_card_company", "comment": null}, "receipt": {"type": "integer", "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": "seed.shopify_source_integration_tests.shopify_transaction_data"}, "model.shopify_source.stg_shopify__customer": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__customer", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "has_accepted_marketing": {"type": "boolean", "index": 2, "name": "has_accepted_marketing", "comment": null}, "created_timestamp": {"type": "timestamp without time zone", "index": 3, "name": "created_timestamp", "comment": null}, "default_address_id": {"type": "bigint", "index": 4, "name": "default_address_id", "comment": null}, "email": {"type": "text", "index": 5, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 6, "name": "first_name", "comment": null}, "customer_id": {"type": "bigint", "index": 7, "name": "customer_id", "comment": null}, "last_name": {"type": "text", "index": 8, "name": "last_name", "comment": null}, "orders_count": {"type": "integer", "index": 9, "name": "orders_count", "comment": null}, "phone": {"type": "integer", "index": 10, "name": "phone", "comment": null}, "account_state": {"type": "text", "index": 11, "name": "account_state", "comment": null}, "is_tax_exempt": {"type": "boolean", "index": 12, "name": "is_tax_exempt", "comment": null}, "total_spent": {"type": "double precision", "index": 13, "name": "total_spent", "comment": null}, "updated_timestamp": {"type": "timestamp without time zone", "index": 14, "name": "updated_timestamp", "comment": null}, "is_verified_email": {"type": "boolean", "index": 15, "name": "is_verified_email", "comment": null}, "source_relation": {"type": "text", "index": 16, "name": "source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.shopify_source.stg_shopify__customer"}, "model.shopify_source.stg_shopify__customer_tmp": {"metadata": {"type": "VIEW", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__customer_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "text", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "text", "index": 3, "name": "last_name", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "phone": {"type": "integer", "index": 5, "name": "phone", "comment": null}, "state": {"type": "text", "index": 6, "name": "state", "comment": null}, "orders_count": {"type": "integer", "index": 7, "name": "orders_count", "comment": null}, "total_spent": {"type": "double precision", "index": 8, "name": "total_spent", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "accepts_marketing": {"type": "boolean", "index": 11, "name": "accepts_marketing", "comment": null}, "tax_exempt": {"type": "boolean", "index": 12, "name": "tax_exempt", "comment": null}, "verified_email": {"type": "boolean", "index": 13, "name": "verified_email", "comment": null}, "default_address_id": {"type": "bigint", "index": 14, "name": "default_address_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "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__order": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__order", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"order_id": {"type": "bigint", "index": 1, "name": "order_id", "comment": null}, "processed_timestamp": {"type": "timestamp without time zone", "index": 2, "name": "processed_timestamp", "comment": null}, "updated_timestamp": {"type": "timestamp without time zone", "index": 3, "name": "updated_timestamp", "comment": null}, "user_id": {"type": "bigint", "index": 4, "name": "user_id", "comment": null}, "total_discounts": {"type": "double precision", "index": 5, "name": "total_discounts", "comment": null}, "total_line_items_price": {"type": "double precision", "index": 6, "name": "total_line_items_price", "comment": null}, "total_price": {"type": "double precision", "index": 7, "name": "total_price", "comment": null}, "total_tax": {"type": "integer", "index": 8, "name": "total_tax", "comment": null}, "source_name": {"type": "text", "index": 9, "name": "source_name", "comment": null}, "subtotal_price": {"type": "double precision", "index": 10, "name": "subtotal_price", "comment": null}, "has_taxes_included": {"type": "boolean", "index": 11, "name": "has_taxes_included", "comment": null}, "total_weight": {"type": "integer", "index": 12, "name": "total_weight", "comment": null}, "landing_site_base_url": {"type": "text", "index": 13, "name": "landing_site_base_url", "comment": null}, "location_id": {"type": "bigint", "index": 14, "name": "location_id", "comment": null}, "name": {"type": "text", "index": 15, "name": "name", "comment": null}, "note": {"type": "text", "index": 16, "name": "note", "comment": null}, "number": {"type": "integer", "index": 17, "name": "number", "comment": null}, "order_number": {"type": "integer", "index": 18, "name": "order_number", "comment": null}, "cancel_reason": {"type": "integer", "index": 19, "name": "cancel_reason", "comment": null}, "cancelled_timestamp": {"type": "timestamp without time zone", "index": 20, "name": "cancelled_timestamp", "comment": null}, "cart_token": {"type": "text", "index": 21, "name": "cart_token", "comment": null}, "checkout_token": {"type": "text", "index": 22, "name": "checkout_token", "comment": null}, "closed_timestamp": {"type": "text", "index": 23, "name": "closed_timestamp", "comment": null}, "created_timestamp": {"type": "timestamp without time zone", "index": 24, "name": "created_timestamp", "comment": null}, "currency": {"type": "text", "index": 25, "name": "currency", "comment": null}, "customer_id": {"type": "bigint", "index": 26, "name": "customer_id", "comment": null}, "email": {"type": "text", "index": 27, "name": "email", "comment": null}, "financial_status": {"type": "text", "index": 28, "name": "financial_status", "comment": null}, "fulfillment_status": {"type": "text", "index": 29, "name": "fulfillment_status", "comment": null}, "processing_method": {"type": "text", "index": 30, "name": "processing_method", "comment": null}, "referring_site": {"type": "text", "index": 31, "name": "referring_site", "comment": null}, "billing_address_address_1": {"type": "text", "index": 32, "name": "billing_address_address_1", "comment": null}, "billing_address_address_2": {"type": "text", "index": 33, "name": "billing_address_address_2", "comment": null}, "billing_address_city": {"type": "text", "index": 34, "name": "billing_address_city", "comment": null}, "billing_address_company": {"type": "text", "index": 35, "name": "billing_address_company", "comment": null}, "billing_address_country": {"type": "text", "index": 36, "name": "billing_address_country", "comment": null}, "billing_address_country_code": {"type": "text", "index": 37, "name": "billing_address_country_code", "comment": null}, "billing_address_first_name": {"type": "text", "index": 38, "name": "billing_address_first_name", "comment": null}, "billing_address_last_name": {"type": "text", "index": 39, "name": "billing_address_last_name", "comment": null}, "billing_address_latitude": {"type": "text", "index": 40, "name": "billing_address_latitude", "comment": null}, "billing_address_longitude": {"type": "text", "index": 41, "name": "billing_address_longitude", "comment": null}, "billing_address_name": {"type": "text", "index": 42, "name": "billing_address_name", "comment": null}, "billing_address_phone": {"type": "text", "index": 43, "name": "billing_address_phone", "comment": null}, "billing_address_province": {"type": "text", "index": 44, "name": "billing_address_province", "comment": null}, "billing_address_province_code": {"type": "integer", "index": 45, "name": "billing_address_province_code", "comment": null}, "billing_address_zip": {"type": "text", "index": 46, "name": "billing_address_zip", "comment": null}, "browser_ip": {"type": "text", "index": 47, "name": "browser_ip", "comment": null}, "has_buyer_accepted_marketing": {"type": "boolean", "index": 48, "name": "has_buyer_accepted_marketing", "comment": null}, "total_shipping_price_set": {"type": "text", "index": 49, "name": "total_shipping_price_set", "comment": null}, "shipping_address_address_1": {"type": "text", "index": 50, "name": "shipping_address_address_1", "comment": null}, "shipping_address_address_2": {"type": "text", "index": 51, "name": "shipping_address_address_2", "comment": null}, "shipping_address_city": {"type": "text", "index": 52, "name": "shipping_address_city", "comment": null}, "shipping_address_company": {"type": "text", "index": 53, "name": "shipping_address_company", "comment": null}, "shipping_address_country": {"type": "text", "index": 54, "name": "shipping_address_country", "comment": null}, "shipping_address_country_code": {"type": "text", "index": 55, "name": "shipping_address_country_code", "comment": null}, "shipping_address_first_name": {"type": "text", "index": 56, "name": "shipping_address_first_name", "comment": null}, "shipping_address_last_name": {"type": "text", "index": 57, "name": "shipping_address_last_name", "comment": null}, "shipping_address_latitude": {"type": "text", "index": 58, "name": "shipping_address_latitude", "comment": null}, "shipping_address_longitude": {"type": "text", "index": 59, "name": "shipping_address_longitude", "comment": null}, "shipping_address_name": {"type": "text", "index": 60, "name": "shipping_address_name", "comment": null}, "shipping_address_phone": {"type": "text", "index": 61, "name": "shipping_address_phone", "comment": null}, "shipping_address_province": {"type": "text", "index": 62, "name": "shipping_address_province", "comment": null}, "shipping_address_province_code": {"type": "integer", "index": 63, "name": "shipping_address_province_code", "comment": null}, "shipping_address_zip": {"type": "text", "index": 64, "name": "shipping_address_zip", "comment": null}, "is_test_order": {"type": "boolean", "index": 65, "name": "is_test_order", "comment": null}, "token": {"type": "text", "index": 66, "name": "token", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 67, "name": "_fivetran_synced", "comment": null}, "source_relation": {"type": "text", "index": 68, "name": "source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.shopify_source.stg_shopify__order"}, "model.shopify_source.stg_shopify__order_adjustment": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__order_adjustment", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"order_adjustment_id": {"type": "bigint", "index": 1, "name": "order_adjustment_id", "comment": null}, "order_id": {"type": "bigint", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "bigint", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "integer", "index": 4, "name": "amount", "comment": null}, "tax_amount": {"type": "double precision", "index": 5, "name": "tax_amount", "comment": null}, "kind": {"type": "text", "index": 6, "name": "kind", "comment": null}, "reason": {"type": "text", "index": 7, "name": "reason", "comment": null}, "_fivetran_synced": {"type": "text", "index": 8, "name": "_fivetran_synced", "comment": null}, "source_relation": {"type": "text", "index": 9, "name": "source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.shopify_source.stg_shopify__order_adjustment"}, "model.shopify_source.stg_shopify__order_adjustment_tmp": {"metadata": {"type": "VIEW", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__order_adjustment_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "bigint", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "bigint", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "integer", "index": 4, "name": "amount", "comment": null}, "tax_amount": {"type": "double precision", "index": 5, "name": "tax_amount", "comment": null}, "kind": {"type": "text", "index": 6, "name": "kind", "comment": null}, "reason": {"type": "text", "index": 7, "name": "reason", "comment": null}, "amount_set": {"type": "integer", "index": 8, "name": "amount_set", "comment": null}, "tax_amount_set": {"type": "integer", "index": 9, "name": "tax_amount_set", "comment": null}, "_fivetran_synced": {"type": "text", "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": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__order_line", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "fulfillable_quantity": {"type": "integer", "index": 2, "name": "fulfillable_quantity", "comment": null}, "fulfillment_service": {"type": "text", "index": 3, "name": "fulfillment_service", "comment": null}, "fulfillment_status": {"type": "text", "index": 4, "name": "fulfillment_status", "comment": null}, "is_gift_card": {"type": "boolean", "index": 5, "name": "is_gift_card", "comment": null}, "grams": {"type": "integer", "index": 6, "name": "grams", "comment": null}, "order_line_id": {"type": "bigint", "index": 7, "name": "order_line_id", "comment": null}, "index": {"type": "integer", "index": 8, "name": "index", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "order_id": {"type": "bigint", "index": 10, "name": "order_id", "comment": null}, "pre_tax_price": {"type": "integer", "index": 11, "name": "pre_tax_price", "comment": null}, "price": {"type": "double precision", "index": 12, "name": "price", "comment": null}, "product_id": {"type": "bigint", "index": 13, "name": "product_id", "comment": null}, "property_charge_interval_frequency": {"type": "numeric(28,6)", "index": 14, "name": "property_charge_interval_frequency", "comment": null}, "property_for_shipping_jan_3_rd_2020": {"type": "text", "index": 15, "name": "property_for_shipping_jan_3_rd_2020", "comment": null}, "property_shipping_interval_frequency": {"type": "numeric(28,6)", "index": 16, "name": "property_shipping_interval_frequency", "comment": null}, "property_shipping_interval_unit_type": {"type": "text", "index": 17, "name": "property_shipping_interval_unit_type", "comment": null}, "property_subscription_id": {"type": "numeric(28,6)", "index": 18, "name": "property_subscription_id", "comment": null}, "quantity": {"type": "integer", "index": 19, "name": "quantity", "comment": null}, "is_requiring_shipping": {"type": "boolean", "index": 20, "name": "is_requiring_shipping", "comment": null}, "sku": {"type": "text", "index": 21, "name": "sku", "comment": null}, "is_taxable": {"type": "boolean", "index": 22, "name": "is_taxable", "comment": null}, "title": {"type": "text", "index": 23, "name": "title", "comment": null}, "total_discount": {"type": "integer", "index": 24, "name": "total_discount", "comment": null}, "variant_id": {"type": "bigint", "index": 25, "name": "variant_id", "comment": null}, "vendor": {"type": "text", "index": 26, "name": "vendor", "comment": null}, "source_relation": {"type": "text", "index": 27, "name": "source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.shopify_source.stg_shopify__order_line"}, "model.shopify_source.stg_shopify__order_line_refund": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__order_line_refund", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "order_line_refund_id": {"type": "bigint", "index": 2, "name": "order_line_refund_id", "comment": null}, "location_id": {"type": "bigint", "index": 3, "name": "location_id", "comment": null}, "order_line_id": {"type": "bigint", "index": 4, "name": "order_line_id", "comment": null}, "subtotal": {"type": "integer", "index": 5, "name": "subtotal", "comment": null}, "total_tax": {"type": "double precision", "index": 6, "name": "total_tax", "comment": null}, "quantity": {"type": "integer", "index": 7, "name": "quantity", "comment": null}, "refund_id": {"type": "bigint", "index": 8, "name": "refund_id", "comment": null}, "restock_type": {"type": "text", "index": 9, "name": "restock_type", "comment": null}, "source_relation": {"type": "text", "index": 10, "name": "source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.shopify_source.stg_shopify__order_line_refund"}, "model.shopify_source.stg_shopify__order_line_refund_tmp": {"metadata": {"type": "VIEW", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__order_line_refund_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "location_id": {"type": "bigint", "index": 2, "name": "location_id", "comment": null}, "refund_id": {"type": "bigint", "index": 3, "name": "refund_id", "comment": null}, "restock_type": {"type": "text", "index": 4, "name": "restock_type", "comment": null}, "quantity": {"type": "integer", "index": 5, "name": "quantity", "comment": null}, "order_line_id": {"type": "bigint", "index": 6, "name": "order_line_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "subtotal": {"type": "integer", "index": 8, "name": "subtotal", "comment": null}, "total_tax_set": {"type": "integer", "index": 9, "name": "total_tax_set", "comment": null}, "subtotal_set": {"type": "integer", "index": 10, "name": "subtotal_set", "comment": null}, "total_tax": {"type": "double precision", "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__order_line_tmp": {"metadata": {"type": "VIEW", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__order_line_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"order_id": {"type": "bigint", "index": 1, "name": "order_id", "comment": null}, "id": {"type": "bigint", "index": 2, "name": "id", "comment": null}, "product_id": {"type": "bigint", "index": 3, "name": "product_id", "comment": null}, "variant_id": {"type": "bigint", "index": 4, "name": "variant_id", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}, "title": {"type": "text", "index": 6, "name": "title", "comment": null}, "vendor": {"type": "text", "index": 7, "name": "vendor", "comment": null}, "price": {"type": "double precision", "index": 8, "name": "price", "comment": null}, "quantity": {"type": "integer", "index": 9, "name": "quantity", "comment": null}, "grams": {"type": "integer", "index": 10, "name": "grams", "comment": null}, "sku": {"type": "text", "index": 11, "name": "sku", "comment": null}, "fulfillable_quantity": {"type": "integer", "index": 12, "name": "fulfillable_quantity", "comment": null}, "fulfillment_service": {"type": "text", "index": 13, "name": "fulfillment_service", "comment": null}, "gift_card": {"type": "boolean", "index": 14, "name": "gift_card", "comment": null}, "requires_shipping": {"type": "boolean", "index": 15, "name": "requires_shipping", "comment": null}, "taxable": {"type": "boolean", "index": 16, "name": "taxable", "comment": null}, "index": {"type": "integer", "index": 17, "name": "index", "comment": null}, "total_discount": {"type": "integer", "index": 18, "name": "total_discount", "comment": null}, "pre_tax_price": {"type": "integer", "index": 19, "name": "pre_tax_price", "comment": null}, "fulfillment_status": {"type": "text", "index": 20, "name": "fulfillment_status", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "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_source_integration_test_stg_shopify", "name": "stg_shopify__order_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "note": {"type": "text", "index": 2, "name": "note", "comment": null}, "email": {"type": "text", "index": 3, "name": "email", "comment": null}, "taxes_included": {"type": "boolean", "index": 4, "name": "taxes_included", "comment": null}, "currency": {"type": "text", "index": 5, "name": "currency", "comment": null}, "subtotal_price": {"type": "double precision", "index": 6, "name": "subtotal_price", "comment": null}, "total_tax": {"type": "integer", "index": 7, "name": "total_tax", "comment": null}, "total_price": {"type": "double precision", "index": 8, "name": "total_price", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 9, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "name": {"type": "text", "index": 11, "name": "name", "comment": null}, "shipping_address_name": {"type": "text", "index": 12, "name": "shipping_address_name", "comment": null}, "shipping_address_first_name": {"type": "text", "index": 13, "name": "shipping_address_first_name", "comment": null}, "shipping_address_last_name": {"type": "text", "index": 14, "name": "shipping_address_last_name", "comment": null}, "shipping_address_company": {"type": "text", "index": 15, "name": "shipping_address_company", "comment": null}, "shipping_address_phone": {"type": "text", "index": 16, "name": "shipping_address_phone", "comment": null}, "shipping_address_address_1": {"type": "text", "index": 17, "name": "shipping_address_address_1", "comment": null}, "shipping_address_address_2": {"type": "text", "index": 18, "name": "shipping_address_address_2", "comment": null}, "shipping_address_city": {"type": "text", "index": 19, "name": "shipping_address_city", "comment": null}, "shipping_address_country": {"type": "text", "index": 20, "name": "shipping_address_country", "comment": null}, "shipping_address_country_code": {"type": "text", "index": 21, "name": "shipping_address_country_code", "comment": null}, "shipping_address_province": {"type": "text", "index": 22, "name": "shipping_address_province", "comment": null}, "shipping_address_province_code": {"type": "integer", "index": 23, "name": "shipping_address_province_code", "comment": null}, "shipping_address_zip": {"type": "text", "index": 24, "name": "shipping_address_zip", "comment": null}, "shipping_address_latitude": {"type": "text", "index": 25, "name": "shipping_address_latitude", "comment": null}, "shipping_address_longitude": {"type": "text", "index": 26, "name": "shipping_address_longitude", "comment": null}, "billing_address_name": {"type": "text", "index": 27, "name": "billing_address_name", "comment": null}, "billing_address_first_name": {"type": "text", "index": 28, "name": "billing_address_first_name", "comment": null}, "billing_address_last_name": {"type": "text", "index": 29, "name": "billing_address_last_name", "comment": null}, "billing_address_company": {"type": "text", "index": 30, "name": "billing_address_company", "comment": null}, "billing_address_phone": {"type": "text", "index": 31, "name": "billing_address_phone", "comment": null}, "billing_address_address_1": {"type": "text", "index": 32, "name": "billing_address_address_1", "comment": null}, "billing_address_address_2": {"type": "text", "index": 33, "name": "billing_address_address_2", "comment": null}, "billing_address_city": {"type": "text", "index": 34, "name": "billing_address_city", "comment": null}, "billing_address_country": {"type": "text", "index": 35, "name": "billing_address_country", "comment": null}, "billing_address_country_code": {"type": "text", "index": 36, "name": "billing_address_country_code", "comment": null}, "billing_address_province": {"type": "text", "index": 37, "name": "billing_address_province", "comment": null}, "billing_address_province_code": {"type": "integer", "index": 38, "name": "billing_address_province_code", "comment": null}, "billing_address_zip": {"type": "text", "index": 39, "name": "billing_address_zip", "comment": null}, "billing_address_latitude": {"type": "text", "index": 40, "name": "billing_address_latitude", "comment": null}, "billing_address_longitude": {"type": "text", "index": 41, "name": "billing_address_longitude", "comment": null}, "customer_id": {"type": "bigint", "index": 42, "name": "customer_id", "comment": null}, "location_id": {"type": "bigint", "index": 43, "name": "location_id", "comment": null}, "user_id": {"type": "bigint", "index": 44, "name": "user_id", "comment": null}, "number": {"type": "integer", "index": 45, "name": "number", "comment": null}, "order_number": {"type": "integer", "index": 46, "name": "order_number", "comment": null}, "financial_status": {"type": "text", "index": 47, "name": "financial_status", "comment": null}, "fulfillment_status": {"type": "text", "index": 48, "name": "fulfillment_status", "comment": null}, "processed_at": {"type": "timestamp without time zone", "index": 49, "name": "processed_at", "comment": null}, "processing_method": {"type": "text", "index": 50, "name": "processing_method", "comment": null}, "referring_site": {"type": "text", "index": 51, "name": "referring_site", "comment": null}, "cancel_reason": {"type": "integer", "index": 52, "name": "cancel_reason", "comment": null}, "cancelled_at": {"type": "timestamp without time zone", "index": 53, "name": "cancelled_at", "comment": null}, "closed_at": {"type": "text", "index": 54, "name": "closed_at", "comment": null}, "total_discounts": {"type": "double precision", "index": 55, "name": "total_discounts", "comment": null}, "total_line_items_price": {"type": "double precision", "index": 56, "name": "total_line_items_price", "comment": null}, "total_weight": {"type": "integer", "index": 57, "name": "total_weight", "comment": null}, "source_name": {"type": "text", "index": 58, "name": "source_name", "comment": null}, "browser_ip": {"type": "text", "index": 59, "name": "browser_ip", "comment": null}, "buyer_accepts_marketing": {"type": "boolean", "index": 60, "name": "buyer_accepts_marketing", "comment": null}, "token": {"type": "text", "index": 61, "name": "token", "comment": null}, "cart_token": {"type": "text", "index": 62, "name": "cart_token", "comment": null}, "checkout_token": {"type": "text", "index": 63, "name": "checkout_token", "comment": null}, "test": {"type": "boolean", "index": 64, "name": "test", "comment": null}, "landing_site_base_url": {"type": "text", "index": 65, "name": "landing_site_base_url", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "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__product": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__product", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_timestamp": {"type": "timestamp without time zone", "index": 3, "name": "created_timestamp", "comment": null}, "handle": {"type": "text", "index": 4, "name": "handle", "comment": null}, "product_id": {"type": "bigint", "index": 5, "name": "product_id", "comment": null}, "product_type": {"type": "text", "index": 6, "name": "product_type", "comment": null}, "published_timestamp": {"type": "timestamp without time zone", "index": 7, "name": "published_timestamp", "comment": null}, "published_scope": {"type": "text", "index": 8, "name": "published_scope", "comment": null}, "title": {"type": "text", "index": 9, "name": "title", "comment": null}, "updated_timestamp": {"type": "timestamp without time zone", "index": 10, "name": "updated_timestamp", "comment": null}, "vendor": {"type": "text", "index": 11, "name": "vendor", "comment": null}, "source_relation": {"type": "text", "index": 12, "name": "source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.shopify_source.stg_shopify__product"}, "model.shopify_source.stg_shopify__product_tmp": {"metadata": {"type": "VIEW", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__product_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "title": {"type": "text", "index": 2, "name": "title", "comment": null}, "handle": {"type": "text", "index": 3, "name": "handle", "comment": null}, "product_type": {"type": "text", "index": 4, "name": "product_type", "comment": null}, "vendor": {"type": "text", "index": 5, "name": "vendor", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": null}, "published_at": {"type": "timestamp without time zone", "index": 8, "name": "published_at", "comment": null}, "published_scope": {"type": "text", "index": 9, "name": "published_scope", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 10, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "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_variant": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__product_variant", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"variant_id": {"type": "bigint", "index": 1, "name": "variant_id", "comment": null}, "_fivetran_synced": {"type": "text", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_timestamp": {"type": "text", "index": 3, "name": "created_timestamp", "comment": null}, "updated_timestamp": {"type": "text", "index": 4, "name": "updated_timestamp", "comment": null}, "product_id": {"type": "bigint", "index": 5, "name": "product_id", "comment": null}, "inventory_item_id": {"type": "bigint", "index": 6, "name": "inventory_item_id", "comment": null}, "image_id": {"type": "integer", "index": 7, "name": "image_id", "comment": null}, "title": {"type": "text", "index": 8, "name": "title", "comment": null}, "price": {"type": "integer", "index": 9, "name": "price", "comment": null}, "sku": {"type": "integer", "index": 10, "name": "sku", "comment": null}, "position": {"type": "integer", "index": 11, "name": "position", "comment": null}, "inventory_policy": {"type": "text", "index": 12, "name": "inventory_policy", "comment": null}, "compare_at_price": {"type": "integer", "index": 13, "name": "compare_at_price", "comment": null}, "fulfillment_service": {"type": "text", "index": 14, "name": "fulfillment_service", "comment": null}, "inventory_management": {"type": "text", "index": 15, "name": "inventory_management", "comment": null}, "is_taxable": {"type": "boolean", "index": 16, "name": "is_taxable", "comment": null}, "barcode": {"type": "integer", "index": 17, "name": "barcode", "comment": null}, "grams": {"type": "integer", "index": 18, "name": "grams", "comment": null}, "inventory_quantity": {"type": "integer", "index": 19, "name": "inventory_quantity", "comment": null}, "weight": {"type": "integer", "index": 20, "name": "weight", "comment": null}, "weight_unit": {"type": "text", "index": 21, "name": "weight_unit", "comment": null}, "option_1": {"type": "text", "index": 22, "name": "option_1", "comment": null}, "option_2": {"type": "integer", "index": 23, "name": "option_2", "comment": null}, "option_3": {"type": "integer", "index": 24, "name": "option_3", "comment": null}, "tax_code": {"type": "text", "index": 25, "name": "tax_code", "comment": null}, "old_inventory_quantity": {"type": "integer", "index": 26, "name": "old_inventory_quantity", "comment": null}, "is_requiring_shipping": {"type": "boolean", "index": 27, "name": "is_requiring_shipping", "comment": null}, "source_relation": {"type": "text", "index": 28, "name": "source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.shopify_source.stg_shopify__product_variant"}, "model.shopify_source.stg_shopify__product_variant_tmp": {"metadata": {"type": "VIEW", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__product_variant_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "product_id": {"type": "bigint", "index": 2, "name": "product_id", "comment": null}, "inventory_item_id": {"type": "bigint", "index": 3, "name": "inventory_item_id", "comment": null}, "title": {"type": "text", "index": 4, "name": "title", "comment": null}, "price": {"type": "integer", "index": 5, "name": "price", "comment": null}, "sku": {"type": "integer", "index": 6, "name": "sku", "comment": null}, "position": {"type": "integer", "index": 7, "name": "position", "comment": null}, "inventory_policy": {"type": "text", "index": 8, "name": "inventory_policy", "comment": null}, "compare_at_price": {"type": "integer", "index": 9, "name": "compare_at_price", "comment": null}, "fulfillment_service": {"type": "text", "index": 10, "name": "fulfillment_service", "comment": null}, "inventory_management": {"type": "text", "index": 11, "name": "inventory_management", "comment": null}, "created_at": {"type": "text", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "text", "index": 13, "name": "updated_at", "comment": null}, "taxable": {"type": "boolean", "index": 14, "name": "taxable", "comment": null}, "barcode": {"type": "integer", "index": 15, "name": "barcode", "comment": null}, "grams": {"type": "integer", "index": 16, "name": "grams", "comment": null}, "image_id": {"type": "integer", "index": 17, "name": "image_id", "comment": null}, "inventory_quantity": {"type": "integer", "index": 18, "name": "inventory_quantity", "comment": null}, "weight": {"type": "integer", "index": 19, "name": "weight", "comment": null}, "weight_unit": {"type": "text", "index": 20, "name": "weight_unit", "comment": null}, "old_inventory_quantity": {"type": "integer", "index": 21, "name": "old_inventory_quantity", "comment": null}, "requires_shipping": {"type": "boolean", "index": 22, "name": "requires_shipping", "comment": null}, "_fivetran_synced": {"type": "text", "index": 23, "name": "_fivetran_synced", "comment": null}, "option_2": {"type": "integer", "index": 24, "name": "option_2", "comment": null}, "tax_code": {"type": "text", "index": 25, "name": "tax_code", "comment": null}, "option_3": {"type": "integer", "index": 26, "name": "option_3", "comment": null}, "option_1": {"type": "text", "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__refund": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__refund", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "text", "index": 1, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "text", "index": 2, "name": "created_at", "comment": null}, "refund_id": {"type": "bigint", "index": 3, "name": "refund_id", "comment": null}, "note": {"type": "text", "index": 4, "name": "note", "comment": null}, "order_id": {"type": "bigint", "index": 5, "name": "order_id", "comment": null}, "processed_at": {"type": "text", "index": 6, "name": "processed_at", "comment": null}, "restock": {"type": "boolean", "index": 7, "name": "restock", "comment": null}, "user_id": {"type": "bigint", "index": 8, "name": "user_id", "comment": null}, "source_relation": {"type": "text", "index": 9, "name": "source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.shopify_source.stg_shopify__refund"}, "model.shopify_source.stg_shopify__refund_tmp": {"metadata": {"type": "VIEW", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__refund_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "created_at": {"type": "text", "index": 2, "name": "created_at", "comment": null}, "processed_at": {"type": "text", "index": 3, "name": "processed_at", "comment": null}, "note": {"type": "text", "index": 4, "name": "note", "comment": null}, "restock": {"type": "boolean", "index": 5, "name": "restock", "comment": null}, "user_id": {"type": "bigint", "index": 6, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "text", "index": 7, "name": "_fivetran_synced", "comment": null}, "total_duties_set": {"type": "integer", "index": 8, "name": "total_duties_set", "comment": null}, "order_id": {"type": "bigint", "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"}, "model.shopify_source.stg_shopify__transaction": {"metadata": {"type": "BASE TABLE", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__transaction", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"transaction_id": {"type": "bigint", "index": 1, "name": "transaction_id", "comment": null}, "order_id": {"type": "bigint", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "bigint", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "double precision", "index": 4, "name": "amount", "comment": null}, "created_timestamp": {"type": "text", "index": 5, "name": "created_timestamp", "comment": null}, "processed_timestamp": {"type": "text", "index": 6, "name": "processed_timestamp", "comment": null}, "device_id": {"type": "integer", "index": 7, "name": "device_id", "comment": null}, "gateway": {"type": "text", "index": 8, "name": "gateway", "comment": null}, "source_name": {"type": "text", "index": 9, "name": "source_name", "comment": null}, "message": {"type": "text", "index": 10, "name": "message", "comment": null}, "currency": {"type": "text", "index": 11, "name": "currency", "comment": null}, "location_id": {"type": "integer", "index": 12, "name": "location_id", "comment": null}, "parent_id": {"type": "integer", "index": 13, "name": "parent_id", "comment": null}, "payment_avs_result_code": {"type": "text", "index": 14, "name": "payment_avs_result_code", "comment": null}, "payment_credit_card_bin": {"type": "integer", "index": 15, "name": "payment_credit_card_bin", "comment": null}, "payment_cvv_result_code": {"type": "integer", "index": 16, "name": "payment_cvv_result_code", "comment": null}, "payment_credit_card_number": {"type": "integer", "index": 17, "name": "payment_credit_card_number", "comment": null}, "payment_credit_card_company": {"type": "integer", "index": 18, "name": "payment_credit_card_company", "comment": null}, "kind": {"type": "text", "index": 19, "name": "kind", "comment": null}, "receipt": {"type": "integer", "index": 20, "name": "receipt", "comment": null}, "currency_exchange_id": {"type": "integer", "index": 21, "name": "currency_exchange_id", "comment": null}, "currency_exchange_adjustment": {"type": "integer", "index": 22, "name": "currency_exchange_adjustment", "comment": null}, "currency_exchange_original_amount": {"type": "integer", "index": 23, "name": "currency_exchange_original_amount", "comment": null}, "currency_exchange_final_amount": {"type": "integer", "index": 24, "name": "currency_exchange_final_amount", "comment": null}, "currency_exchange_currency": {"type": "integer", "index": 25, "name": "currency_exchange_currency", "comment": null}, "error_code": {"type": "integer", "index": 26, "name": "error_code", "comment": null}, "status": {"type": "text", "index": 27, "name": "status", "comment": null}, "test": {"type": "boolean", "index": 28, "name": "test", "comment": null}, "user_id": {"type": "integer", "index": 29, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "text", "index": 30, "name": "_fivetran_synced", "comment": null}, "authorization": {"type": "text", "index": 31, "name": "authorization", "comment": null}, "source_relation": {"type": "text", "index": 32, "name": "source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.shopify_source.stg_shopify__transaction"}, "model.shopify_source.stg_shopify__transaction_tmp": {"metadata": {"type": "VIEW", "schema": "shopify_source_integration_test_stg_shopify", "name": "stg_shopify__transaction_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "bigint", "index": 2, "name": "order_id", "comment": null}, "refund_id": {"type": "bigint", "index": 3, "name": "refund_id", "comment": null}, "amount": {"type": "double precision", "index": 4, "name": "amount", "comment": null}, "authorization": {"type": "text", "index": 5, "name": "authorization", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "processed_at": {"type": "text", "index": 7, "name": "processed_at", "comment": null}, "device_id": {"type": "integer", "index": 8, "name": "device_id", "comment": null}, "gateway": {"type": "text", "index": 9, "name": "gateway", "comment": null}, "source_name": {"type": "text", "index": 10, "name": "source_name", "comment": null}, "message": {"type": "text", "index": 11, "name": "message", "comment": null}, "currency": {"type": "text", "index": 12, "name": "currency", "comment": null}, "location_id": {"type": "integer", "index": 13, "name": "location_id", "comment": null}, "parent_id": {"type": "integer", "index": 14, "name": "parent_id", "comment": null}, "payment_avs_result_code": {"type": "text", "index": 15, "name": "payment_avs_result_code", "comment": null}, "kind": {"type": "text", "index": 16, "name": "kind", "comment": null}, "currency_exchange_id": {"type": "integer", "index": 17, "name": "currency_exchange_id", "comment": null}, "currency_exchange_adjustment": {"type": "integer", "index": 18, "name": "currency_exchange_adjustment", "comment": null}, "currency_exchange_original_amount": {"type": "integer", "index": 19, "name": "currency_exchange_original_amount", "comment": null}, "currency_exchange_final_amount": {"type": "integer", "index": 20, "name": "currency_exchange_final_amount", "comment": null}, "currency_exchange_currency": {"type": "integer", "index": 21, "name": "currency_exchange_currency", "comment": null}, "error_code": {"type": "integer", "index": 22, "name": "error_code", "comment": null}, "status": {"type": "text", "index": 23, "name": "status", "comment": null}, "test": {"type": "boolean", "index": 24, "name": "test", "comment": null}, "user_id": {"type": "integer", "index": 25, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "text", "index": 26, "name": "_fivetran_synced", "comment": null}, "payment_credit_card_bin": {"type": "integer", "index": 27, "name": "payment_credit_card_bin", "comment": null}, "payment_cvv_result_code": {"type": "integer", "index": 28, "name": "payment_cvv_result_code", "comment": null}, "payment_credit_card_number": {"type": "integer", "index": 29, "name": "payment_credit_card_number", "comment": null}, "payment_credit_card_company": {"type": "integer", "index": 30, "name": "payment_credit_card_company", "comment": null}, "receipt": {"type": "integer", "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"}}, "sources": {}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.3.0", "generated_at": "2022-10-26T22:54:03.806652Z", "invocation_id": "93672367-11f1-48dc-abc4-59ed018fc7f4", "env": {}}, "nodes": {"seed.shopify_source_integration_tests.shopify_product_data": {"metadata": {"type": "table", "schema": "shopify_source_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_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 549.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.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": "seed.shopify_source_integration_tests.shopify_product_data"}, "seed.shopify_source_integration_tests.shopify_order_line_data": {"metadata": {"type": "table", "schema": "shopify_source_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_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 727.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.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": "seed.shopify_source_integration_tests.shopify_order_line_data"}, "seed.shopify_source_integration_tests.shopify_customer_data": {"metadata": {"type": "table", "schema": "shopify_source_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_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 512.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.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": "seed.shopify_source_integration_tests.shopify_customer_data"}, "seed.shopify_source_integration_tests.shopify_refund_data": {"metadata": {"type": "table", "schema": "shopify_source_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_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 606.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.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": "seed.shopify_source_integration_tests.shopify_refund_data"}, "seed.shopify_source_integration_tests.shopify_product_variant_data": {"metadata": {"type": "table", "schema": "shopify_source_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_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1123.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.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": "seed.shopify_source_integration_tests.shopify_product_variant_data"}, "seed.shopify_source_integration_tests.shopify_order_data": {"metadata": {"type": "table", "schema": "shopify_source_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_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3850.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.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": "seed.shopify_source_integration_tests.shopify_order_data"}, "seed.shopify_source_integration_tests.shopify_order_adjustment_data": {"metadata": {"type": "table", "schema": "shopify_source_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_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 531.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.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": "seed.shopify_source_integration_tests.shopify_order_adjustment_data"}, "seed.shopify_source_integration_tests.shopify_transaction_data": {"metadata": {"type": "table", "schema": "shopify_source_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": "INT64", "index": 31, "name": "receipt", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 960.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.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": "seed.shopify_source_integration_tests.shopify_transaction_data"}, "seed.shopify_source_integration_tests.shopify_order_line_refund_data": {"metadata": {"type": "table", "schema": "shopify_source_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": "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": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 352.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.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": "seed.shopify_source_integration_tests.shopify_order_line_refund_data"}, "model.shopify_source.stg_shopify__transaction_tmp": {"metadata": {"type": "view", "schema": "shopify_source_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": {"metadata": {"type": "table", "schema": "shopify_source_integration_tests_stg_shopify", "name": "stg_shopify__order", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INT64", "index": 1, "name": "order_id", "comment": null}, "processed_timestamp": {"type": "TIMESTAMP", "index": 2, "name": "processed_timestamp", "comment": null}, "updated_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "updated_timestamp", "comment": null}, "user_id": {"type": "INT64", "index": 4, "name": "user_id", "comment": null}, "total_discounts": {"type": "FLOAT64", "index": 5, "name": "total_discounts", "comment": null}, "total_line_items_price": {"type": "FLOAT64", "index": 6, "name": "total_line_items_price", "comment": null}, "total_price": {"type": "FLOAT64", "index": 7, "name": "total_price", "comment": null}, "total_tax": {"type": "INT64", "index": 8, "name": "total_tax", "comment": null}, "source_name": {"type": "STRING", "index": 9, "name": "source_name", "comment": null}, "subtotal_price": {"type": "FLOAT64", "index": 10, "name": "subtotal_price", "comment": null}, "has_taxes_included": {"type": "BOOL", "index": 11, "name": "has_taxes_included", "comment": null}, "total_weight": {"type": "INT64", "index": 12, "name": "total_weight", "comment": null}, "landing_site_base_url": {"type": "STRING", "index": 13, "name": "landing_site_base_url", "comment": null}, "location_id": {"type": "INT64", "index": 14, "name": "location_id", "comment": null}, "name": {"type": "STRING", "index": 15, "name": "name", "comment": null}, "note": {"type": "STRING", "index": 16, "name": "note", "comment": null}, "number": {"type": "INT64", "index": 17, "name": "number", "comment": null}, "order_number": {"type": "INT64", "index": 18, "name": "order_number", "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}, "processing_method": {"type": "STRING", "index": 30, "name": "processing_method", "comment": null}, "referring_site": {"type": "STRING", "index": 31, "name": "referring_site", "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_company": {"type": "STRING", "index": 35, "name": "billing_address_company", "comment": null}, "billing_address_country": {"type": "STRING", "index": 36, "name": "billing_address_country", "comment": null}, "billing_address_country_code": {"type": "STRING", "index": 37, "name": "billing_address_country_code", "comment": null}, "billing_address_first_name": {"type": "STRING", "index": 38, "name": "billing_address_first_name", "comment": null}, "billing_address_last_name": {"type": "STRING", "index": 39, "name": "billing_address_last_name", "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}, "billing_address_name": {"type": "STRING", "index": 42, "name": "billing_address_name", "comment": null}, "billing_address_phone": {"type": "STRING", "index": 43, "name": "billing_address_phone", "comment": null}, "billing_address_province": {"type": "STRING", "index": 44, "name": "billing_address_province", "comment": null}, "billing_address_province_code": {"type": "INT64", "index": 45, "name": "billing_address_province_code", "comment": null}, "billing_address_zip": {"type": "STRING", "index": 46, "name": "billing_address_zip", "comment": null}, "browser_ip": {"type": "STRING", "index": 47, "name": "browser_ip", "comment": null}, "has_buyer_accepted_marketing": {"type": "BOOL", "index": 48, "name": "has_buyer_accepted_marketing", "comment": null}, "total_shipping_price_set": {"type": "STRING", "index": 49, "name": "total_shipping_price_set", "comment": null}, "shipping_address_address_1": {"type": "STRING", "index": 50, "name": "shipping_address_address_1", "comment": null}, "shipping_address_address_2": {"type": "STRING", "index": 51, "name": "shipping_address_address_2", "comment": null}, "shipping_address_city": {"type": "STRING", "index": 52, "name": "shipping_address_city", "comment": null}, "shipping_address_company": {"type": "STRING", "index": 53, "name": "shipping_address_company", "comment": null}, "shipping_address_country": {"type": "STRING", "index": 54, "name": "shipping_address_country", "comment": null}, "shipping_address_country_code": {"type": "STRING", "index": 55, "name": "shipping_address_country_code", "comment": null}, "shipping_address_first_name": {"type": "STRING", "index": 56, "name": "shipping_address_first_name", "comment": null}, "shipping_address_last_name": {"type": "STRING", "index": 57, "name": "shipping_address_last_name", "comment": null}, "shipping_address_latitude": {"type": "STRING", "index": 58, "name": "shipping_address_latitude", "comment": null}, "shipping_address_longitude": {"type": "STRING", "index": 59, "name": "shipping_address_longitude", "comment": null}, "shipping_address_name": {"type": "STRING", "index": 60, "name": "shipping_address_name", "comment": null}, "shipping_address_phone": {"type": "STRING", "index": 61, "name": "shipping_address_phone", "comment": null}, "shipping_address_province": {"type": "STRING", "index": 62, "name": "shipping_address_province", "comment": null}, "shipping_address_province_code": {"type": "INT64", "index": 63, "name": "shipping_address_province_code", "comment": null}, "shipping_address_zip": {"type": "STRING", "index": 64, "name": "shipping_address_zip", "comment": null}, "is_test_order": {"type": "BOOL", "index": 65, "name": "is_test_order", "comment": null}, "token": {"type": "STRING", "index": 66, "name": "token", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 67, "name": "_fivetran_synced", "comment": null}, "source_relation": {"type": "STRING", "index": 68, "name": "source_relation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3856.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.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.shopify_source.stg_shopify__order"}, "model.shopify_source.stg_shopify__customer": {"metadata": {"type": "table", "schema": "shopify_source_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}, "source_relation": {"type": "STRING", "index": 16, "name": "source_relation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 518.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.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.shopify_source.stg_shopify__customer"}, "model.shopify_source.stg_shopify__refund": {"metadata": {"type": "table", "schema": "shopify_source_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}, "source_relation": {"type": "STRING", "index": 9, "name": "source_relation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 616.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.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.shopify_source.stg_shopify__refund"}, "model.shopify_source.stg_shopify__refund_tmp": {"metadata": {"type": "view", "schema": "shopify_source_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"}, "model.shopify_source.stg_shopify__order_adjustment_tmp": {"metadata": {"type": "view", "schema": "shopify_source_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__product": {"metadata": {"type": "table", "schema": "shopify_source_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}, "source_relation": {"type": "STRING", "index": 12, "name": "source_relation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 555.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.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.shopify_source.stg_shopify__product"}, "model.shopify_source.stg_shopify__order_tmp": {"metadata": {"type": "view", "schema": "shopify_source_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__customer_tmp": {"metadata": {"type": "view", "schema": "shopify_source_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__product_variant": {"metadata": {"type": "table", "schema": "shopify_source_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}, "source_relation": {"type": "STRING", "index": 28, "name": "source_relation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1133.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.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.shopify_source.stg_shopify__product_variant"}, "model.shopify_source.stg_shopify__order_line_refund": {"metadata": {"type": "table", "schema": "shopify_source_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}, "source_relation": {"type": "STRING", "index": 10, "name": "source_relation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 362.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.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.shopify_source.stg_shopify__order_line_refund"}, "model.shopify_source.stg_shopify__order_line_tmp": {"metadata": {"type": "view", "schema": "shopify_source_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_adjustment": {"metadata": {"type": "table", "schema": "shopify_source_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}, "source_relation": {"type": "STRING", "index": 9, "name": "source_relation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 541.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.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.shopify_source.stg_shopify__order_adjustment"}, "model.shopify_source.stg_shopify__transaction": {"metadata": {"type": "table", "schema": "shopify_source_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}, "source_relation": {"type": "STRING", "index": 31, "name": "source_relation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 914.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 5.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.shopify_source.stg_shopify__transaction"}, "model.shopify_source.stg_shopify__order_line": {"metadata": {"type": "table", "schema": "shopify_source_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}, "source_relation": {"type": "STRING", "index": 27, "name": "source_relation", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 733.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.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.shopify_source.stg_shopify__order_line"}, "model.shopify_source.stg_shopify__product_variant_tmp": {"metadata": {"type": "view", "schema": "shopify_source_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_refund_tmp": {"metadata": {"type": "view", "schema": "shopify_source_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__product_tmp": {"metadata": {"type": "view", "schema": "shopify_source_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"}}, "sources": {}, "errors": null} diff --git a/docs/manifest.json b/docs/manifest.json index 8b36990..cceccd4 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", "dbt_version": "1.3.0", "generated_at": "2022-12-15T20:50:08.036823Z", "invocation_id": "56ee5110-9361-4962-b1b1-90ab0e8b3cef", "env": {}, "project_id": "f2f22d4d8db9dfa8a08831bb14141bc2", "user_id": "8929baf0-9bc1-477e-9a57-eb8b0db4da62", "send_anonymous_usage_stats": true, "adapter_type": "postgres"}, "nodes": {"seed.shopify_source_integration_tests.shopify_order_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "processed_at": "timestamp", "cancelled_at": "timestamp", "_fivetran_synced": "timestamp", "id": "bigint", "customer_id": "bigint", "location_id": "bigint", "user_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": true, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test", "fqn": ["shopify_source_integration_tests", "shopify_order_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_data", "raw_code": "", "language": "sql", "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": "seeds/shopify_order_data.csv", "name": "shopify_order_data", "alias": "shopify_order_data", "checksum": {"name": "sha256", "checksum": "4d0dd043a886a0d9e7680e7ee2cd132717490f75d3a06fe7c38956d901976146"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1671137397.761139, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test\".\"shopify_order_data\""}, "seed.shopify_source_integration_tests.shopify_order_line_refund_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint", "location_id": "bigint", "refund_id": "bigint", "order_line_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": true, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test", "fqn": ["shopify_source_integration_tests", "shopify_order_line_refund_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_refund_data", "raw_code": "", "language": "sql", "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": "seeds/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1671137397.767766, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test\".\"shopify_order_line_refund_data\""}, "seed.shopify_source_integration_tests.shopify_order_adjustment_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "bigint", "order_id": "bigint", "refund_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": true, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test", "fqn": ["shopify_source_integration_tests", "shopify_order_adjustment_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_adjustment_data", "raw_code": "", "language": "sql", "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": "seeds/shopify_order_adjustment_data.csv", "name": "shopify_order_adjustment_data", "alias": "shopify_order_adjustment_data", "checksum": {"name": "sha256", "checksum": "99899b3532a7e74a67063723058528563d4fedc8114e99e930cfbc8598a16da8"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1671137397.7690141, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test\".\"shopify_order_adjustment_data\""}, "seed.shopify_source_integration_tests.shopify_product_variant_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "bigint", "product_id": "bigint", "inventory_item_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": true, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test", "fqn": ["shopify_source_integration_tests", "shopify_product_variant_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_product_variant_data", "raw_code": "", "language": "sql", "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": "seeds/shopify_product_variant_data.csv", "name": "shopify_product_variant_data", "alias": "shopify_product_variant_data", "checksum": {"name": "sha256", "checksum": "5fbf997eaa32d49016b0ba5acd2201e60309b0b7fb3a83e5a782542502426abc"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1671137397.770448, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test\".\"shopify_product_variant_data\""}, "seed.shopify_source_integration_tests.shopify_refund_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "bigint", "order_id": "bigint", "user_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": true, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test", "fqn": ["shopify_source_integration_tests", "shopify_refund_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_refund_data", "raw_code": "", "language": "sql", "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": "seeds/shopify_refund_data.csv", "name": "shopify_refund_data", "alias": "shopify_refund_data", "checksum": {"name": "sha256", "checksum": "1efcab5977150427c6c7ef2c3aff396384bdd80dfd5872752836b027ea78e404"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1671137397.771877, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test\".\"shopify_refund_data\""}, "seed.shopify_source_integration_tests.shopify_transaction_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "bigint", "order_id": "bigint", "refund_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": true, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test", "fqn": ["shopify_source_integration_tests", "shopify_transaction_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_transaction_data", "raw_code": "", "language": "sql", "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": "seeds/shopify_transaction_data.csv", "name": "shopify_transaction_data", "alias": "shopify_transaction_data", "checksum": {"name": "sha256", "checksum": "353ca5206d7a0982439b57cda81d05e861b924f65071e3c2c2b6ad1ca7fccf75"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1671137397.773488, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test\".\"shopify_transaction_data\""}, "seed.shopify_source_integration_tests.shopify_product_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "published_at": "timestamp", "_fivetran_synced": "timestamp", "id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": true, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test", "fqn": ["shopify_source_integration_tests", "shopify_product_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_product_data", "raw_code": "", "language": "sql", "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": "seeds/shopify_product_data.csv", "name": "shopify_product_data", "alias": "shopify_product_data", "checksum": {"name": "sha256", "checksum": "5cc03f90512ac04a6526220040085e4e0488b62ef22e8b201424c7d7cf1bf847"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1671137397.774741, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test\".\"shopify_product_data\""}, "seed.shopify_source_integration_tests.shopify_customer_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp", "id": "bigint", "default_address_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": true, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test", "fqn": ["shopify_source_integration_tests", "shopify_customer_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_customer_data", "raw_code": "", "language": "sql", "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": "seeds/shopify_customer_data.csv", "name": "shopify_customer_data", "alias": "shopify_customer_data", "checksum": {"name": "sha256", "checksum": "79bc0a5972c321cefe2973acdd443ce1d42e36b3b23b2298151046d23bdf4bea"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1671137397.776083, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test\".\"shopify_customer_data\""}, "seed.shopify_source_integration_tests.shopify_order_line_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "order_id": "bigint", "id": "bigint", "product_id": "bigint", "variant_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": true, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test", "fqn": ["shopify_source_integration_tests", "shopify_order_line_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_data", "raw_code": "", "language": "sql", "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": "seeds/shopify_order_line_data.csv", "name": "shopify_order_line_data", "alias": "shopify_order_line_data", "checksum": {"name": "sha256", "checksum": "cabaa49c9bd299b34eb2154893a6dd399fbbad7e4ad7036293c8b4cb599199e0"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1671137397.777282, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test\".\"shopify_order_line_data\""}, "model.shopify_source.stg_shopify__order_line": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line"], "unique_id": "model.shopify_source.stg_shopify__order_line", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__order_line.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1671137398.033872, "compiled_code": "with source as (\n\n select * from \"postgres\".\"shopify_source_integration_test_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 numeric(28,6)) as \n \n property_charge_interval_frequency\n \n , \n cast(null as TEXT) as \n \n property_for_shipping_jan_3_rd_2020\n \n , \n cast(null as numeric(28,6)) as \n \n property_shipping_interval_frequency\n \n , \n cast(null as TEXT) as \n \n property_shipping_interval_unit_type\n \n , \n cast(null as numeric(28,6)) 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 \n\n\n, cast('' as TEXT) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_line\""}, "model.shopify_source.stg_shopify__refund": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "stg_shopify__refund"], "unique_id": "model.shopify_source.stg_shopify__refund", "raw_code": "--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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__refund.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "enabled": true}, "created_at": 1671137398.0579, "compiled_code": "--To disable this model, set the shopify__using_refund variable within your dbt_project.yml file to False.\n\n\nwith source as (\n\n select * \n from \"postgres\".\"shopify_source_integration_test_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 \n\n\n, cast('' as TEXT) as source_relation\n\n\n\n \n from source\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__refund\""}, "model.shopify_source.stg_shopify__product": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product"], "unique_id": "model.shopify_source.stg_shopify__product", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__product.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1671137398.046378, "compiled_code": "with source as (\n\n select * from \"postgres\".\"shopify_source_integration_test_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 \n\n\n, cast('' as TEXT) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__product\""}, "model.shopify_source.stg_shopify__product_variant": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product_variant"], "unique_id": "model.shopify_source.stg_shopify__product_variant", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__product_variant.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1671137398.050719, "compiled_code": "with source as (\n\n select * from \"postgres\".\"shopify_source_integration_test_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 \n\n\n, cast('' as TEXT) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__product_variant\""}, "model.shopify_source.stg_shopify__order": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order"], "unique_id": "model.shopify_source.stg_shopify__order", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__order.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1671137398.0445042, "compiled_code": "with source as (\n\n select * from \"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_tmp\"\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n id\n \n as order_id , \n \n \n processed_at\n \n as processed_timestamp , \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 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 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 total_weight\n \n as \n \n total_weight\n \n, \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 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 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 \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 cast(null as TEXT) 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 test\n \n as is_test_order , \n \n \n token\n \n as \n \n token\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 \n\n\n, cast('' as TEXT) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order\""}, "model.shopify_source.stg_shopify__transaction": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "stg_shopify__transaction"], "unique_id": "model.shopify_source.stg_shopify__transaction", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__transaction.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1671137398.0559092, "compiled_code": "with source as (\n\n select * from \"postgres\".\"shopify_source_integration_test_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 \n \"authorization\"\n \n \n \n as authorization \n\n\n\n --The below script allows for pass through columns.\n \n\n \n\n\n, cast('' as TEXT) as source_relation\n\n\n\n\n from source\n where not test\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__transaction\""}, "model.shopify_source.stg_shopify__order_adjustment": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_adjustment"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment", "raw_code": "--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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__order_adjustment.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "enabled": true}, "created_at": 1671137398.0599198, "compiled_code": "--To disable this model, set the shopify__using_order_adjustment variable within your dbt_project.yml file to False.\n\n\nwith source as (\n\n select * \n from \"postgres\".\"shopify_source_integration_test_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 \n\n\n, cast('' as TEXT) as source_relation\n\n\n\n \n from source\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_adjustment\""}, "model.shopify_source.stg_shopify__customer": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "stg_shopify__customer"], "unique_id": "model.shopify_source.stg_shopify__customer", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__customer.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1671137398.0285408, "compiled_code": "with source as (\n\n select * from \"postgres\".\"shopify_source_integration_test_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 \n\n\n, cast('' as TEXT) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__customer\""}, "model.shopify_source.stg_shopify__order_line_refund": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line_refund"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund", "raw_code": "--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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__order_line_refund.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "enabled": true}, "created_at": 1671137398.030402, "compiled_code": "--To disable this model, set the shopify__using_order_line_refund variable within your dbt_project.yml file to False.\n\n\nwith source as (\n\n select * from \"postgres\".\"shopify_source_integration_test_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 \n\n\n, cast('' as TEXT) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_line_refund\""}, "model.shopify_source.stg_shopify__customer_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_customer_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__customer_tmp"], "unique_id": "model.shopify_source.stg_shopify__customer_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_customer_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__customer_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1671137397.934604, "compiled_code": "\n\n\n\n select * \n from \"postgres\".\"shopify_source_integration_test\".\"shopify_customer_data\"\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__customer_tmp\""}, "model.shopify_source.stg_shopify__order_line_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_order_line_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_order_line_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_line_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1671137397.947266, "compiled_code": "\n\n\n\n select * \n from \"postgres\".\"shopify_source_integration_test\".\"shopify_order_line_data\"\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_line_tmp\""}, "model.shopify_source.stg_shopify__refund_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_refund_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__refund_tmp", "raw_code": "--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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_refund_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__refund_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view", "enabled": true}, "created_at": 1671137397.951554, "compiled_code": "--To disable this model, set the shopify__using_refund variable within your dbt_project.yml file to False.\n\n\n\n\n\n\n select * \n from \"postgres\".\"shopify_source_integration_test\".\"shopify_refund_data\"\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__refund_tmp\""}, "model.shopify_source.stg_shopify__product_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_product_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_product_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__product_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1671137397.955907, "compiled_code": "\n\n\n\n select * \n from \"postgres\".\"shopify_source_integration_test\".\"shopify_product_data\"\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__product_tmp\""}, "model.shopify_source.stg_shopify__order_adjustment_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_order_adjustment_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_adjustment_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment_tmp", "raw_code": "--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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_order_adjustment_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_adjustment_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view", "enabled": true}, "created_at": 1671137397.960763, "compiled_code": "--To disable this model, set the shopify__using_order_adjustment variable within your dbt_project.yml file to False.\n\n\n\n\n\n\n select * \n from \"postgres\".\"shopify_source_integration_test\".\"shopify_order_adjustment_data\"\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_adjustment_tmp\""}, "model.shopify_source.stg_shopify__order_line_refund_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_order_line_refund_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund_tmp", "raw_code": "--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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_order_line_refund_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_line_refund_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view", "enabled": true}, "created_at": 1671137397.965364, "compiled_code": "--To disable this model, set the shopify__using_order_line_refund variable within your dbt_project.yml file to False.\n\n\n\n\n\n\n select * \n from \"postgres\".\"shopify_source_integration_test\".\"shopify_order_line_refund_data\"\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_line_refund_tmp\""}, "model.shopify_source.stg_shopify__transaction_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_transaction_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__transaction_tmp"], "unique_id": "model.shopify_source.stg_shopify__transaction_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_transaction_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__transaction_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1671137397.969732, "compiled_code": "\n\n\n\n select * \n from \"postgres\".\"shopify_source_integration_test\".\"shopify_transaction_data\"\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__transaction_tmp\""}, "model.shopify_source.stg_shopify__product_variant_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_product_variant_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_variant_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_variant_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_product_variant_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__product_variant_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1671137397.973655, "compiled_code": "\n\n\n\n select * \n from \"postgres\".\"shopify_source_integration_test\".\"shopify_product_variant_data\"\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__product_variant_tmp\""}, "model.shopify_source.stg_shopify__order_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_order_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "shopify_source_integration_test_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": "f4fd2563557b13c2b54531a7fa9995e496aa1b39432d729a010ddcb7e10001ae"}, "tags": [], "refs": [["shopify_order_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1671137397.977522, "compiled_code": "\n\n\n\n select * \n from \"postgres\".\"shopify_source_integration_test\".\"shopify_order_data\"\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_tmp\""}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__customer_customer_id__source_relation.1b2185db25": {"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"}, "compiled": true, "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": "postgres", "schema": "shopify_source_integration_test_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be"}, "created_at": 1671137398.064517, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n customer_id, source_relation\n from \"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__customer\"\n group by customer_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "postgres", "schema": "shopify_source_integration_test_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3"}, "created_at": 1671137398.0721762, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n order_line_refund_id, source_relation\n from \"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_line_refund\"\n group by order_line_refund_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "postgres", "schema": "shopify_source_integration_test_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec"}, "created_at": 1671137398.075613, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n order_line_id, source_relation\n from \"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_line\"\n group by order_line_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "postgres", "schema": "shopify_source_integration_test_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e"}, "created_at": 1671137398.078656, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n order_id, source_relation\n from \"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order\"\n group by order_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_shopify__order"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_product_id__source_relation.48b32ab6a2": {"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"}, "compiled": true, "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": "postgres", "schema": "shopify_source_integration_test_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d"}, "created_at": 1671137398.081722, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n product_id, source_relation\n from \"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__product\"\n group by product_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "postgres", "schema": "shopify_source_integration_test_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e"}, "created_at": 1671137398.0848699, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n variant_id, source_relation\n from \"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__product_variant\"\n group by variant_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "postgres", "schema": "shopify_source_integration_test_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92"}, "created_at": 1671137398.0875762, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n transaction_id, source_relation\n from \"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__transaction\"\n group by transaction_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_shopify__transaction"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__refund_refund_id__source_relation.cd4dbc2b35": {"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"}, "compiled": true, "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": "postgres", "schema": "shopify_source_integration_test_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659"}, "created_at": 1671137398.0909529, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n refund_id, source_relation\n from \"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__refund\"\n group by refund_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "postgres", "schema": "shopify_source_integration_test_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207"}, "created_at": 1671137398.093942, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n order_adjustment_id, source_relation\n from \"postgres\".\"shopify_source_integration_test_stg_shopify\".\"stg_shopify__order_adjustment\"\n group by order_adjustment_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_shopify__order_adjustment"}}, "sources": {"source.shopify_source.shopify.order": {"fqn": ["shopify_source", "shopify", "order"], "database": "postgres", "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_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": "\"postgres\".\"shopify\".\"order\"", "created_at": 1671137398.1344059}, "source.shopify_source.shopify.customer": {"fqn": ["shopify_source", "shopify", "customer"], "database": "postgres", "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_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": "\"postgres\".\"shopify\".\"customer\"", "created_at": 1671137398.1345332}, "source.shopify_source.shopify.order_line": {"fqn": ["shopify_source", "shopify", "order_line"], "database": "postgres", "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_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": "\"postgres\".\"shopify\".\"order_line\"", "created_at": 1671137398.13462}, "source.shopify_source.shopify.order_line_refund": {"fqn": ["shopify_source", "shopify", "order_line_refund"], "database": "postgres", "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_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": "\"postgres\".\"shopify\".\"order_line_refund\"", "created_at": 1671137398.134691}, "source.shopify_source.shopify.product": {"fqn": ["shopify_source", "shopify", "product"], "database": "postgres", "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_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": "\"postgres\".\"shopify\".\"product\"", "created_at": 1671137398.134764}, "source.shopify_source.shopify.product_variant": {"fqn": ["shopify_source", "shopify", "product_variant"], "database": "postgres", "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_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": "\"postgres\".\"shopify\".\"product_variant\"", "created_at": 1671137398.1348538}, "source.shopify_source.shopify.transaction": {"fqn": ["shopify_source", "shopify", "transaction"], "database": "postgres", "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_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": "\"postgres\".\"shopify\".\"transaction\"", "created_at": 1671137398.134944}, "source.shopify_source.shopify.refund": {"fqn": ["shopify_source", "shopify", "refund"], "database": "postgres", "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_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": "\"postgres\".\"shopify\".\"refund\"", "created_at": 1671137398.135013}, "source.shopify_source.shopify.order_adjustment": {"fqn": ["shopify_source", "shopify", "order_adjustment"], "database": "postgres", "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_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": "\"postgres\".\"shopify\".\"order_adjustment\"", "created_at": 1671137398.135263}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"unique_id": "macro.dbt_postgres.postgres__current_timestamp", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1638, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1640372, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.164157, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.164275, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1643891, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"unique_id": "macro.dbt_postgres.postgres__get_catalog", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n\n {%- call statement('catalog', fetch_result=True) -%}\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n\n where (\n {%- for schema in schemas -%}\n upper(sch.nspname) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table, [m]aterialized view\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.165638, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"unique_id": "macro.dbt_postgres.postgres_get_relations", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "name": "postgres_get_relations", "macro_sql": "{% macro postgres_get_relations () -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select distinct\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1664262, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"unique_id": "macro.dbt_postgres.postgres__create_table_as", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.172336, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }});\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.172874, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"unique_id": "macro.dbt_postgres.postgres__create_schema", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.173217, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"unique_id": "macro.dbt_postgres.postgres__drop_schema", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.173551, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.174048, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.174434, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"unique_id": "macro.dbt_postgres.postgres__information_schema_name", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.174614, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"unique_id": "macro.dbt_postgres.postgres__list_schemas", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.174979, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1753962, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.176279, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.176521, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1768918, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1771898, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"unique_id": "macro.dbt_postgres.postgres_escape_comment", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.177635, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.177872, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.178544, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.178774, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"unique_id": "macro.dbt_postgres.postgres__copy_grants", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1789, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "name": "postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.179633, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "name": "postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }}\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and {{ target }}.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.180487, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"unique_id": "macro.dbt_postgres.postgres__dateadd", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1809988, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"unique_id": "macro.dbt_postgres.postgres__listagg", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.181948, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"unique_id": "macro.dbt_postgres.postgres__datediff", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/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 ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1853309, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"unique_id": "macro.dbt_postgres.postgres__any_value", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.185628, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"unique_id": "macro.dbt_postgres.postgres__last_day", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/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.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.186265, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"unique_id": "macro.dbt_postgres.postgres__split_part", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/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.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.186784, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.188132, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.188353, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1885061, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.188651, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.188801, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1893172, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.189638, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1900532, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1906931, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.1909802, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.194935, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.195136, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.195391, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.196203, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.196379, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.196567, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.198026, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.19946, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.203476, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.203788, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.203985, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.20408, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2042408, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.20436, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.204572, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.205502, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.205714, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.205976, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.206433, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.212666, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.214921, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2155268, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.21587, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.216374, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.216783, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.218557, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.219124, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.219794, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2200289, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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": "default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.220736, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2252722, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.227031, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2272892, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.228112, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.228414, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.229099, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.22992, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.230897, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.231157, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.231384, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.231667, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.23187, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.232159, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.232369, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2326431, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.232838, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.232992, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.233299, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.23844, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.243912, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.245294, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2466931, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2477078, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.250325, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.250891, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.251075, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.251502, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.251937, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.254901, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.255386, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2556338, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\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", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.25735, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.25794, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.258124, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.258359, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.258649, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "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.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2623239, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.267148, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.268066, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.268307, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.268789, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.268981, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.269112, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.269251, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2693639, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.269521, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2696378, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.270129, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.270323, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2716181, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.272347, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.27265, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.273417, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.273729, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2740512, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2746172, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2749052, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.275442, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.275855, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2761931, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.276869, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.27851, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.27921, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.279563, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.28145, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.282753, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.283623, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.283933, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2843919, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.284513, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.285038, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.285218, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.285579, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.285711, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.286052, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2861571, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.28658, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.286746, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2870688, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.287146, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.287488, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2876291, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.287992, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.288212, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/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') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.288893, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.289294, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.289719, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2898781, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2902322, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.290378, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2906911, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.290848, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/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') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.291153, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/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 {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.291305, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.291606, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.291709, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.292048, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2922418, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.292765, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.29289, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.293914, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2940748, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.294592, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.29476, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.29493, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.295089, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.295251, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.295434, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2956002, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.295757, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.295973, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.296128, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2963, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.296447, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.296857, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.296997, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2973409, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.297448, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2978728, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.29819, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.298366, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/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') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.299028, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.299211, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.29953, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.2999191, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3000588, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.300538, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3008032, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3011782, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3013198, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.301776, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.30197, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.302141, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.302337, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.302909, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.30311, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3032708, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.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.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.303384, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.303562, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.303641, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.303818, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3039901, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.304613, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3048708, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3050408, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.30548, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3087602, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.308943, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.309172, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.309483, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.309742, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.310088, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.310279, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.310498, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.310688, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.310854, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.311091, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.311389, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3116531, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.312238, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.312562, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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 {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.312713, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.312914, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.313517, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.313953, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.315723, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3158479, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.316027, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.316143, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.31651, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.316709, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3168142, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.317051, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.317245, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.317479, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3176699, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3179069, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.318599, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3188732, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3191302, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3193731, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3207302, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.321511, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.321685, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.321889, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.322054, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.322322, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.32279, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3245, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3248022, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.325012, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.325181, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.325374, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.325637, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.325851, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3261728, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.326414, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.326613, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.328491, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.328764, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.329107, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3293178, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3297138, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3299708, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3306, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.330868, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.331719, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.333364, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.333863, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == 'language' -%}\n {%- set value = 'python' -%}\n {%- endif -%}\n {%- set value = model.config[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.334351, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = '{{ this.database }}'\n schema = '{{ this.schema }}'\n identifier = '{{ this.identifier }}'\n def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3347762, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3348548, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3354912, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.335744, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3360682, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.33637, "supported_languages": null}, "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_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.type_numeric(), \"alias\": \"order_id\"},\n {\"name\": \"processed_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"user_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"total_discounts\", \"datatype\": dbt.type_float()},\n {\"name\": \"total_line_items_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"total_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"total_tax\", \"datatype\": dbt.type_float()},\n {\"name\": \"source_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"subtotal_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"taxes_included\", \"datatype\": \"boolean\", \"alias\": \"has_taxes_included\"},\n {\"name\": \"total_weight\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"landing_site_base_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"note\", \"datatype\": dbt.type_string()},\n {\"name\": \"number\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"order_number\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"cancel_reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"cancelled_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"cancelled_timestamp\"},\n {\"name\": \"cart_token\", \"datatype\": dbt.type_string()},\n {\"name\": \"checkout_token\", \"datatype\": dbt.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"closed_timestamp\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"customer_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"financial_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"processing_method\", \"datatype\": dbt.type_string()},\n {\"name\": \"referring_site\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_address_1\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_address_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_company\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_latitude\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_longitude\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_province\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_province_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_zip\", \"datatype\": dbt.type_string()},\n {\"name\": \"browser_ip\", \"datatype\": dbt.type_string()},\n {\"name\": \"buyer_accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_buyer_accepted_marketing\"},\n {\"name\": \"total_shipping_price_set\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_address_1\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_address_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_company\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_latitude\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_longitude\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_province\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_province_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_zip\", \"datatype\": dbt.type_string()},\n {\"name\": \"test\", \"datatype\": \"boolean\", \"alias\": \"is_test_order\"},\n {\"name\": \"token\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_timestamp", "macro.dbt.type_float", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.351639, "supported_languages": null}, "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_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.type_timestamp()},\n {\"name\": \"accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_accepted_marketing\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"default_address_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric(), \"alias\": \"customer_id\"},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"orders_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"state\", \"datatype\": dbt.type_string(), \"alias\": \"account_state\"},\n {\"name\": \"tax_exempt\", \"datatype\": \"boolean\", \"alias\": \"is_tax_exempt\"},\n {\"name\": \"total_spent\", \"datatype\": dbt.type_float()},\n {\"name\": \"updated_at\", \"datatype\": dbt.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.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.353388, "supported_languages": null}, "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_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.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric(), \"alias\": \"order_line_refund_id\"},\n {\"name\": \"location_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"order_line_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"subtotal\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"total_tax\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt.type_float()},\n {\"name\": \"refund_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"restock_type\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.354384, "supported_languages": null}, "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_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.type_timestamp()},\n {\"name\": \"fulfillable_quantity\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"gift_card\", \"datatype\": \"boolean\", \"alias\": \"is_gift_card\"},\n {\"name\": \"grams\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric(), \"alias\": \"order_line_id\"},\n {\"name\": \"index\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"pre_tax_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"price\", \"datatype\": dbt.type_float()},\n {\"name\": \"product_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"property_charge_interval_frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"property_for_shipping_jan_3_rd_2020\", \"datatype\": dbt.type_string()},\n {\"name\": \"property_shipping_interval_frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"property_shipping_interval_unit_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"property_subscription_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"requires_shipping\", \"datatype\": \"boolean\", \"alias\": \"is_requiring_shipping\"},\n {\"name\": \"sku\", \"datatype\": dbt.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"total_discount\", \"datatype\": dbt.type_float()},\n {\"name\": \"variant_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"vendor\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.356857, "supported_languages": null}, "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_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.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"handle\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric(), \"alias\": \"product_id\"},\n {\"name\": \"product_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"published_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"published_timestamp\"},\n {\"name\": \"published_scope\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"vendor\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3580952, "supported_languages": null}, "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_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.type_numeric(), \"alias\": \"variant_id\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"product_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"inventory_item_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"image_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"price\", \"datatype\": dbt.type_float()},\n {\"name\": \"sku\", \"datatype\": dbt.type_string()},\n {\"name\": \"position\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"inventory_policy\", \"datatype\": dbt.type_string()},\n {\"name\": \"compare_at_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt.type_string()},\n {\"name\": \"inventory_management\", \"datatype\": dbt.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"barcode\", \"datatype\": dbt.type_string()},\n {\"name\": \"grams\", \"datatype\": dbt.type_float()},\n {\"name\": \"inventory_quantity\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"weight\", \"datatype\": dbt.type_float()},\n {\"name\": \"weight_unit\", \"datatype\": dbt.type_string()},\n {\"name\": \"option_1\", \"datatype\": dbt.type_string()},\n {\"name\": \"option_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"option_3\", \"datatype\": dbt.type_string()},\n {\"name\": \"tax_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"old_inventory_quantity\", \"datatype\": dbt.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.type_numeric", "macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.360812, "supported_languages": null}, "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_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.type_numeric(), \"alias\": \"transaction_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"processed_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"device_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"gateway\", \"datatype\": dbt.type_string()},\n {\"name\": \"source_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"message\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"payment_avs_result_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"payment_credit_card_bin\", \"datatype\": dbt.type_string()},\n {\"name\": \"payment_cvv_result_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"payment_credit_card_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"payment_credit_card_company\", \"datatype\": dbt.type_string()},\n {\"name\": \"kind\", \"datatype\": dbt.type_string()},\n {\"name\": \"receipt\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency_exchange_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"currency_exchange_adjustment\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"currency_exchange_original_amount\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"currency_exchange_final_amount\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"currency_exchange_currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"test\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{% if target.type in ('redshift','postgres') %}\n {{ columns.append({\"name\": \"authorization\", \"datatype\": dbt.type_string(), \"quote\": True, \"alias\": \"authorization\"}) }}\n{% else %}\n {\"name\": \"authorization\", \"datatype\": dbt.type_string()}\n{% endif %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.364228, "supported_languages": null}, "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_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.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric(), \"alias\": \"refund_id\"},\n {\"name\": \"note\", \"datatype\": dbt.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"processed_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"restock\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.365178, "supported_languages": null}, "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_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.type_numeric(), \"alias\": \"order_adjustment_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"tax_amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"kind\", \"datatype\": dbt.type_string()},\n {\"name\": \"reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3660748, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3666701, "supported_languages": null}, "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_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.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3672042, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3678029, "supported_languages": null}, "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_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.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.368489, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.368907, "supported_languages": null}, "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_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.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.369249, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.370396, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.371569, "supported_languages": null}, "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_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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.372581, "supported_languages": null}, "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_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, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3738, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.374627, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3749702, "supported_languages": null}, "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_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, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.375752, "supported_languages": null}, "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_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, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.37667, "supported_languages": null}, "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_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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3771892, "supported_languages": null}, "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_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, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3776388, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.378292, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3787498, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.379335, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.37971, "supported_languages": null}, "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_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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.380223, "supported_languages": null}, "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_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, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.380687, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.381345, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3819818, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3825762, "supported_languages": null}, "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_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.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.382912, "supported_languages": null}, "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_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) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3834271, "supported_languages": null}, "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_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) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3839371, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.384806, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.385869, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3869, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.387873, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.38874, "supported_languages": null}, "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_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.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.389687, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.390294, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3906171, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.394078, "supported_languages": null}, "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_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 }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3956559, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.396043, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.396225, "supported_languages": null}, "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_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.396766, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.397119, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.397365, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.397776, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.397973, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.3987, "supported_languages": null}, "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_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.39968, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.400495, "supported_languages": null}, "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_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.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.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.40145, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.40173, "supported_languages": null}, "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_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 \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.402163, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.402619, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4030201, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.403886, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.404823, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4057548, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4061701, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.406357, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4068658, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4077282, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.408663, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4092858, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.409604, "supported_languages": null}, "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_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='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.410961, "supported_languages": null}, "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_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='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.412756, "supported_languages": null}, "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_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') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.414258, "supported_languages": null}, "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_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') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.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.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.41596, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"unique_id": "macro.dbt_utils.safe_divide", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "name": "safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.416422, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"unique_id": "macro.dbt_utils.default__safe_divide", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "name": "default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.416563, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4197938, "supported_languages": null}, "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_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 {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.423414, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.423855, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.424118, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.424961, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.425177, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.425374, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4255629, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.425727, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4258938, "supported_languages": null}, "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_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 {% 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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4263701, "supported_languages": null}, "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_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{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4266071, "supported_languages": null}, "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_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(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.427063, "supported_languages": null}, "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_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(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.427795, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.428285, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.428633, "supported_languages": null}, "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_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.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.430306, "supported_languages": null}, "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_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 {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.430687, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.431503, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.43203, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.433224, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.434804, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.435977, "supported_languages": null}, "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_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.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.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4368598, "supported_languages": null}, "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/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.437471, "supported_languages": null}, "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/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4382741, "supported_languages": null}, "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_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.43985, "supported_languages": null}, "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_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/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.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4403431, "supported_languages": null}, "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_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/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.safe_cast(expr, dbt.type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.440825, "supported_languages": null}, "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_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4410188, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.441547, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4421902, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4427562, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.443443, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.443924, "supported_languages": null}, "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/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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 {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.444067, "supported_languages": null}, "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/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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 {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.444206, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"unique_id": "macro.dbt_utils.get_single_value", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "name": "get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4447749, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"unique_id": "macro.dbt_utils.default__get_single_value", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "name": "default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.445645, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.446769, "supported_languages": null}, "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_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.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.447066, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.447836, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.448737, "supported_languages": null}, "macro.spark_utils.get_tables": {"unique_id": "macro.spark_utils.get_tables", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4539762, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"unique_id": "macro.spark_utils.get_delta_tables", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4547021, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"unique_id": "macro.spark_utils.get_statistic_columns", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.455605, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"unique_id": "macro.spark_utils.spark_optimize_delta_tables", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.456346, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.457094, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"unique_id": "macro.spark_utils.spark_analyze_tables", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.458336, "supported_languages": null}, "macro.spark_utils.spark__concat": {"unique_id": "macro.spark_utils.spark__concat", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.458824, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.45907, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.462424, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4702091, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4706209, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.470708, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.471475, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.47332, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4736881, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.473984, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.474272, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.474721, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"unique_id": "macro.spark_utils.default__assert_not_null", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4749498, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4752839, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4758358, "supported_languages": null}, "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_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.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.47691, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.477086, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.47728, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.477479, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.477646, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.477817, "supported_languages": null}, "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_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{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.478852, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.479619, "supported_languages": null}, "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_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.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4807732, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.481059, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.481408, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.48175, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4820201, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4822998, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4825711, "supported_languages": null}, "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_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.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.483066, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4831731, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.483275, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.483374, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.483834, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.484488, "supported_languages": null}, "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_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 is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4853592, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.485899, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.486043, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.48618, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.486309, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.486527, "supported_languages": null}, "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_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.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.489471, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4896472, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4898078, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.489967, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.49166, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.492563, "supported_languages": null}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.492704, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.49298, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.493265, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.493396, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.493526, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4936478, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4941912, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.494773, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.4953291, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.495531, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.49575, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.496078, "supported_languages": null}, "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_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 is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.497283, "supported_languages": null}, "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_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.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.501733, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.5022058, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.502675, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.504232, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.5047839, "supported_languages": null}, "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_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.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.5054321, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.505593, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.505748, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.5059168, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.506069, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.506217, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.506958, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.507948, "supported_languages": null}, "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_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.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.508686, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.508853, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.509008, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.5091672, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.509325, "supported_languages": null}, "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_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.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.509566, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.5098932, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.509994, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.510092, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.510785, "supported_languages": null}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.512154, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/shopify/dbt_shopify_source/integration_tests/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 {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\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=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.514528, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.515987, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.516317, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.516418, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.5165172, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.51697, "supported_languages": null}, "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_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671137397.5174248, "supported_languages": null}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/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/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "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_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": {"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.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": {"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.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.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": [], "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/v7.json", "dbt_version": "1.3.0", "generated_at": "2022-10-26T22:53:46.994943Z", "invocation_id": "93672367-11f1-48dc-abc4-59ed018fc7f4", "env": {}, "project_id": "f2f22d4d8db9dfa8a08831bb14141bc2", "user_id": "535a716f-60c0-47b9-9763-5e1b450166b6", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.shopify_source_integration_tests.shopify_order_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "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"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_data", "raw_code": "", "language": "sql", "package_name": "shopify_source_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_data.csv", "original_file_path": "seeds/shopify_order_data.csv", "name": "shopify_order_data", "alias": "shopify_order_data", "checksum": {"name": "sha256", "checksum": "4d0dd043a886a0d9e7680e7ee2cd132717490f75d3a06fe7c38956d901976146"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1666824738.609236, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests`.`shopify_order_data`"}, "seed.shopify_source_integration_tests.shopify_order_line_refund_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64", "location_id": "INT64", "refund_id": "INT64", "order_line_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_line_refund_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_refund_data", "raw_code": "", "language": "sql", "package_name": "shopify_source_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_line_refund_data.csv", "original_file_path": "seeds/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1666824738.621343, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests`.`shopify_order_line_refund_data`"}, "seed.shopify_source_integration_tests.shopify_order_adjustment_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "refund_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_adjustment_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_adjustment_data", "raw_code": "", "language": "sql", "package_name": "shopify_source_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_adjustment_data.csv", "original_file_path": "seeds/shopify_order_adjustment_data.csv", "name": "shopify_order_adjustment_data", "alias": "shopify_order_adjustment_data", "checksum": {"name": "sha256", "checksum": "99899b3532a7e74a67063723058528563d4fedc8114e99e930cfbc8598a16da8"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1666824738.62401, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests`.`shopify_order_adjustment_data`"}, "seed.shopify_source_integration_tests.shopify_product_variant_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "INT64", "product_id": "INT64", "inventory_item_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_product_variant_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_product_variant_data", "raw_code": "", "language": "sql", "package_name": "shopify_source_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests", "path": "shopify_product_variant_data.csv", "original_file_path": "seeds/shopify_product_variant_data.csv", "name": "shopify_product_variant_data", "alias": "shopify_product_variant_data", "checksum": {"name": "sha256", "checksum": "5fbf997eaa32d49016b0ba5acd2201e60309b0b7fb3a83e5a782542502426abc"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1666824738.626473, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests`.`shopify_product_variant_data`"}, "seed.shopify_source_integration_tests.shopify_refund_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "user_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_refund_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_refund_data", "raw_code": "", "language": "sql", "package_name": "shopify_source_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests", "path": "shopify_refund_data.csv", "original_file_path": "seeds/shopify_refund_data.csv", "name": "shopify_refund_data", "alias": "shopify_refund_data", "checksum": {"name": "sha256", "checksum": "1efcab5977150427c6c7ef2c3aff396384bdd80dfd5872752836b027ea78e404"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1666824738.6289222, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests`.`shopify_refund_data`"}, "seed.shopify_source_integration_tests.shopify_transaction_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "INT64", "order_id": "INT64", "refund_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_transaction_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_transaction_data", "raw_code": "", "language": "sql", "package_name": "shopify_source_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests", "path": "shopify_transaction_data.csv", "original_file_path": "seeds/shopify_transaction_data.csv", "name": "shopify_transaction_data", "alias": "shopify_transaction_data", "checksum": {"name": "sha256", "checksum": "353ca5206d7a0982439b57cda81d05e861b924f65071e3c2c2b6ad1ca7fccf75"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1666824738.63141, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests`.`shopify_transaction_data`"}, "seed.shopify_source_integration_tests.shopify_product_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "published_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_product_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_product_data", "raw_code": "", "language": "sql", "package_name": "shopify_source_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests", "path": "shopify_product_data.csv", "original_file_path": "seeds/shopify_product_data.csv", "name": "shopify_product_data", "alias": "shopify_product_data", "checksum": {"name": "sha256", "checksum": "5cc03f90512ac04a6526220040085e4e0488b62ef22e8b201424c7d7cf1bf847"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1666824738.634884, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests`.`shopify_product_data`"}, "seed.shopify_source_integration_tests.shopify_customer_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp", "id": "INT64", "default_address_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_customer_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_customer_data", "raw_code": "", "language": "sql", "package_name": "shopify_source_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests", "path": "shopify_customer_data.csv", "original_file_path": "seeds/shopify_customer_data.csv", "name": "shopify_customer_data", "alias": "shopify_customer_data", "checksum": {"name": "sha256", "checksum": "79bc0a5972c321cefe2973acdd443ce1d42e36b3b23b2298151046d23bdf4bea"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1666824738.6382442, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests`.`shopify_customer_data`"}, "seed.shopify_source_integration_tests.shopify_order_line_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "order_id": "INT64", "id": "INT64", "product_id": "INT64", "variant_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests", "fqn": ["shopify_source_integration_tests", "shopify_order_line_data"], "unique_id": "seed.shopify_source_integration_tests.shopify_order_line_data", "raw_code": "", "language": "sql", "package_name": "shopify_source_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests", "path": "shopify_order_line_data.csv", "original_file_path": "seeds/shopify_order_line_data.csv", "name": "shopify_order_line_data", "alias": "shopify_order_line_data", "checksum": {"name": "sha256", "checksum": "cabaa49c9bd299b34eb2154893a6dd399fbbad7e4ad7036293c8b4cb599199e0"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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 -%}"}}, "created_at": 1666824738.6408699, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests`.`shopify_order_line_data`"}, "model.shopify_source.stg_shopify__order_line": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line"], "unique_id": "model.shopify_source.stg_shopify__order_line", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__order_line.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1666824739.163311, "compiled_code": "with source as (\n\n select * from `dbt-package-testing`.`shopify_source_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 numeric) as \n \n property_charge_interval_frequency\n \n , \n cast(null as STRING) as \n \n property_for_shipping_jan_3_rd_2020\n \n , \n cast(null as numeric) as \n \n property_shipping_interval_frequency\n \n , \n cast(null as STRING) as \n \n property_shipping_interval_unit_type\n \n , \n cast(null as numeric) 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 \n\n\n, cast('' as STRING) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_line`"}, "model.shopify_source.stg_shopify__refund": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__refund"], "unique_id": "model.shopify_source.stg_shopify__refund", "raw_code": "--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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__refund.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "enabled": true}, "created_at": 1666824739.218804, "compiled_code": "--To disable this model, set the shopify__using_refund variable within your dbt_project.yml file to False.\n\n\nwith source as (\n\n select * \n from `dbt-package-testing`.`shopify_source_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 \n\n\n, cast('' as STRING) as source_relation\n\n\n\n \n from source\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__refund`"}, "model.shopify_source.stg_shopify__product": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product"], "unique_id": "model.shopify_source.stg_shopify__product", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__product.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1666824739.193614, "compiled_code": "with source as (\n\n select * from `dbt-package-testing`.`shopify_source_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 \n\n\n, cast('' as STRING) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__product`"}, "model.shopify_source.stg_shopify__product_variant": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__product_variant"], "unique_id": "model.shopify_source.stg_shopify__product_variant", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__product_variant.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1666824739.20367, "compiled_code": "with source as (\n\n select * from `dbt-package-testing`.`shopify_source_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 \n\n\n, cast('' as STRING) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__product_variant`"}, "model.shopify_source.stg_shopify__order": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order"], "unique_id": "model.shopify_source.stg_shopify__order", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__order.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1666824739.189661, "compiled_code": "with source as (\n\n select * from `dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_tmp`\n\n),\n\nrenamed as (\n\n select\n \n \n \n \n id\n \n as order_id , \n \n \n processed_at\n \n as processed_timestamp , \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 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 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 total_weight\n \n as \n \n total_weight\n \n, \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 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 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 \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 cast(null as STRING) 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 test\n \n as is_test_order , \n \n \n token\n \n as \n \n token\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 \n\n\n, cast('' as STRING) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order`"}, "model.shopify_source.stg_shopify__transaction": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__transaction"], "unique_id": "model.shopify_source.stg_shopify__transaction", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__transaction.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1666824739.214166, "compiled_code": "with source as (\n\n select * from `dbt-package-testing`.`shopify_source_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 \n\n\n, cast('' as STRING) as source_relation\n\n\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_source_integration_tests_stg_shopify`.`stg_shopify__transaction`"}, "model.shopify_source.stg_shopify__order_adjustment": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_adjustment"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment", "raw_code": "--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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__order_adjustment.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "enabled": true}, "created_at": 1666824739.222872, "compiled_code": "--To disable this model, set the shopify__using_order_adjustment variable within your dbt_project.yml file to False.\n\n\nwith source as (\n\n select * \n from `dbt-package-testing`.`shopify_source_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 \n\n\n, cast('' as STRING) as source_relation\n\n\n\n \n from source\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`"}, "model.shopify_source.stg_shopify__customer": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__customer"], "unique_id": "model.shopify_source.stg_shopify__customer", "raw_code": "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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__customer.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table"}, "created_at": 1666824739.1532102, "compiled_code": "with source as (\n\n select * from `dbt-package-testing`.`shopify_source_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 \n\n\n, cast('' as STRING) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__customer`"}, "model.shopify_source.stg_shopify__order_line_refund": {"compiled": true, "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", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "stg_shopify__order_line_refund"], "unique_id": "model.shopify_source.stg_shopify__order_line_refund", "raw_code": "--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", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "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, "node_color": null}, "patch_path": "shopify_source://models/stg_shopify.yml", "compiled_path": "target/compiled/shopify_source/models/stg_shopify__order_line_refund.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "table", "enabled": true}, "created_at": 1666824739.15687, "compiled_code": "--To disable this model, set the shopify__using_order_line_refund variable within your dbt_project.yml file to False.\n\n\nwith source as (\n\n select * from `dbt-package-testing`.`shopify_source_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 \n\n\n, cast('' as STRING) as source_relation\n\n\n\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`"}, "model.shopify_source.stg_shopify__customer_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_customer_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__customer_tmp"], "unique_id": "model.shopify_source.stg_shopify__customer_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_customer_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__customer_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1666824739.0375512, "compiled_code": "\n\n\n\n select * \n from `dbt-package-testing`.`shopify_source_integration_tests`.`shopify_customer_data`\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__customer_tmp`"}, "model.shopify_source.stg_shopify__order_line_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_order_line_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_line_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_line_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_order_line_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_line_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1666824739.06095, "compiled_code": "\n\n\n\n select * \n from `dbt-package-testing`.`shopify_source_integration_tests`.`shopify_order_line_data`\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_line_tmp`"}, "model.shopify_source.stg_shopify__refund_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_refund_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__refund_tmp"], "unique_id": "model.shopify_source.stg_shopify__refund_tmp", "raw_code": "--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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_refund_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__refund_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view", "enabled": true}, "created_at": 1666824739.068317, "compiled_code": "--To disable this model, set the shopify__using_refund variable within your dbt_project.yml file to False.\n\n\n\n\n\n\n select * \n from `dbt-package-testing`.`shopify_source_integration_tests`.`shopify_refund_data`\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__refund_tmp`"}, "model.shopify_source.stg_shopify__product_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_product_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_product_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__product_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1666824739.075833, "compiled_code": "\n\n\n\n select * \n from `dbt-package-testing`.`shopify_source_integration_tests`.`shopify_product_data`\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__product_tmp`"}, "model.shopify_source.stg_shopify__order_adjustment_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_order_adjustment_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_adjustment_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_adjustment_tmp", "raw_code": "--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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_order_adjustment_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_adjustment_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view", "enabled": true}, "created_at": 1666824739.0823731, "compiled_code": "--To disable this model, set the shopify__using_order_adjustment variable within your dbt_project.yml file to False.\n\n\n\n\n\n\n select * \n from `dbt-package-testing`.`shopify_source_integration_tests`.`shopify_order_adjustment_data`\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_adjustment_tmp`"}, "model.shopify_source.stg_shopify__order_line_refund_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_order_line_refund_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_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", "raw_code": "--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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_order_line_refund_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_line_refund_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view", "enabled": true}, "created_at": 1666824739.090594, "compiled_code": "--To disable this model, set the shopify__using_order_line_refund variable within your dbt_project.yml file to False.\n\n\n\n\n\n\n select * \n from `dbt-package-testing`.`shopify_source_integration_tests`.`shopify_order_line_refund_data`\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_line_refund_tmp`"}, "model.shopify_source.stg_shopify__transaction_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_transaction_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__transaction_tmp"], "unique_id": "model.shopify_source.stg_shopify__transaction_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_transaction_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__transaction_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1666824739.097536, "compiled_code": "\n\n\n\n select * \n from `dbt-package-testing`.`shopify_source_integration_tests`.`shopify_transaction_data`\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__transaction_tmp`"}, "model.shopify_source.stg_shopify__product_variant_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_product_variant_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__product_variant_tmp"], "unique_id": "model.shopify_source.stg_shopify__product_variant_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [["shopify_product_variant_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__product_variant_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1666824739.1064892, "compiled_code": "\n\n\n\n select * \n from `dbt-package-testing`.`shopify_source_integration_tests`.`shopify_product_variant_data`\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__product_variant_tmp`"}, "model.shopify_source.stg_shopify__order_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["seed.shopify_source_integration_tests.shopify_order_data"]}, "config": {"enabled": true, "alias": null, "schema": "stg_shopify", "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "shopify_source_integration_tests_stg_shopify", "fqn": ["shopify_source", "tmp", "stg_shopify__order_tmp"], "unique_id": "model.shopify_source.stg_shopify__order_tmp", "raw_code": "{{\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}}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": "f4fd2563557b13c2b54531a7fa9995e496aa1b39432d729a010ddcb7e10001ae"}, "tags": [], "refs": [["shopify_order_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/tmp/stg_shopify__order_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_shopify", "materialized": "view"}, "created_at": 1666824739.1130922, "compiled_code": "\n\n\n\n select * \n from `dbt-package-testing`.`shopify_source_integration_tests`.`shopify_order_data`\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_tmp`"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__customer_customer_id__source_relation.1b2185db25": {"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"}, "compiled": true, "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": "dbt-package-testing", "schema": "shopify_source_integration_tests_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d00da641d0cc06ebef083c43ddfae4be"}, "created_at": 1666824739.230339, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n customer_id, source_relation\n from `dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__customer`\n group by customer_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "dbt-package-testing", "schema": "shopify_source_integration_tests_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_33b2f20dc9ea13a94a10a635383becf3"}, "created_at": 1666824739.245148, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n order_line_refund_id, source_relation\n from `dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_line_refund`\n group by order_line_refund_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "dbt-package-testing", "schema": "shopify_source_integration_tests_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d47b5ce640a9316320c17565339223ec"}, "created_at": 1666824739.250438, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n order_line_id, source_relation\n from `dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_line`\n group by order_line_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "dbt-package-testing", "schema": "shopify_source_integration_tests_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3f5201314db17428b709b11583cd0f7e"}, "created_at": 1666824739.256785, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n order_id, source_relation\n from `dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order`\n group by order_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_shopify__order"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__product_product_id__source_relation.48b32ab6a2": {"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"}, "compiled": true, "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": "dbt-package-testing", "schema": "shopify_source_integration_tests_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_eb9efccfbdaff32f938da98287403a1d"}, "created_at": 1666824739.261556, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n product_id, source_relation\n from `dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__product`\n group by product_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "dbt-package-testing", "schema": "shopify_source_integration_tests_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_84d19b85e52ebcaca03bcefe4191b60e"}, "created_at": 1666824739.267117, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n variant_id, source_relation\n from `dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__product_variant`\n group by variant_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "dbt-package-testing", "schema": "shopify_source_integration_tests_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_47aceb0b987e9f3279b4301c10167f92"}, "created_at": 1666824739.2729259, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n transaction_id, source_relation\n from `dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__transaction`\n group by transaction_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_shopify__transaction"}, "test.shopify_source.dbt_utils_unique_combination_of_columns_stg_shopify__refund_refund_id__source_relation.cd4dbc2b35": {"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"}, "compiled": true, "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": "dbt-package-testing", "schema": "shopify_source_integration_tests_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_b6b83918833e84e9f886aa4151e4e659"}, "created_at": 1666824739.2778409, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n refund_id, source_relation\n from `dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__refund`\n group by refund_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "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": {"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"}, "compiled": true, "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": "dbt-package-testing", "schema": "shopify_source_integration_tests_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", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207\") }}", "language": "sql", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/shopify_source/models/stg_shopify.yml/dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_8c4679057a756bef5907cd3799634207"}, "created_at": 1666824739.283241, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n order_adjustment_id, source_relation\n from `dbt-package-testing`.`shopify_source_integration_tests_stg_shopify`.`stg_shopify__order_adjustment`\n group by order_adjustment_id, source_relation\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_shopify__order_adjustment"}}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": "`dbt-package-testing`.`shopify`.`order`", "created_at": 1666824739.373784}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": "`dbt-package-testing`.`shopify`.`customer`", "created_at": 1666824739.374082}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": "`dbt-package-testing`.`shopify`.`order_line`", "created_at": 1666824739.3742342}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": "`dbt-package-testing`.`shopify`.`order_line_refund`", "created_at": 1666824739.374372}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": "`dbt-package-testing`.`shopify`.`product`", "created_at": 1666824739.374509}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": "`dbt-package-testing`.`shopify`.`product_variant`", "created_at": 1666824739.374673}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": "`dbt-package-testing`.`shopify`.`transaction`", "created_at": 1666824739.37484}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": "`dbt-package-testing`.`shopify`.`refund`", "created_at": 1666824739.374975}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": "`dbt-package-testing`.`shopify`.`order_adjustment`", "created_at": 1666824739.3751612}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4132638, "supported_languages": null}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.413732, "supported_languages": null}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4143, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.421014, "supported_languages": null}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.427843, "supported_languages": null}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.428604, "supported_languages": null}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.42934, "supported_languages": null}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4298701, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, compiled_code, language='sql') -%}\n {%- if language == '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 {{ compiled_code }}\n );\n {%- elif language == 'python' -%}\n {#--\n N.B. Python models _can_ write to temp views HOWEVER they use a different session\n and have already expired by the time they need to be used (I.E. in merges for incremental models)\n\n TODO: Deep dive into spark sessions to see if we can reuse a single session for an entire\n dbt invocation.\n --#}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation.quote(database=False, schema=False, identifier=False)) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"bigquery__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\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", "macro.dbt_bigquery.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.431964, "supported_languages": null}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.432728, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4338272, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.434249, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.434649, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.434968, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.435269, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.435575, "supported_languages": null}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.435943, "supported_languages": null}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4365802, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4369159, "supported_languages": null}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.437294, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4380999, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.438875, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4402182, "supported_languages": null}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4405708, "supported_languages": null}, "macro.dbt_bigquery.bigquery__upload_file": {"unique_id": "macro.dbt_bigquery.bigquery__upload_file", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__upload_file", "macro_sql": "{% macro bigquery__upload_file(local_file_path, database, table_schema, table_name) %}\n\n {{ log(\"kwargs: \" ~ kwargs) }}\n\n {% do adapter.upload_file(local_file_path, database, table_schema, table_name, kwargs=kwargs) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.441141, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.441908, "supported_languages": null}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4422479, "supported_languages": null}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4434738, "supported_languages": null}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4446578, "supported_languages": null}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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 -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.446114, "supported_languages": ["sql"]}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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', supported_languages=['sql', 'python']-%}\n\n {%- set language = model['language'] -%}\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 -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\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\n -- build model\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\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.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.452935, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.py_write_table": {"unique_id": "macro.dbt_bigquery.py_write_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation) %}\nfrom pyspark.sql import SparkSession\n\nspark = SparkSession.builder.appName('smallTest').getOrCreate()\n\nspark.conf.set(\"viewsEnabled\",\"true\")\nspark.conf.set(\"temporaryGcsBucket\",\"{{target.gcs_bucket}}\")\n\n{{ compiled_code }}\ndbt = dbtObj(spark.read.format(\"bigquery\").load)\ndf = model(dbt, spark)\n\n# COMMAND ----------\n# this is materialization code dbt generated, please do not modify\n\nimport pyspark\n# make sure pandas exists before using it\ntry:\n import pandas\n pandas_available = True\nexcept ImportError:\n pandas_available = False\n\n# make sure pyspark.pandas exists before using it\ntry:\n import pyspark.pandas\n pyspark_pandas_api_available = True\nexcept ImportError:\n pyspark_pandas_api_available = False\n\n# make sure databricks.koalas exists before using it\ntry:\n import databricks.koalas\n koalas_available = True\nexcept ImportError:\n koalas_available = False\n\n# preferentially convert pandas DataFrames to pandas-on-Spark or Koalas DataFrames first\n# since they know how to convert pandas DataFrames better than `spark.createDataFrame(df)`\n# and converting from pandas-on-Spark to Spark DataFrame has no overhead\nif pyspark_pandas_api_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = pyspark.pandas.frame.DataFrame(df)\nelif koalas_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = databricks.koalas.frame.DataFrame(df)\n\n# convert to pyspark.sql.dataframe.DataFrame\nif isinstance(df, pyspark.sql.dataframe.DataFrame):\n pass # since it is already a Spark DataFrame\nelif pyspark_pandas_api_available and isinstance(df, pyspark.pandas.frame.DataFrame):\n df = df.to_spark()\nelif koalas_available and isinstance(df, databricks.koalas.frame.DataFrame):\n df = df.to_spark()\nelif pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = spark.createDataFrame(df)\nelse:\n msg = f\"{type(df)} is not a supported type for dbt Python materialization\"\n raise Exception(msg)\n\ndf.write \\\n .mode(\"overwrite\") \\\n .format(\"bigquery\") \\\n .option(\"writeMethod\", \"direct\").option(\"writeDisposition\", 'WRITE_TRUNCATE') \\\n .save(\"{{target_relation}}\")\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.453565, "supported_languages": null}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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 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 {%- do apply_grants(target_relation, grant_config) -%}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.456085, "supported_languages": ["sql"]}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, complied_code, language='sql') %}\n\n {#-- TODO: revisit partitioning with python models --#}\n {%- if '_dbt_max_partition' in complied_code and language == '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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.459806, "supported_languages": null}, "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": "/usr/local/lib/python3.9/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\") or '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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.460695, "supported_languages": null}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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 {#-- Because we're putting the model SQL _directly_ into the MERGE statement,\n we need to prepend the MERGE statement with the user-configured sql_header,\n which may be needed to resolve that model SQL (e.g. referencing a variable or UDF in the header)\n in the \"dynamic\" case, we save the model SQL result as a temp table first, wherein the\n sql_header is included by the create_table_as macro.\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, compiled_code) }}\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 -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate]) }};\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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.463043, "supported_languages": null}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, tmp_relation_exists\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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.464704, "supported_languages": null}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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', supported_languages=['sql', 'python'] -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n {%- set language = model['language'] %}\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 -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\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 {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\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 {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% else %}\n {%- if language == 'python' and strategy == 'insert_overwrite' -%}\n {#-- This lets us move forward assuming no python will be directly templated into a query --#}\n {%- set python_unsupported_msg -%}\n The 'insert_overwrite' strategy is not yet supported for python models.\n {%- endset %}\n {% do exceptions.raise_compiler_error(python_unsupported_msg) %}\n {%- endif -%}\n\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' or language == 'python' %}\n {#-- Check first, since otherwise we may not build a temp table --#}\n {#-- Python always needs to create a temp table --#}\n {%- call statement('create_tmp_relation', language=language) -%}\n {{ declare_dbt_max_partition(this, partition_by, compiled_code, language) +\n create_table_as(True, tmp_relation, compiled_code, language)\n }}\n {%- endcall -%}\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\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, compiled_code, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {%- if language == 'python' and tmp_relation -%}\n {{ adapter.drop_relation(tmp_relation) }}\n {%- endif -%}\n\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\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.statement", "macro.dbt.create_table_as", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.473849, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4748359, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.475154, "supported_languages": null}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.475431, "supported_languages": null}, "macro.dbt_bigquery.bigquery__except": {"unique_id": "macro.dbt_bigquery.bigquery__except", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/except.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.475809, "supported_languages": null}, "macro.dbt_bigquery.bigquery__dateadd": {"unique_id": "macro.dbt_bigquery.bigquery__dateadd", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.476393, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.476865, "supported_languages": null}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.477228, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp_backcompat": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp_backcompat", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "bigquery__current_timestamp_backcompat", "macro_sql": "{% macro bigquery__current_timestamp_backcompat() -%}\n current_timestamp\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.47739, "supported_languages": null}, "macro.dbt_bigquery.bigquery__intersect": {"unique_id": "macro.dbt_bigquery.bigquery__intersect", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/intersect.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.477769, "supported_languages": null}, "macro.dbt_bigquery.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_bigquery.bigquery__escape_single_quotes", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.478303, "supported_languages": null}, "macro.dbt_bigquery.bigquery__right": {"unique_id": "macro.dbt_bigquery.bigquery__right", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/right.sql", "original_file_path": "macros/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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.478902, "supported_languages": null}, "macro.dbt_bigquery.bigquery__listagg": {"unique_id": "macro.dbt_bigquery.bigquery__listagg", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/listagg.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4798021, "supported_languages": null}, "macro.dbt_bigquery.bigquery__datediff": {"unique_id": "macro.dbt_bigquery.bigquery__datediff", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n {% if dbt_version[0] == 1 and dbt_version[2] >= 2 %}\n {{ return(dbt.datediff(first_date, second_date, datepart)) }}\n {% else %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.480893, "supported_languages": null}, "macro.dbt_bigquery.bigquery__safe_cast": {"unique_id": "macro.dbt_bigquery.bigquery__safe_cast", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.481408, "supported_languages": null}, "macro.dbt_bigquery.bigquery__hash": {"unique_id": "macro.dbt_bigquery.bigquery__hash", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.481987, "supported_languages": null}, "macro.dbt_bigquery.bigquery__position": {"unique_id": "macro.dbt_bigquery.bigquery__position", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/position.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.482839, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_concat": {"unique_id": "macro.dbt_bigquery.bigquery__array_concat", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "bigquery__array_concat", "macro_sql": "{% macro bigquery__array_concat(array_1, array_2) -%}\n array_concat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4837692, "supported_languages": null}, "macro.dbt_bigquery.bigquery__bool_or": {"unique_id": "macro.dbt_bigquery.bigquery__bool_or", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.484725, "supported_languages": null}, "macro.dbt_bigquery.bigquery__split_part": {"unique_id": "macro.dbt_bigquery.bigquery__split_part", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/split_part.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.486169, "supported_languages": null}, "macro.dbt_bigquery.bigquery__date_trunc": {"unique_id": "macro.dbt_bigquery.bigquery__date_trunc", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4868429, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_construct": {"unique_id": "macro.dbt_bigquery.bigquery__array_construct", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "bigquery__array_construct", "macro_sql": "{% macro bigquery__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n [ {{ inputs|join(' , ') }} ]\n {% else %}\n ARRAY<{{data_type}}>[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.487666, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_append": {"unique_id": "macro.dbt_bigquery.bigquery__array_append", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "bigquery__array_append", "macro_sql": "{% macro bigquery__array_append(array, new_element) -%}\n {{ array_concat(array, array_construct([new_element])) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.array_concat", "macro.dbt.array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4883049, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_show_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_show_grant_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_show_grant_sql", "macro_sql": "{% macro bigquery__get_show_grant_sql(relation) %}\n {% set location = adapter.get_dataset_location(relation) %}\n {% set relation = relation.incorporate(location=location) %}\n\n select privilege_type, grantee\n from {{ relation.information_schema(\"OBJECT_PRIVILEGES\") }}\n where object_schema = \"{{ relation.dataset }}\"\n and object_name = \"{{ relation.identifier }}\"\n -- filter out current user\n and split(grantee, ':')[offset(1)] != session_user()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4895859, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_grant_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_grant_sql", "macro_sql": "\n\n\n{%- macro bigquery__get_grant_sql(relation, privilege, grantee) -%}\n grant `{{ privilege }}` on {{ relation.type }} {{ relation }} to {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.490072, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_revoke_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_revoke_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_revoke_sql", "macro_sql": "{%- macro bigquery__get_revoke_sql(relation, privilege, grantee) -%}\n revoke `{{ privilege }}` on {{ relation.type }} {{ relation }} from {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.490551, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.492626, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.493015, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.49331, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4936, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.493891, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.4947, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.495303, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.495914, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.496814, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.497348, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5049431, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5052822, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.505733, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5071099, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.507444, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5077891, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.510464, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.513087, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.52092, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.521497, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.521837, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.522024, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.522326, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.522569, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.522976, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.52462, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.525002, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.525492, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.526329, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.538738, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5426528, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5435898, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5441852, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.545003, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.54576, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.548502, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.550485, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5519621, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.552425, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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": "default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5539699, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.560492, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.563618, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5640872, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.56572, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5665789, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.568379, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.569859, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.571458, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.571927, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.572299, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.572816, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.573184, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.573696, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.574064, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.574579, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5749528, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.575263, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.575804, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.5861812, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.594363, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.596677, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.599262, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6018748, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.606996, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.608032, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.608402, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.609247, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.61005, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6146328, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.615484, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.616315, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\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", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6200588, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6209338, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.621259, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.621618, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.62213, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "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.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.627978, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.63636, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.638187, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6386392, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6395562, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.639932, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6402, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.64048, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.640716, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.641034, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.641284, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.642224, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.642593, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.645, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6458812, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.646327, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.647348, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.647862, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.64859, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.649966, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.650989, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.651839, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6527739, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.653398, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.654651, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6574311, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.658834, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6594062, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.662308, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6650822, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6667168, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.66735, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.668319, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.668567, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.669415, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.669746, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6704981, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.670754, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.671387, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.671607, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.672383, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.672713, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.673301, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.673462, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.674123, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6744058, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.675116, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.675501, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/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') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.676694, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6774862, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.678255, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.678585, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.679286, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.67957, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.680209, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.680533, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/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') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.681157, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/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 {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.68148, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.682186, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.682444, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.683209, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.68391, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6849961, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.68522, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6870499, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.687716, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.688156, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6884658, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.688789, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.689091, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.689412, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.689763, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6900952, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.690401, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6907232, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.691015, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.691335, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.691635, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.692323, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6925929, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.693223, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.693444, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.694216, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6947782, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.695075, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/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') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6961029, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.696436, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6969879, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6976588, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6979258, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.6992152, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7000508, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7013729, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.701865, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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.default__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7027872, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.703277, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.703617, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.703995, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.705188, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.705504, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7057998, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.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.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.706026, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.706362, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7065222, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.706862, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.707201, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.708158, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.708555, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.70888, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.709671, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7146611, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7152839, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.716062, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.71708, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.717767, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.718443, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7188852, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.719315, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.719676, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7200818, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.720482, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.721049, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.721538, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.722608, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.723161, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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 {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.723451, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.723841, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.724779, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.725609, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.728319, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7285619, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.728894, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.729123, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.729964, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.730508, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.730727, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.731172, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7315571, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.732197, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7328918, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7337081, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.735379, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.736035, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.736526, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.737103, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.739509, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.740921, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.741351, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7417579, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7421, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.742622, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.743551, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.745982, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.746495, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.746866, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.747181, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.747545, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.748039, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.74854, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.749179, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.749559, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7501628, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7539499, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.754456, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.755073, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7554371, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7561002, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.756719, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.757919, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.75842, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.75999, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7626932, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7636092, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == 'language' -%}\n {%- set value = 'python' -%}\n {%- endif -%}\n {%- set value = model.config[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.764487, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = '{{ this.database }}'\n schema = '{{ this.schema }}'\n identifier = '{{ this.identifier }}'\n def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.765752, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.766058, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.767982, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.76864, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.7693, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.769841, "supported_languages": null}, "macro.shopify_source.get_order_columns": {"unique_id": "macro.shopify_source.get_order_columns", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_numeric(), \"alias\": \"order_id\"},\n {\"name\": \"processed_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"user_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"total_discounts\", \"datatype\": dbt.type_float()},\n {\"name\": \"total_line_items_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"total_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"total_tax\", \"datatype\": dbt.type_float()},\n {\"name\": \"source_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"subtotal_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"taxes_included\", \"datatype\": \"boolean\", \"alias\": \"has_taxes_included\"},\n {\"name\": \"total_weight\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"landing_site_base_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"note\", \"datatype\": dbt.type_string()},\n {\"name\": \"number\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"order_number\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"cancel_reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"cancelled_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"cancelled_timestamp\"},\n {\"name\": \"cart_token\", \"datatype\": dbt.type_string()},\n {\"name\": \"checkout_token\", \"datatype\": dbt.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"closed_timestamp\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"customer_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"financial_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"processing_method\", \"datatype\": dbt.type_string()},\n {\"name\": \"referring_site\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_address_1\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_address_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_company\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_latitude\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_longitude\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_province\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_province_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_address_zip\", \"datatype\": dbt.type_string()},\n {\"name\": \"browser_ip\", \"datatype\": dbt.type_string()},\n {\"name\": \"buyer_accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_buyer_accepted_marketing\"},\n {\"name\": \"total_shipping_price_set\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_address_1\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_address_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_company\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_latitude\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_longitude\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_province\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_province_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_address_zip\", \"datatype\": dbt.type_string()},\n {\"name\": \"test\", \"datatype\": \"boolean\", \"alias\": \"is_test_order\"},\n {\"name\": \"token\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_timestamp", "macro.dbt.type_float", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.798017, "supported_languages": null}, "macro.shopify_source.get_customer_columns": {"unique_id": "macro.shopify_source.get_customer_columns", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_timestamp()},\n {\"name\": \"accepts_marketing\", \"datatype\": \"boolean\", \"alias\": \"has_accepted_marketing\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"default_address_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric(), \"alias\": \"customer_id\"},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"orders_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"state\", \"datatype\": dbt.type_string(), \"alias\": \"account_state\"},\n {\"name\": \"tax_exempt\", \"datatype\": \"boolean\", \"alias\": \"is_tax_exempt\"},\n {\"name\": \"total_spent\", \"datatype\": dbt.type_float()},\n {\"name\": \"updated_at\", \"datatype\": dbt.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.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8025558, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric(), \"alias\": \"order_line_refund_id\"},\n {\"name\": \"location_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"order_line_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"subtotal\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"total_tax\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt.type_float()},\n {\"name\": \"refund_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"restock_type\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8043609, "supported_languages": null}, "macro.shopify_source.get_order_line_columns": {"unique_id": "macro.shopify_source.get_order_line_columns", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_timestamp()},\n {\"name\": \"fulfillable_quantity\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt.type_string()},\n {\"name\": \"fulfillment_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"gift_card\", \"datatype\": \"boolean\", \"alias\": \"is_gift_card\"},\n {\"name\": \"grams\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric(), \"alias\": \"order_line_id\"},\n {\"name\": \"index\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"pre_tax_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"price\", \"datatype\": dbt.type_float()},\n {\"name\": \"product_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"property_charge_interval_frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"property_for_shipping_jan_3_rd_2020\", \"datatype\": dbt.type_string()},\n {\"name\": \"property_shipping_interval_frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"property_shipping_interval_unit_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"property_subscription_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"quantity\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"requires_shipping\", \"datatype\": \"boolean\", \"alias\": \"is_requiring_shipping\"},\n {\"name\": \"sku\", \"datatype\": dbt.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"total_discount\", \"datatype\": dbt.type_float()},\n {\"name\": \"variant_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"vendor\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.808825, "supported_languages": null}, "macro.shopify_source.get_product_columns": {"unique_id": "macro.shopify_source.get_product_columns", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"handle\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric(), \"alias\": \"product_id\"},\n {\"name\": \"product_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"published_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"published_timestamp\"},\n {\"name\": \"published_scope\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"vendor\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8110049, "supported_languages": null}, "macro.shopify_source.get_product_variant_columns": {"unique_id": "macro.shopify_source.get_product_variant_columns", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_numeric(), \"alias\": \"variant_id\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"updated_timestamp\"},\n {\"name\": \"product_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"inventory_item_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"image_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"price\", \"datatype\": dbt.type_float()},\n {\"name\": \"sku\", \"datatype\": dbt.type_string()},\n {\"name\": \"position\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"inventory_policy\", \"datatype\": dbt.type_string()},\n {\"name\": \"compare_at_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"fulfillment_service\", \"datatype\": dbt.type_string()},\n {\"name\": \"inventory_management\", \"datatype\": dbt.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\", \"alias\": \"is_taxable\"},\n {\"name\": \"barcode\", \"datatype\": dbt.type_string()},\n {\"name\": \"grams\", \"datatype\": dbt.type_float()},\n {\"name\": \"inventory_quantity\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"weight\", \"datatype\": dbt.type_float()},\n {\"name\": \"weight_unit\", \"datatype\": dbt.type_string()},\n {\"name\": \"option_1\", \"datatype\": dbt.type_string()},\n {\"name\": \"option_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"option_3\", \"datatype\": dbt.type_string()},\n {\"name\": \"tax_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"old_inventory_quantity\", \"datatype\": dbt.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.type_numeric", "macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8160949, "supported_languages": null}, "macro.shopify_source.get_transaction_columns": {"unique_id": "macro.shopify_source.get_transaction_columns", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_numeric(), \"alias\": \"transaction_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"created_timestamp\"},\n {\"name\": \"processed_at\", \"datatype\": dbt.type_timestamp(), \"alias\": \"processed_timestamp\"},\n {\"name\": \"device_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"gateway\", \"datatype\": dbt.type_string()},\n {\"name\": \"source_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"message\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"location_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"payment_avs_result_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"payment_credit_card_bin\", \"datatype\": dbt.type_string()},\n {\"name\": \"payment_cvv_result_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"payment_credit_card_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"payment_credit_card_company\", \"datatype\": dbt.type_string()},\n {\"name\": \"kind\", \"datatype\": dbt.type_string()},\n {\"name\": \"receipt\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency_exchange_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"currency_exchange_adjustment\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"currency_exchange_original_amount\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"currency_exchange_final_amount\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"currency_exchange_currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"test\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{% if target.type in ('redshift','postgres') %}\n {{ columns.append({\"name\": \"authorization\", \"datatype\": dbt.type_string(), \"quote\": True, \"alias\": \"authorization\"}) }}\n{% else %}\n {\"name\": \"authorization\", \"datatype\": dbt.type_string()}\n{% endif %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.823018, "supported_languages": null}, "macro.shopify_source.get_refund_columns": {"unique_id": "macro.shopify_source.get_refund_columns", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric(), \"alias\": \"refund_id\"},\n {\"name\": \"note\", \"datatype\": dbt.type_string()},\n {\"name\": \"order_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"processed_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"restock\", \"datatype\": \"boolean\"},\n {\"name\": \"user_id\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.82459, "supported_languages": null}, "macro.shopify_source.get_order_adjustment_columns": {"unique_id": "macro.shopify_source.get_order_adjustment_columns", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_numeric(), \"alias\": \"order_adjustment_id\"},\n {\"name\": \"order_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"refund_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"tax_amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"kind\", \"datatype\": dbt.type_string()},\n {\"name\": \"reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.826171, "supported_languages": null}, "macro.dbt_utils.xdb_deprecation_warning_without_replacement": {"unique_id": "macro.dbt_utils.xdb_deprecation_warning_without_replacement", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "original_file_path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "name": "xdb_deprecation_warning_without_replacement", "macro_sql": "{% macro xdb_deprecation_warning_without_replacement(macro, package, model) %}\n {%- set error_message = \"Warning: the `\" ~ macro ~\"` macro is deprecated and will be removed in a future version of the package, once equivalent functionality is implemented in dbt Core. The \" ~ package ~ \".\" ~ model ~ \" model triggered this warning.\" -%}\n {%- do exceptions.warn(error_message) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.827022, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.827795, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 split_part(\n split_part(\n replace(\n replace(\n replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8286169, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8295522, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 replace(\n replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ position(\"'/'\", stripped_url) }}, 0),\n {{ position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n split_part(\n right(\n stripped_url,\n length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ safe_cast(\n parsed_path,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.830673, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8314, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 = split_part(split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.832065, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.83516, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8373382, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8388789, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8409321, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8421602, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8428109, "supported_languages": null}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.843946, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns) %}\n\n{% set threshold = dateadd(datepart, interval * -1, current_timestamp_backcompat()) %}\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n max({{field}}) as most_recent\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8451378, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.846072, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8472588, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.848568, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.84951, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.851228, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8521652, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.853195, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.854143, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.855325, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.856555, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8576021, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 {{ except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ 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.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.85824, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.859263, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n {{ column_list }}\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": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8600268, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.861238, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.862798, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8643682, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ type_timestamp() }})= cast({{ dateadd(datepart, interval, previous_column_name) }} as {{ 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.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.867177, "supported_languages": null}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.869283, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 {{ except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ 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.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.871708, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.872787, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.873378, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.878491, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8814359, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.882221, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.882553, "supported_languages": null}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.884299, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.885942, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.886336, "supported_languages": null}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.887108, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.887454, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.888492, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8901381, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.89142, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 {{ 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.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8928, "supported_languages": null}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8932512, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 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.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.893933, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.89466, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8953311, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.8966122, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.898242, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.901097, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.90207, "supported_languages": null}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9024498, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.903608, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.904927, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.90654, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.907434, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.907982, "supported_languages": null}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9093099, "supported_languages": null}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if cols|length <= 0 -%}\n {{- return('*') -}}\n {%- else -%}\n {%- for col in cols %}\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 {%- endfor -%}\n {% endif %}\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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.911277, "supported_languages": null}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.913475, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ 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.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.917886, "supported_languages": null}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.922889, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ string_literal(relation) }} as {{ type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.929376, "supported_languages": null}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.930084, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.930568, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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) -%}\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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9319522, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.932676, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9334028, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9340742, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.934654, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9349911, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 {% 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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.935982, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a variable scoped to the dbt_utils package called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.936449, "supported_languages": null}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.937398, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9384398, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9392052, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.939868, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.942561, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.943317, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.944868, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9458802, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.947857, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9518158, "supported_languages": null}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.953998, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 }} '{{ 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.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.955601, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.956589, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.958055, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.960437, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/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.safe_cast(expr, type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, 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.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.96134, "supported_languages": null}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/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.safe_cast(expr, type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, 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.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9622478, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.962645, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.963521, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9646919, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9657779, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ hash(concat(fields)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.967884, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.968757, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.969122, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.969471, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.971321, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9720168, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.973158, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.974775, "supported_languages": null}, "macro.spark_utils.get_tables": {"unique_id": "macro.spark_utils.get_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9843981, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"unique_id": "macro.spark_utils.get_delta_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.985877, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"unique_id": "macro.spark_utils.get_statistic_columns", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.9877062, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"unique_id": "macro.spark_utils.spark_optimize_delta_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.989127, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.99055, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"unique_id": "macro.spark_utils.spark_analyze_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.992345, "supported_languages": null}, "macro.spark_utils.spark__concat": {"unique_id": "macro.spark_utils.spark__concat", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.992907, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"unique_id": "macro.spark_utils.spark__type_numeric", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.993294, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"unique_id": "macro.spark_utils.spark__dateadd", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824737.99883, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"unique_id": "macro.spark_utils.spark__datediff", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.012169, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"unique_id": "macro.spark_utils.spark__current_timestamp", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0126138, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.012772, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"unique_id": "macro.spark_utils.spark__split_part", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.013943, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.018194, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0189178, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0194528, "supported_languages": null}, "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/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.020035, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"unique_id": "macro.spark_utils.assert_not_null", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.020826, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"unique_id": "macro.spark_utils.default__assert_not_null", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.021228, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"unique_id": "macro.spark_utils.spark__convert_timezone", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.021787, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0227048, "supported_languages": null}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0242949, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.024631, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.024965, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.025294, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.025586, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.025912, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.026885, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.028349, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.03022, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.030725, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0312252, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.031924, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.032904, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.034018, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.034652, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0356019, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0358222, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.036034, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.036244, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.037278, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.038542, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.039814, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0407622, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.04103, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0412989, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0415602, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0418382, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0464718, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.046806, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.04713, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.047445, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0522182, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.053953, "supported_languages": null}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.05424, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.054785, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0553432, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.055607, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.05586, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.056114, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.057112, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0582242, "supported_languages": null}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.059235, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0596428, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.060087, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.060739, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0625129, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.070901, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0716002, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.072524, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0753222, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0764, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0775008, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.077821, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0781372, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.078485, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.078794, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.079102, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0804029, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0825331, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.084804, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0852532, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.0857038, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.086176, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.086498, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.08696, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.087744, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.08796, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.088171, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.089507, "supported_languages": null}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.091845, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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 {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\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=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.096517, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.099351, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.10044, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.1008189, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.101158, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.102441, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666824738.103433, "supported_languages": null}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/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/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "shopify_source._fivetran_synced": {"unique_id": "shopify_source._fivetran_synced", "package_name": "shopify_source", "root_path": "/Users/sheri.nguyen/dbt-packages/shopify/dbt_shopify_source/integration_tests/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": {"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.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": {"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.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.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": [], "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": []}} diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 8c1581a..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_integrations_test + schema: shopify_source_integration_tests_5 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: shopify_source_integrations_test + 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_integrations_test + 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_integrations_test + 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_integrations_test + schema: shopify_source_integration_tests_5 threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" - type: databricks \ No newline at end of file + type: databricks diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index ccf73d1..9de6bb3 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,19 +1,45 @@ name: 'shopify_source_integration_tests' -version: '0.7.0' +version: '0.8.0' profile: 'integration_tests' config-version: 2 vars: + shopify_schema: shopify_source_integration_tests_5 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" + 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" + shopify_abandoned_checkout_shipping_line_identifier: "shopify_abandoned_checkout_shipping_line_data" + shopify_fulfillment_event_identifier: "shopify_fulfillment_event_data" + shopify_tax_line_identifier: "shopify_tax_line_data" dispatch: - macro_namespace: dbt_utils @@ -81,4 +107,67 @@ 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 + 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 + 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_tax_line_data: + +column_types: + price: float + shopify_price_rule_data: + +column_types: + prerequisite_subtotal_range: float + value: float + 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' }}" + type: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}" + shopify_shop_data: + +column_types: + taxes_included: boolean + google_apps_login_enabled: boolean + county_taxes: boolean + shopify_inventory_level_data: + +column_types: + updated_at: timestamp + shopify_inventory_item_data: + +column_types: + updated_at: timestamp + 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' }}" + shopify_tax_line_data: + +column_types: + price: float + rate: float \ 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..9a1c930 --- /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 +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,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 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..56f6408 --- /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 +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_abandoned_checkout_shipping_line_data.csv b/integration_tests/seeds/shopify_abandoned_checkout_shipping_line_data.csv new file mode 100644 index 0000000..62181c4 --- /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 +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 diff --git a/integration_tests/seeds/shopify_collection_data.csv b/integration_tests/seeds/shopify_collection_data.csv new file mode 100644 index 0000000..858d15b --- /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 +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 new file mode 100644 index 0000000..5ad15c6 --- /dev/null +++ b/integration_tests/seeds/shopify_collection_product_data.csv @@ -0,0 +1,4 @@ +collection_id,product_id,_fivetran_synced +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_customer_tag_data.csv b/integration_tests/seeds/shopify_customer_tag_data.csv new file mode 100644 index 0000000..b94bcab --- /dev/null +++ b/integration_tests/seeds/shopify_customer_tag_data.csv @@ -0,0 +1,4 @@ +customer_id,index,_fivetran_synced,value +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 new file mode 100644 index 0000000..ca1f48b --- /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 +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 new file mode 100644 index 0000000..ba588fa --- /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 +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_fulfillment_event_data.csv b/integration_tests/seeds/shopify_fulfillment_event_data.csv new file mode 100644 index 0000000..b4d8120 --- /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,,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,4242667,MA,89420612,in_transit,2022-08-24 06:29:21.000000,01760,false \ 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..42bef50 --- /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 +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 new file mode 100644 index 0000000..8bf44a3 --- /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 +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 new file mode 100644 index 0000000..acb13ae --- /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 +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 new file mode 100644 index 0000000..ca7fb5c --- /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 +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_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 83dbb5e..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 -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 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..1dc1083 --- /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,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_note_attribute_data.csv b/integration_tests/seeds/shopify_order_note_attribute_data.csv new file mode 100644 index 0000000..a3f2e92 --- /dev/null +++ b/integration_tests/seeds/shopify_order_note_attribute_data.csv @@ -0,0 +1,6 @@ +name,order_id,_fivetran_synced,value +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_order_shipping_line_data.csv b/integration_tests/seeds/shopify_order_shipping_line_data.csv new file mode 100644 index 0000000..9496703 --- /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 +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 new file mode 100644 index 0000000..2d0d9b8 --- /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,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 new file mode 100644 index 0000000..a417232 --- /dev/null +++ b/integration_tests/seeds/shopify_order_tag_data.csv @@ -0,0 +1,4 @@ +index,order_id,_fivetran_synced,value +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 new file mode 100644 index 0000000..6cf7c2e --- /dev/null +++ b/integration_tests/seeds/shopify_order_url_tag_data.csv @@ -0,0 +1,4 @@ +key,order_id,_fivetran_synced,value +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 new file mode 100644 index 0000000..7f95496 --- /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 +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 new file mode 100644 index 0000000..a4cd776 --- /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 +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 new file mode 100644 index 0000000..7b44ed3 --- /dev/null +++ b/integration_tests/seeds/shopify_product_tag_data.csv @@ -0,0 +1,6 @@ +index,product_id,_fivetran_synced,value +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/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_shop_data.csv b/integration_tests/seeds/shopify_shop_data.csv new file mode 100644 index 0000000..c54f34f --- /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 +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_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/integration_tests/seeds/shopify_tender_transaction_data.csv b/integration_tests/seeds/shopify_tender_transaction_data.csv new file mode 100644 index 0000000..4022c5a --- /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 +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 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/macros/get_abandoned_checkout_columns.sql b/macros/get_abandoned_checkout_columns.sql new file mode 100644 index 0000000..2903e1c --- /dev/null +++ b/macros/get_abandoned_checkout_columns.sql @@ -0,0 +1,71 @@ +{% 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": "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": "buyer_accepts_marketing", "datatype": "boolean"}, + {"name": "cart_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_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": "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_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": "source_name", "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_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_abandoned_checkout_shipping_line_columns.sql b/macros/get_abandoned_checkout_shipping_line_columns.sql new file mode 100644 index 0000000..25764d2 --- /dev/null +++ b/macros/get_abandoned_checkout_shipping_line_columns.sql @@ -0,0 +1,25 @@ +{% macro get_abandoned_checkout_shipping_line_columns() %} + +{% set columns = [ + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "carrier_identifier", "datatype": dbt.type_string()}, + {"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": "phone", "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()} +] %} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/get_collection_columns.sql b/macros/get_collection_columns.sql new file mode 100644 index 0000000..56529f2 --- /dev/null +++ b/macros/get_collection_columns.sql @@ -0,0 +1,19 @@ +{% macro get_collection_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"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": "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_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_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..64d6add --- /dev/null +++ b/macros/get_fulfillment_columns.sql @@ -0,0 +1,22 @@ +{% 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": "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_fulfillment_event_columns.sql b/macros/get_fulfillment_event_columns.sql new file mode 100644 index 0000000..935a740 --- /dev/null +++ b/macros/get_fulfillment_event_columns.sql @@ -0,0 +1,27 @@ +{% 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/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..7bc2ce5 --- /dev/null +++ b/macros/get_metafield_columns.sql @@ -0,0 +1,20 @@ +{% 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": "value_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_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..abae5fe --- /dev/null +++ b/macros/get_order_columns.sql @@ -0,0 +1,91 @@ +{% 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": "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"}, + {"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": "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_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/macros/get_order_line_columns.sql b/macros/get_order_line_columns.sql new file mode 100644 index 0000000..906b732 --- /dev/null +++ b/macros/get_order_line_columns.sql @@ -0,0 +1,54 @@ +{% 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": "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()}, + {"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')) }} + +{{ 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..818757b --- /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()}, + {"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_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_columns.sql b/macros/get_product_columns.sql new file mode 100644 index 0000000..28c2254 --- /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()}, + {"name": "handle", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_numeric()}, + {"name": "product_type", "datatype": dbt.type_string()}, + {"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()}, + {"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_image_columns.sql b/macros/get_product_image_columns.sql new file mode 100644 index 0000000..7910741 --- /dev/null +++ b/macros/get_product_image_columns.sql @@ -0,0 +1,19 @@ +{% macro get_product_image_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "height", "datatype": dbt.type_int()}, + {"name": "id", "datatype": dbt.type_int()}, + {"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_product_variant_columns.sql b/macros/get_product_variant_columns.sql new file mode 100644 index 0000000..f3fa664 --- /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()}, + {"name": "_fivetran_synced", "datatype": dbt.type_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()}, + {"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"}, + {"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()}, + {"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()} +] %} + +{{ 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..affce51 --- /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()}, + {"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_shop_columns.sql b/macros/get_shop_columns.sql new file mode 100644 index 0000000..407d9ef --- /dev/null +++ b/macros/get_shop_columns.sql @@ -0,0 +1,60 @@ +{% 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": "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": "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": "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": "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": "weight_unit", "datatype": dbt.type_string()}, + {"name": "zip", "datatype": dbt.type_string()} +] %} + +{{ return(columns) }} + +{% endmacro %} 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/macros/get_tender_transaction_columns.sql b/macros/get_tender_transaction_columns.sql new file mode 100644 index 0000000..868db99 --- /dev/null +++ b/macros/get_tender_transaction_columns.sql @@ -0,0 +1,18 @@ +{% 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_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/macros/get_transaction_columns.sql b/macros/get_transaction_columns.sql new file mode 100644 index 0000000..2835938 --- /dev/null +++ b/macros/get_transaction_columns.sql @@ -0,0 +1,45 @@ +{% macro get_transaction_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_numeric()}, + {"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()}, + {"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_code"}) }} +{% else %} + {{ columns.append({"name": "authorization", "datatype": dbt.type_string(), "alias": "authorization_code"}) }} +{% 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/docs.md b/models/docs.md index 69b6ec0..733463e 100644 --- a/models/docs.md +++ b/models/docs.md @@ -2,4 +2,16 @@ 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 %} + +{% 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 diff --git a/models/src_shopify.yml b/models/src_shopify.yml index 34dd321..d91abb9 100644 --- a/models/src_shopify.yml +++ b/models/src_shopify.yml @@ -7,9 +7,11 @@ 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 + identifier: "{{ false if target.type == 'snowflake' else true }}" columns: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" @@ -56,7 +58,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 @@ -122,7 +124,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,20 +138,62 @@ 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 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: 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. columns: - 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 @@ -176,7 +220,27 @@ 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: 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 + identifier: "{{ var('shopify_order_line_identifier', 'order_line') }}" description: Each record represents a line item for an order in Shopify. columns: - name: _fivetran_synced @@ -217,7 +281,61 @@ 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: 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: 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. columns: - name: _fivetran_synced @@ -235,10 +353,18 @@ 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: product + identifier: "{{ var('shopify_product_identifier', 'product') }}" description: Each record represents a product in Shopify. columns: - name: _fivetran_deleted @@ -263,13 +389,21 @@ 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 columns: - 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 @@ -299,7 +433,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 @@ -318,18 +452,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. @@ -339,9 +468,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. @@ -391,7 +520,10 @@ 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. columns: - name: id @@ -413,6 +545,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 @@ -424,14 +557,926 @@ 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') }}" + + - 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') }}" + - 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_ (customer) 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_ (customer) currency. + - name: total_price + 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_ (customer) 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: 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') }}" + - name: collection_id + description: ID referencing the `collection` the product belongs to. + - name: product_id + description: ID referencing the `product`. + + - name: 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"). + identifier: "{{ var('shopify_collection_identifier', '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: 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') }}" + - 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, + 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') }}" + - 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: > + 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') }}" + - 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: > + 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') }}" + - 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: > + 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. + identifier: "{{ var('shopify_inventory_level_identifier', 'inventory_level') }}" + 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: 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') }}" + - 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: > + 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') }}" + - 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: 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') }}" + - 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. + identifier: "{{ var('shopify_order_shipping_line_identifier', 'order_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: 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 in the shop currency. + - name: discounted_price_set + 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 + 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 in shop currency. + - name: price_set + 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 + 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. + identifier: "{{ var('shopify_order_shipping_tax_line_identifier', 'order_shipping_tax_line') }}" + 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. + identifier: "{{ var('shopify_order_tag_identifier', 'order_tag') }}" + 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. + identifier: "{{ var('shopify_order_url_tag_identifier', 'order_url_tag') }}" + 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. + identifier: "{{ var('shopify_price_rule_identifier', 'price_rule') }}" + 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. + identifier: "{{ var('shopify_product_image_identifier', 'product_image') }}" + 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. + identifier: "{{ var('shopify_product_tag_identifier', 'product_tag') }}" + 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. + identifier: "{{ var('shopify_shop_identifier', 'shop') }}" + 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. + identifier: "{{ var('shopify_tender_transaction_identifier', 'tender_transaction') }}" + 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. + identifier: "{{ var('shopify_abandoned_checkout_discount_code_identifier', 'abandoned_checkout_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. + identifier: "{{ var('shopify_order_discount_code_identifier', 'order_discount_code') }}" + 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`. + + - name: abandoned_checkout_shipping_line + 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 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 in _presentment_ (customer) currency. + - 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. + + - name: 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. + 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: 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') }}" + - 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. diff --git a/models/stg_shopify.yml b/models/stg_shopify.yml index e8c066e..2885902 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 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 + 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_timestamp description: The date and time when the customer was created. - name: default_address_id @@ -39,6 +45,14 @@ 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: 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. @@ -63,9 +77,15 @@ 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 + 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. @@ -99,7 +119,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). @@ -113,6 +133,58 @@ 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: index + description: Index of the order line. + - 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 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 + 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 + 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: 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. @@ -126,6 +198,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 @@ -167,7 +243,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 @@ -255,11 +331,39 @@ 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. - - 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 shipping price set for the order in presentment and shop currencies. + - name: checkout_token + description: A unique value when referencing the checkout that's associated with 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 + 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: 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. @@ -269,7 +373,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') }}" @@ -291,6 +395,15 @@ 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: 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 @@ -303,7 +416,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 @@ -322,8 +435,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 @@ -336,8 +447,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 @@ -354,6 +463,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. @@ -371,7 +482,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. @@ -425,6 +536,10 @@ 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: 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. @@ -452,6 +567,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. @@ -470,15 +587,1150 @@ 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 + 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - checkout_id + - source_relation + 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. + - not_null + - 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_ (customer) 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_ (customer) currency. + - name: total_price + 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_ (customer) 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: 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: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - collection_id + - product_id + - source_relation + 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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"). + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - collection_id + - source_relation + columns: + - name: is_deleted + description: "{{ doc('_fivetran_deleted') }}" + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: rule_logic + 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 + description: The ID for the collection. + tests: + - not_null + - 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 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 + description: > + 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. + - `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: 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - customer_id + - index + - source_relation + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (starting from 1) representing 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. + - 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, + 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') }}" + - 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. + tests: + - not_null + - 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - fulfillment_id + - source_relation + 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. + tests: + - not_null + - 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: 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 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: > + 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. + 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 + 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - inventory_item_id + - source_relation + 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. + tests: + - not_null + - 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 + 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - inventory_item_id + - location_id + - source_relation + 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. + 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. + - 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - location_id + - source_relation + columns: + - name: is_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. + tests: + - 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. + 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - metafield_id + - source_relation + 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. + tests: + - 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 + 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: 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: source_relation + description: "{{ doc('source_relation') }}" + - 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 + - source_relation + 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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') }}" + - 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 in shop currency. + - name: discounted_price_set + 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: + - not_null + - 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 in shop currency. + - name: price_set + 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 + 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - order_shipping_line_id + - index + - source_relation + 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 record is associated with. + tests: + - not_null + - 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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 + - source_relation + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (starting from 1) representing 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: 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - order_id + - key + - source_relation + 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - price_rule_id + - source_relation + 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: price_rule_id + description: The ID for the price rule. + tests: + - 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: 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: 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: 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: 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: 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: 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. + - 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). + 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. + 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. + tests: + - accepted_values: + 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - product_image_id + - source_relation + columns: + - 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: product_image_id + description: Unique numeric identifier of the product image. + tests: + - 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 + 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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 + - source_relation + columns: + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: index + description: Index (starting from 1) representing 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: 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - shop_id + - source_relation + columns: + - name: is_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: 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. + - 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: 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. + - 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: is_eligible_for_card_reader_giveaway + description: Boolean representing whether the shop is eligible to receive a free credit card reader from Shopify. + - 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: google_apps_domain + description: The GSuite URL for the store, if applicable. + - 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. + - 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: shop_id + description: The ID for the shop. A 64-bit unsigned integer. + tests: + - not_null + - 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: myshopify_domain + description: The shop's .myshopify.com domain. + - name: name + description: The name of the shop. + - 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. + - 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: is_pre_launch_enabled + 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 + 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: is_extra_payments_agreement_required + description: Boolean representing whether the shop requires an extra Shopify Payments agreement. + - 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: has_shipping_taxes + description: Boolean representing whether taxes are charged for shipping. Valid values are true or false. + - 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. + - 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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 + 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') }}" + - 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: transaction_id + description: The ID of the transaction. + tests: + - not_null + - 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: 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. + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - checkout_id + - code + - discount_id + - source_relation + 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. + 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: 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: source_relation + description: "{{ doc('source_relation') }}" + + - 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 + - source_relation + 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. + 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`. + - 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: + - checkout_id + - index + - 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 in _presentment_ (customer) currency. + - 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: 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. + - 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') }}" + + - 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__abandoned_checkout.sql b/models/stg_shopify__abandoned_checkout.sql new file mode 100644 index 0000000..fe0a842 --- /dev/null +++ b/models/stg_shopify__abandoned_checkout.sql @@ -0,0 +1,98 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + _fivetran_deleted as is_deleted, + abandoned_checkout_url, + 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, + buyer_accepts_marketing as has_buyer_accepted_marketing, + cart_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(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, + device_id, + email, + gateway, + id as checkout_id, + landing_site_base_url, + location_id, + name, + note, + 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_last_name, + shipping_address_latitude, + shipping_address_longitude, + shipping_address_name, + shipping_address_phone, + shipping_address_province, + shipping_address_province_code, + shipping_address_zip, + source_name, + subtotal_price, + taxes_included as has_taxes_included, + token, + total_discounts, + total_duties, + total_line_items_price, + total_price, + total_tax, + total_weight, + {{ 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, + {{ 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/stg_shopify__abandoned_checkout_discount_code.sql b/models/stg_shopify__abandoned_checkout_discount_code.sql new file mode 100644 index 0000000..38aff52 --- /dev/null +++ b/models/stg_shopify__abandoned_checkout_discount_code.sql @@ -0,0 +1,44 @@ +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() + ) + }} + , 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 +), + +final as ( + + select + checkout_id, + upper(code) as code, + discount_id, + amount, + type, + {{ 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 n = 1 +) + +select * +from final 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..fe60ade --- /dev/null +++ b/models/stg_shopify__abandoned_checkout_shipping_line.sql @@ -0,0 +1,52 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as abandoned_checkout_shipping_line_id, + checkout_id, + index, + carrier_identifier, + code as shipping_code, + delivery_category, + delivery_expectation_range, + delivery_expectation_range_max, + delivery_expectation_range_min, + delivery_expectation_type, + discounted_price, + phone, + price, + requested_fulfillment_service_id, + source, + 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/stg_shopify__collection.sql b/models/stg_shopify__collection.sql new file mode 100644 index 0000000..7c6c536 --- /dev/null +++ b/models/stg_shopify__collection.sql @@ -0,0 +1,49 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as collection_id, + _fivetran_deleted as is_deleted, + case + when disjunctive is null then null + when disjunctive then 'disjunctive' + else 'conjunctive' end as rule_logic, + handle, + published_scope, + rules, + sort_order, + title, + {{ 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 +) + +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..1d6d56a --- /dev/null +++ b/models/stg_shopify__collection_product.sql @@ -0,0 +1,38 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + collection_id, + product_id, + {{ 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/stg_shopify__customer.sql b/models/stg_shopify__customer.sql index 32e943c..a5d169d 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,52 @@ 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 -) +), + +final as ( -select * from renamed + select + id as customer_id, + lower(email) as email, + first_name, + last_name, + orders_count, + default_address_id, + phone, + lower(state) as account_state, + tax_exempt as is_tax_exempt, + total_spent, + verified_email as is_verified_email, + note, + 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(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 + + {{ 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__customer_tag.sql b/models/stg_shopify__customer_tag.sql new file mode 100644 index 0000000..f03c7a9 --- /dev/null +++ b/models/stg_shopify__customer_tag.sql @@ -0,0 +1,39 @@ + +with base as ( + + select * + from {{ ref('stg_shopify__customer_tag_tmp') }} +), + +fields as ( + + select + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(ref('stg_shopify__customer_tag_tmp')), + staging_columns=get_customer_tag_columns() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + customer_id, + index, + value, + {{ 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/stg_shopify__discount_code.sql b/models/stg_shopify__discount_code.sql new file mode 100644 index 0000000..f464046 --- /dev/null +++ b/models/stg_shopify__discount_code.sql @@ -0,0 +1,43 @@ +-- this model will be all NULL until you create a discount code in Shopify + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as discount_code_id, + 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, + {{ 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 +) + +select * +from final diff --git a/models/stg_shopify__fulfillment.sql b/models/stg_shopify__fulfillment.sql new file mode 100644 index 0000000..eb2749a --- /dev/null +++ b/models/stg_shopify__fulfillment.sql @@ -0,0 +1,49 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as fulfillment_id, + location_id, + order_id, + name, + service, + shipment_status, + lower(status) as status, + tracking_company, + tracking_number, + tracking_numbers, + tracking_urls, + {{ 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 +) + +select * +from final diff --git a/models/stg_shopify__fulfillment_event.sql b/models/stg_shopify__fulfillment_event.sql new file mode 100644 index 0000000..08cc683 --- /dev/null +++ b/models/stg_shopify__fulfillment_event.sql @@ -0,0 +1,56 @@ +{{ config(enabled=var('shopify_using_fulfillment_event', false)) }} + +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__inventory_item.sql b/models/stg_shopify__inventory_item.sql new file mode 100644 index 0000000..d64a081 --- /dev/null +++ b/models/stg_shopify__inventory_item.sql @@ -0,0 +1,46 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as inventory_item_id, + sku, + _fivetran_deleted as is_deleted, -- won't filter out for now + cost, + country_code_of_origin, + province_code_of_origin, + requires_shipping as is_shipping_required, + tracked as is_inventory_quantity_tracked, + {{ 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 +) + +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..7d3e094 --- /dev/null +++ b/models/stg_shopify__inventory_level.sql @@ -0,0 +1,40 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + inventory_item_id, + location_id, + available as available_quantity, + {{ 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 +) + +select * +from final diff --git a/models/stg_shopify__location.sql b/models/stg_shopify__location.sql new file mode 100644 index 0000000..c102d75 --- /dev/null +++ b/models/stg_shopify__location.sql @@ -0,0 +1,55 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as location_id, + name, + _fivetran_deleted as is_deleted, + active as is_active, + address_1, + address_2, + city, + country, + country_code, + country_name, + legacy as is_legacy, + localized_country_name, + localized_province_name, + phone, + province, + province_code, + zip, + {{ 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 +) + +select * +from final diff --git a/models/stg_shopify__metafield.sql b/models/stg_shopify__metafield.sql new file mode 100644 index 0000000..19d032e --- /dev/null +++ b/models/stg_shopify__metafield.sql @@ -0,0 +1,48 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as metafield_id, + description, + namespace, + key, + value, + lower(coalesce(type, value_type)) as value_type, + owner_id as owner_resource_id, + owner_resource, + {{ 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 +) + +select * +from final diff --git a/models/stg_shopify__order.sql b/models/stg_shopify__order.sql index 17798dd..19c5587 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,20 +16,107 @@ 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') }} - from source + from base + +), + +final as ( + + select + id as order_id, + 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, + location_id, + name, + note, + number, + order_number, + 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_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, + lower(email) as 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, + 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, + token, + app_id, + checkout_id, + client_details_user_agent, + customer_locale, + order_status_url, + presentment_currency, + 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 ) -select * from renamed \ No newline at end of file +select * +from final +where not coalesce(is_test_order, false) +and not coalesce(is_deleted, false) \ No newline at end of file diff --git a/models/stg_shopify__order_adjustment.sql b/models/stg_shopify__order_adjustment.sql index 9570f35..e0c1fc7 100644 --- a/models/stg_shopify__order_adjustment.sql +++ b/models/stg_shopify__order_adjustment.sql @@ -1,14 +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 -with source as ( +with base as ( select * from {{ ref('stg_shopify__order_adjustment_tmp') }} ), -renamed as ( +fields as ( select {{ @@ -23,7 +22,26 @@ renamed as ( union_database_variable='shopify_union_databases') }} - from source + from base +), + +final as ( + + select + id as order_adjustment_id, + order_id, + refund_id, + amount, + amount_set, + tax_amount, + tax_amount_set, + kind, + reason, + {{ 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 renamed +select * +from final \ No newline at end of file diff --git a/models/stg_shopify__order_discount_code.sql b/models/stg_shopify__order_discount_code.sql new file mode 100644 index 0000000..851f3ba --- /dev/null +++ b/models/stg_shopify__order_discount_code.sql @@ -0,0 +1,41 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + order_id, + 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, + 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 +) + +select * +from final diff --git a/models/stg_shopify__order_line.sql b/models/stg_shopify__order_line.sql index ab0297f..97175f4 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,21 +16,69 @@ 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') }} - from source + from base -) +), -select * from renamed +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, + pre_tax_price, + pre_tax_price_set, + price, + price_set, + product_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, + 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 + + {{ fivetran_utils.fill_pass_through_columns('order_line_pass_through_columns') }} + + from fields + +) +select * +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 f1ad8bb..7f5d43c 100644 --- a/models/stg_shopify__order_line_refund.sql +++ b/models/stg_shopify__order_line_refund.sql @@ -1,13 +1,13 @@ ---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 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,21 +18,35 @@ 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') }} - from source + from base -) +), -select * from renamed +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, + {{ 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') }} + + from fields +) +select * +from final \ No newline at end of file diff --git a/models/stg_shopify__order_note_attribute.sql b/models/stg_shopify__order_note_attribute.sql new file mode 100644 index 0000000..70aa616 --- /dev/null +++ b/models/stg_shopify__order_note_attribute.sql @@ -0,0 +1,39 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + order_id, + name, + value, + {{ 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/stg_shopify__order_shipping_line.sql b/models/stg_shopify__order_shipping_line.sql new file mode 100644 index 0000000..1d5579f --- /dev/null +++ b/models/stg_shopify__order_shipping_line.sql @@ -0,0 +1,49 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as order_shipping_line_id, + order_id, + carrier_identifier, + code, + delivery_category, + discounted_price, + discounted_price_set, + phone, + price, + price_set, + requested_fulfillment_service_id is not null as is_third_party_required, + source, + 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/stg_shopify__order_shipping_tax_line.sql b/models/stg_shopify__order_shipping_tax_line.sql new file mode 100644 index 0000000..f00c49f --- /dev/null +++ b/models/stg_shopify__order_shipping_tax_line.sql @@ -0,0 +1,42 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + order_shipping_line_id, + index, + 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/stg_shopify__order_tag.sql b/models/stg_shopify__order_tag.sql new file mode 100644 index 0000000..a12d4d9 --- /dev/null +++ b/models/stg_shopify__order_tag.sql @@ -0,0 +1,39 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + order_id, + index, + value, + {{ 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/stg_shopify__order_url_tag.sql b/models/stg_shopify__order_url_tag.sql new file mode 100644 index 0000000..2497166 --- /dev/null +++ b/models/stg_shopify__order_url_tag.sql @@ -0,0 +1,39 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + order_id, + key, + value, + {{ 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/stg_shopify__price_rule.sql b/models/stg_shopify__price_rule.sql new file mode 100644 index 0000000..152c34d --- /dev/null +++ b/models/stg_shopify__price_rule.sql @@ -0,0 +1,57 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as price_rule_id, + allocation_limit, + allocation_method, + customer_selection, + 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, + target_selection, + target_type, + title, + usage_limit, + value, + value_type, + {{ 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 +) + +select * +from final diff --git a/models/stg_shopify__product.sql b/models/stg_shopify__product.sql index 6be960f..4e22d95 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 + id as product_id, + handle, + product_type, + published_scope, + title, + 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_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 + + {{ 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_image.sql b/models/stg_shopify__product_image.sql new file mode 100644 index 0000000..54844c4 --- /dev/null +++ b/models/stg_shopify__product_image.sql @@ -0,0 +1,46 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as product_image_id, + product_id, + height, + position, + src, + variant_ids, + width, + {{ 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__product_tag.sql b/models/stg_shopify__product_tag.sql new file mode 100644 index 0000000..162c3a5 --- /dev/null +++ b/models/stg_shopify__product_tag.sql @@ -0,0 +1,39 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + product_id, + index, + value, + {{ 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/stg_shopify__product_variant.sql b/models/stg_shopify__product_variant.sql index 13c0fb5..5ef39ca 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, + 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, + coalesce(inventory_quantity, old_inventory_quantity) as inventory_quantity, + weight, + weight_unit, + option_1, + 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_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 + + {{ 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..8835a90 100644 --- a/models/stg_shopify__refund.sql +++ b/models/stg_shopify__refund.sql @@ -1,14 +1,13 @@ ---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 source as ( +with base as ( select * from {{ ref('stg_shopify__refund_tmp') }} ), -renamed as ( +fields as ( select {{ @@ -23,7 +22,25 @@ renamed as ( union_database_variable='shopify_union_databases') }} - from source + from base +), + +final as ( + + select + id as refund_id, + note, + order_id, + restock, + total_duties_set, + user_id, + {{ 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 ) -select * from renamed +select * +from final \ No newline at end of file diff --git a/models/stg_shopify__shop.sql b/models/stg_shopify__shop.sql new file mode 100644 index 0000000..0e2068d --- /dev/null +++ b/models/stg_shopify__shop.sql @@ -0,0 +1,87 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as shop_id, + name, + _fivetran_deleted as is_deleted, + address_1, + address_2, + city, + province, + province_code, + country, + country_code, + country_name, + zip, + latitude, + longitude, + case when county_taxes is null then false else county_taxes end as has_county_taxes, + currency, + enabled_presentment_currencies, + customer_email, + email, + domain, + phone, + timezone, + iana_timezone, + primary_locale, + weight_unit, + myshopify_domain, + cookie_consent_level, + shop_owner, + source, + tax_shipping as has_shipping_taxes, + 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, + 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, + 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, + money_with_currency_in_emails_format, + plan_display_name, + plan_name, + password_enabled as is_password_enabled, + pre_launch_enabled as is_pre_launch_enabled, + requires_extra_payments_agreement as is_extra_payments_agreement_required, + setup_required as is_setup_required, + {{ 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 +) + +select * +from final 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/stg_shopify__tender_transaction.sql b/models/stg_shopify__tender_transaction.sql new file mode 100644 index 0000000..95090df --- /dev/null +++ b/models/stg_shopify__tender_transaction.sql @@ -0,0 +1,45 @@ + +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() + ) + }} + + {{ fivetran_utils.source_relation( + union_schema_variable='shopify_union_schemas', + union_database_variable='shopify_union_databases') + }} + + from base +), + +final as ( + + select + id as transaction_id, + order_id, + amount, + currency, + payment_method, + remote_reference, + user_id, + {{ 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 + where not coalesce(test, false) +) + +select * +from final diff --git a/models/stg_shopify__transaction.sql b/models/stg_shopify__transaction.sql index 6dc51d2..4973051 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, + 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, + 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_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 + + {{ 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__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_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 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..611a7be --- /dev/null +++ b/models/tmp/stg_shopify__abandoned_checkout_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..e44e4d5 --- /dev/null +++ b/models/tmp/stg_shopify__collection_product_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..f383fa3 --- /dev/null +++ b/models/tmp/stg_shopify__collection_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..cbb8568 --- /dev/null +++ b/models/tmp/stg_shopify__customer_tag_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..eba47d3 --- /dev/null +++ b/models/tmp/stg_shopify__discount_code_tmp.sql @@ -0,0 +1,37 @@ +-- 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', + 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' + ) +}} + +{% 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 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..085d9ba --- /dev/null +++ b/models/tmp/stg_shopify__fulfillment_event_tmp.sql @@ -0,0 +1,14 @@ +{{ config(enabled=var('shopify_using_fulfillment_event', false)) }} + +{{ + 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 diff --git a/models/tmp/stg_shopify__fulfillment_tmp.sql b/models/tmp/stg_shopify__fulfillment_tmp.sql new file mode 100644 index 0000000..ed0ad78 --- /dev/null +++ b/models/tmp/stg_shopify__fulfillment_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..10e7519 --- /dev/null +++ b/models/tmp/stg_shopify__inventory_item_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..55679d1 --- /dev/null +++ b/models/tmp/stg_shopify__inventory_level_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..96da314 --- /dev/null +++ b/models/tmp/stg_shopify__location_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..d1f0beb --- /dev/null +++ b/models/tmp/stg_shopify__metafield_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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_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_discount_code_tmp.sql b/models/tmp/stg_shopify__order_discount_code_tmp.sql new file mode 100644 index 0000000..d219fa5 --- /dev/null +++ b/models/tmp/stg_shopify__order_discount_code_tmp.sql @@ -0,0 +1,12 @@ +{{ + fivetran_utils.union_data( + table_identifier='order_discount_code', + database_variable='shopify_database', + schema_variable='shopify_schema', + default_database=target.database, + default_schema='shopify', + default_variable='order_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__order_line_refund_tmp.sql b/models/tmp/stg_shopify__order_line_refund_tmp.sql index 3620920..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,13 @@ ---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, + 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( @@ -12,4 +20,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 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..4f96e75 --- /dev/null +++ b/models/tmp/stg_shopify__order_note_attribute_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..7c5be03 --- /dev/null +++ b/models/tmp/stg_shopify__order_shipping_line_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..95ebf74 --- /dev/null +++ b/models/tmp/stg_shopify__order_shipping_tax_line_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..8e1d3b9 --- /dev/null +++ b/models/tmp/stg_shopify__order_tag_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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_tmp.sql b/models/tmp/stg_shopify__order_tmp.sql index 81a23ad..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='order', + table_identifier='order', database_variable='shopify_database', schema_variable='shopify_schema', default_database=target.database, 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..ae41b1e --- /dev/null +++ b/models/tmp/stg_shopify__order_url_tag_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..79c113f --- /dev/null +++ b/models/tmp/stg_shopify__price_rule_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..10bcdc8 --- /dev/null +++ b/models/tmp/stg_shopify__product_image_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 new file mode 100644 index 0000000..eb8e720 --- /dev/null +++ b/models/tmp/stg_shopify__product_tag_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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__refund_tmp.sql b/models/tmp/stg_shopify__refund_tmp.sql index 80de149..d57c0ce 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,20 @@ 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_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.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/models/tmp/stg_shopify__shop_tmp.sql b/models/tmp/stg_shopify__shop_tmp.sql new file mode 100644 index 0000000..8237a34 --- /dev/null +++ b/models/tmp/stg_shopify__shop_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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__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 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..6652097 --- /dev/null +++ b/models/tmp/stg_shopify__tender_transaction_tmp.sql @@ -0,0 +1,12 @@ +{{ + 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 diff --git a/packages.yml b/packages.yml index 908f471..c2758dd 100644 --- a/packages.yml +++ b/packages.yml @@ -3,3 +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_expectations + version: [">=0.8.0", "<0.9.0"] \ No newline at end of file